I have the latest arduino version (0012) and I also have WinAVR20081208 installed.
I want to make a new bootloader (change the speeds) and it compiles fine and produces a hex file. I am using AVR Studio to download the file (via avrispmkII), but it won't download it - it gives me the following error: "The contents of the Hex file does not fit in the selected device." Now, I have selected the correct device.
The bootloader that ships with the arduino (for the atmega168) appears to have about 1832 bytes in it. However, when I recompile it without changing a thing, it comes out at about 2088. I am guessing that the starting address specified in the Makefile puts this program beyond the range of memory.
I changed the starting address from 3800 to 3700, and was able to load it. However, it didn't work. Apparently something else somewhere needs to know about this as well.
So - 2 questions:
What has happened with avr-gcc/arduino that has made the compile of the code not as small as it was?
How do I adjust the starting address to fit a larger bootloader? What other files do I need to change?
Ultimately, I am trying to run at 115200 with a 14.7456 crystal. I figured this would be as easy as changing the rate in the Makefile and the code, and updating the boards.txt file. Several hours later, it isn't going so well.
It sounds like different and/or larger libraries are getting linked. Can you try it
with the older gcc?
For my board I changed to a 12MHz XTAL and modified the Makefile. I did not
have any problems. My modified Makefile and bootloader are in the "bootloader"
application hint at Loading...
Ok - thanks for the help. I was able to compile under 11.
I also found the bootloader vector in the AVR datasheets, and it looks like 3800 is as low as we can go. Therefore, it would seem that there is a bit of a problem here for the present version of winavr. Bummer.
Your problem has been solved (by using arduino 11), but...
What has happened with avr-gcc/arduino that has made the compile of the code not as small as it was?
Arduino 12 includes a new version of the gcc compiler for AVR. For some reason that I have yet to see explained (even though I've asked), this version of the compiler produced code that is significantly larger than the previous version (that Arduino included.) There have been suggestions that this can be improved by changing the compile switches, but I haven't investigated.
How do I adjust the starting address to fit a larger bootloader?
The program memory of the AVR is divided into two sections (bootloader and main code, separately protected) by setting some fuse bits. While the size of the bootloaded section can vary, the current setting of 2kbytes is the maximum size allowed, so the bootloaded cannot exceed 2kbytes without using program memory from the unprotected section of program memory...