• LOG IN
  • REGISTER
  • ISSUES

Make, Hack, Void

  • home
  • projects
  • news
  • community
Home

MHV AVR Tools - A WinAVR Replacement

deece — Sat, 05/11/2011 - 8:55am

We have built our own set of tools in a WinAVR-like layout suitable for use as a replacement. Please note that no guarantees as to fitness or suitability are being made. In particular,GCC 4.6.x has not been tested as extensively as GCC 4.4.x, so use our builds at your own risk.

For those building with AVR-Eclipse, a patch that teaches it about the new environment is available on the AVR Eclipse feature request tracker. To make life easier, I have a replacement jar available. Just copy it to eclipse/plugins after installing AVR-Eclipse.

Installing the Binary Package

Download and run the installer (.exe on Windows, or .runme on Linux & OSX) from the releases at the bottom of this page.

What is Included

The following packages (and their dependancies) are included in MHV AVR Tools.

  • GCC 4.7.2
  • BinUtils 2.22
  • AVR LibC 1.8.0
  • AVRDude
  • SimAVR
  • GDB

Installing from Source

Windows Dependancies

Install the MinGW development environment

  • Download and install mingw-get-inst from http://sourceforge.net/projects/mingw/files/, select all developer options
  • Install the following components
    • mingw-get install msys-wget

    • mingw-get install msys-unzip

Install Git

  • Download and install Git for Windows

Linux Dependancies

You will need to install the following utilities on your Linux installation in order to compile MHV AVR Tools

  • gcc
  • g++ (gcc-c++)
  • git
  • patch
  • wget
  • bison
  • flex
  • texinfo
  • zip/unzip

OS X Lion Dependancies

Install XCode from the AppStore and then start Xcode and use Xcode->Preferences->Downloads to install component named "Command Line Tools". The tools will be in /usr/bin folder.

Patch the broken system headers with patches/osx-System-Library-Frameworks-IOKit.framework-Headers-usb-USB.h.patch

Build & Install MHV AVR Tools

  • Clone the MHV AVR Tools git repository:

    git clone http://git.makehackvoid.com/mhvavrtools.git

  • Within your MinGW environment...
    • cd to the mhvavrtools directory
    • run fetch.sh to download the required sources
    • run build.sh to compile the components
    • run build-archive.sh to package the distributable (unix only)

Todo

  • Support xmega microcontrollers
  • Include MHVlib
  • Add fixed-point support

Source Browser

You can view the changelog and source code online in our git repository.

 

Downloads

  • View all releasesRSS feed of all releases

Development

  • View pending patches

  • Login or register to post comments
  • Printer-friendly version

MHV_AVR_Tools_20121007.exe: Incorrect multilib layout

SprinterSB — Thu, 15/11/2012 - 8:43am

MHV_AVR_Tools_20121007.exe has a wrong location of some *.a and *.o files, namely

./lib/gcc/$target/$version\tiny-stack
./lib/gcc/$target/$version\avr25\tiny-stack

don't contain any objects from AVR-Libc. The objects are located in the wrong place.

This will lead to dysfunction of all devices with 8-bit spack pointer.

Root cause is presumably that you use an AVR-Libc that does not implement #35407.

Fix is to use AVR-Libc from its current trunk, or at least from trunk SVN 2291 (2012-01-11) or newer.

BTW: Your "Preview" Button shreds the plain text layout and stuffs it all together to one ugly line...

  • Login or register to post comments

Thanks

deece — Sat, 17/11/2012 - 9:00pm

Thanks Sprinter. I was using the latest published release (1.8.0). I'll build from SVN for the next release of MHV AVR Tools (at least until a new release of AVR LibC is released).

  • Login or register to post comments

libintl-8.dll not found aborts avr-gcc

SprinterSB — Thu, 15/11/2012 - 8:30am

There is a problem in your installer. What I did:

1) Installed MHV_AVR_Tools_20121007.exe with "Add to Path" unchecked, OS = Win2000.

2) Renamed installation directory after install (should not matter, just for completeness)

3) Called avr-gcc by its absolute path name like
$ avr-gcc foo.c

A window will pop up, complain that libintl-8.dll cannot be found, and aborts execution.

Problem is the Windows search policy that does not allow to use LD_LIBRARY_PATH or LIBPATH together with the GCC driver in ./bin that execs, say, ./libexec/gcc/$target/$version/cc1.exe.

Windows will search for the dll in the directory where avr-gcc resides, but not in the place of cc1 et al.

Consequently, one possible fix is to copy libintl-8.dll to the latter directory.

As your installer offers not to change PATH (which is reasonable and appreciated), IMHO it should work properly.

Actually I don't understand why this library is needed in the first place. Maybe you can shed some light on that?

  • Login or register to post comments

PATH

deece — Sat, 17/11/2012 - 9:14pm

If you did not allow the installer to set the system path, you should run avrvars.bat in the root of the installation to set up your environment appropriately. This is done automatically from the MHV AVR Shell icon that the installer creates in the start menu.

You can see the configure arguments to GCC that I have used here. If you can suggest any improvements, I am happy to hear them.

Having said that, there are other DLLs in the MHV AVR Tools bin directory which are required for other utilities (eg. libusb for AVRDude), so for the general case, I don't think it is reasonable to expect things to work without having established an appropriate environment.

 

  • Login or register to post comments

avrvars.bat

SprinterSB — Mon, 19/11/2012 - 1:31am

But avrvars.bat will set PATH, which is already deemed as not wanted.

Moreover, avrvars.bat will fail if you move the installation (as opposed to the GNU Tools which can be freely move without almost any restriction)

Please notice that I had a look at MHV to spot potential problems. I don't seek help here, I am reporting back problems that I encountered so that you can improve your distribution.

Comparing the cc1.exe dependencies for your build comparing with my 4.7.2 yields the following:

Accorning to depends, both builds need: CC1.EXE, GDI32.DLL, KERNEL32.DLL, MSVCRT.DLL, NTDLL.DLL, USER32.DLL.

In addition, the MHV build needs: ADVAPI32.DLL, RPCRT4.DLL, LIBGCC_S_DW2-1.DLL, LIBICONV-2.DLL, LIBINTL-8.DLL.

Perhaps it's a good idea to configure Binutils and GCC with --disable-nls ?

This also helps people that seek the web for help with their application code, because they post error and warning in english and not in german, tratitional chinese or khmer Wink

  • Login or register to post comments

Thanks

deece — Mon, 19/11/2012 - 7:43pm

Ok, I can disable nls in the next release Smile

  • Login or register to post comments

Em::Blocks IDE has HMV tool chain support

EmBlocks — Thu, 04/10/2012 - 4:16pm

Hi, I have added MHV compiler toolchain support in the Em::Blocks IDE with native Atmel workspace and project loader and with AVR assembler highlighting. If the MHV tools are already installed then Em::Blocks will recognize this. Em::Blocks also supports: - PIC18, 24, 30 and 32 with Mplab8 projects import - Arm with the RealView toolchains and uVision project files - Arm with Yagarto toolchain The current version is 1.80 and at version 2.0 the GDB debugger is a part of the install package. The debugger will support Arm, MIPS, Avr and MSP430. Only the windows version is available right now. You can find the tool here: http://www.emblocks.org/forum/viewtopic.php?f=1&t=37 Maybe this is an interesting tool for your community.

  • Login or register to post comments

Thanks

deece — Sat, 06/10/2012 - 1:05pm

Awesome, thanks for the heads up.

  • Login or register to post comments

Usage with AVR Studio

Mark 83 — Sat, 14/04/2012 - 6:11am

Is it possible to use this toolchain as a drop-in replacement for the AVR GNU Toolchain which I currently use with AVR Studio 4 ? Are there any config files in AVR Studio that can be adapted to force it to use this toolchain?

  • Login or register to post comments

Not sure

deece — Thu, 26/04/2012 - 7:58am

Hi Mark,

Sorry, I haven't tried this myself. In principle, it should be possible so I suggest you give it a try, and let us know how you went.

  • Login or register to post comments

Forgot to reply. While I

Mark 83 — Tue, 01/05/2012 - 1:05am

Forgot to reply. While I couldn't find a solution to direct integration of this toolchain with AVR Studio 4.19 (build 730), there is always a project specific workaround. In the configuration options for your project, AVR Studio asks for the location of the AVR-GCC exceutable and the make executable. If you make it point to MHV-AVR toolchain executables, it works out of the box. Only issue is that you have to set this configuration everytime you start a new project. Either way, great job (and ty) for this toolchain.

  • Login or register to post comments

Search

MHV On Twitter

@MakeHackVoid
1 hour 5 min ago —
Space is closed (was open three hours) (link)

@MakeHackVoid
1 hour 5 min ago —
Space staying open until 01:00 (estimate) (link)

@MakeHackVoid
4 hours 8 min ago —
Space is open until 22:00 (estimate) (link)

@evildeece
7 hours 38 min ago —
@jmacmullin @MakeHackVoid has a Prusa Mendel, free to use once you becone a member: http://t.co/SpXWzL5NgQ (link)

@Protostack
14 hours 43 min ago —
Off to visit @makehackvoid tonight (link)

@jmacmullin
1 day 9 hours ago —
@MakeHackVoid what type of 3D printer do you have? How can I arrange to use it? (link)

@jmacmullin
1 day 10 hours ago —
@RuthEllison @MakeHackVoid I knew you'd know where to find one! (link)

@RuthEllison
1 day 10 hours ago —
@jmacmullin @MakeHackVoid has a 3d printer, along with Canberra Innovation Centre & Questacon (the one next to the Mint). (link)

@MakeHackVoid
3 days 5 hours ago —
Space is closed (was open 5 1/2 hours) (link)

@MakeHackVoid
3 days 10 hours ago —
Space is open until 17:45 (estimate) (link)