Welcome! Log In Create A New Profile

Advanced

Recompiling sanguino bootloader gives size error

Posted by ausinine 
Ok, I feel like this is a stupid question, but I can't work it out.

I'm trying to recompile the sanguino bootloader for a homebuilt atmega644P breadboard setup, but the file I get out is different from the default bootloader. In particular, the size is much larger, with the highest address 0x100A9 instead of 0xFF64, which is obviously wrong. Is there anything I could be doing wrong to get incorrect behaviour from the compiler?

I'm using sanguino software v1.4r1, arduino-0012, Windows2000, and compiling for the Atmega644P using make from a cygwin shell. The only modification I've made to the Makefile at the moment is to specify the full path of avr-gcc, avr-objcopy and avr-objdump.

Any suggestions would be greatly appreciated.
Re: Recompiling sanguino bootloader gives size error
February 18, 2009 11:23AM
The bootloaders are compiled using gcc-3 while the default for Arduino is gcc-4.
I'm pretty sure (although not 100%) this is the case also for the built-in Arduino bootloaders.
You can run 'avr-gcc-select 3' to set the default to gcc-3.

It's also possible to compile the bootloader using the -Os flag to optimize for size. This is not tested, so do this on your own risk.

Cheers,


~/= Marius

--
We are Elektropeople for a better living.
[reprap.soup.io]
[www.metalab.at]
Anonymous User
Re: Recompiling sanguino bootloader gives size error
February 19, 2009 02:46AM
Ah, brilliant! That was something I hadn't even considered. Thanks very much for the heads up.

After seeing your reply, I did some more searching, and found someone who had the same problem with the default bootloaders on the arduino forums [www.arduino.cc]

If you are using OSX and MacPack, then it does seem 'avr-gcc-select 3' is sufficient. If you're on other platforms, it's a little trickier. On Windows WinAVR-20060421 is the most recent to contain gcc 3, according to changelogs. The gcc-3.4.6 shipped with WinAVR-20060421 has the 644P target and it rebuilt the bootloader with no errors for me on the uploads so far.

On Linux it's possible to rebuild gcc-3.4.6 with support for the new devices. A description of the process is on the ladyada forums [www.ladyada.net]. There are newer versions of the patch linked from that post at [www.freebsd.org]. Of course, the most recent versions of the patch aren't suitable to apply to 3.4.6, as they're designed for gcc-4 and don't include devices that have been added in gcc-4. Patch version 1.12 seems good to me.

Thanks again for the suggestion!
Can we get the avr-gcc-select into the makefile or at least a comment?


ausinine Wrote:
-------------------------------------------------------
> Ok, I feel like this is a stupid question, but I
> can't work it out.
>
> I'm trying to recompile the sanguino bootloader
> for a homebuilt atmega644P breadboard setup, but
> the file I get out is different from the default
> bootloader. In particular, the size is much
> larger, with the highest address 0x100A9 instead
> of 0xFF64, which is obviously wrong. Is there
> anything I could be doing wrong to get incorrect
> behaviour from the compiler?
>
> I'm using sanguino software v1.4r1, arduino-0012,
> Windows2000, and compiling for the Atmega644P
> using make from a cygwin shell. The only
> modification I've made to the Makefile at the
> moment is to specify the full path of avr-gcc,
> avr-objcopy and avr-objdump.
>
> Any suggestions would be greatly appreciated.
Re: Recompiling sanguino bootloader gives size error
March 08, 2009 03:22AM
Hi,

I've added this as an issue for Sanguino, so it should make it into the next release.


~/= Marius

--
We are Elektropeople for a better living.
[reprap.soup.io]
[www.metalab.at]
Sorry, only registered users may post in this forum.

Click here to login