Page 1 of 1

Beginner's question: compiling AVR firmware for powerswitch

Posted: Mon Jun 25, 2007 11:52 am
by iphi
Hello,

I have just built up the powerswitch project and it works perfectly :-).
For the start I just flashed the hex file from the download.

In a second experiment I recompiled the firmware with WinAVR and programmer's notepad by the "make all" command. Compilation was successful and the again flashed firmware worked fine as well.

Now the strange thing:
filesize of the original hex file is 4931 bytes
filesize of the hex-file I just produced is 5140 bytes

I did not change the code. How can this be?

Regards, Thomas

Posted: Mon Jun 25, 2007 5:45 pm
by christian
This is because the latest WinAVR packages contain gcc version 4 while we use version 3 to prepare the package.

AVR-USB has been optimized for gcc version 3. It's therefore not too surprising that gcc version 4 generates slightly bigger code.

Posted: Tue Jun 26, 2007 8:27 am
by Guest
Thanks for this clarification!

Do you recommend to use gcc version 3 instead of 4 in order to minimize the code size?

Regards Thomas

Posted: Tue Jun 26, 2007 10:12 am
by christian
I prefer gcc 3 because I'm used to its behavior. I also suspect that it's more efficient in general on the AVR platform.

Posted: Wed Jun 27, 2007 6:20 am
by iphi
Which WinAVR release would I have to download in order to get gcc3?

Thanks, Thomas

Posted: Wed Jun 27, 2007 1:53 pm
by christian
Don't know, but the previous release (20060125) should be a good candidate. Maybe you can find more info in the change log of the project.