Beginner's question: compiling AVR firmware for powerswitch

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
iphi
Rank 2
Rank 2
Posts: 68
Joined: Mon Jun 25, 2007 11:37 am

Beginner's question: compiling AVR firmware for powerswitch

Post by iphi » Mon Jun 25, 2007 11:52 am

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

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Mon Jun 25, 2007 5:45 pm

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.

Guest

Post by Guest » Tue Jun 26, 2007 8:27 am

Thanks for this clarification!

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

Regards Thomas

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Tue Jun 26, 2007 10:12 am

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.

iphi
Rank 2
Rank 2
Posts: 68
Joined: Mon Jun 25, 2007 11:37 am

Post by iphi » Wed Jun 27, 2007 6:20 am

Which WinAVR release would I have to download in order to get gcc3?

Thanks, Thomas

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Wed Jun 27, 2007 1:53 pm

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.

Post Reply