Go Down

Topic: Arduino Uno sketch limit size (Read 5 times) previous topic - next topic

ccpetersen

Arduino reports "Binary sketch size: 31070 bytes (of a 32256 byte maximum)"  When I upload the sketch it fails at 30720.  Is this a bootloader problem?  I could have sworn it was work before today.

robtillaart

#1
Jan 11, 2011, 11:26 pm Last Edit: Jan 11, 2011, 11:26 pm by robtillaart Reason: 1
Please share your code, most of the time there is room for optimization.

!! use the # button to provide [ code] and [/code] tags around the code so it will come in a nice scrollable box.
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

ccpetersen

I'm using the AeroQuad code base and I'm sure you don't want me to post it here.

Avrdude is the one reporting the error:
Code: [Select]
Binary sketch size: 31430 bytes (of a 32256 byte maximum)
avrdude: verification error, first mismatch at byte 0x7800
        0x07 != 0xff
avrdude: verification error; content mismatch


I assumd the Uno sketch size limit was 32256 bytes but now I've been told that there was a bug that limited the size 30720 and I need to reprogram the bootloader with a new version of Optiboot.  Sound right?


robtillaart

#3
Jan 12, 2011, 02:06 pm Last Edit: Jan 12, 2011, 02:07 pm by robtillaart Reason: 1
Quote
I'm using the AeroQuad code base and I'm sure you don't want me to post it here.

Why not?
At least provide an URL to your code if you want help.
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

ccpetersen

#4
Jan 12, 2011, 02:12 pm Last Edit: Jan 12, 2011, 02:25 pm by ccpetersen Reason: 1
http://code.google.com/p/aeroquad/downloads/list

The code in question is AeroQuad_v2.1.2_Beta.zip

In AeroQuad.pde uncomment these defines to drive image over 30720 bytes:
#define AeroQuad_v18
#define HeadingMagHold
#define BattMonitor

That should give you a sketch size of:
Binary sketch size: 31574 bytes (of a 32256 byte maximum)

Which will fail to upload despite being below the 32256 maximum.

Brad Needham

The error "first mismatch at byte 0x7800" translates to decimal 30720.  So it seems to me that, as you say, there is a limit of 30720 rather than 32256.  I'm a newbie, so I can't suggest how to increase the limit or reduce your code size - sorry.

ccpetersen

Turns out that the optiboot bootloader version I have has some problems.  I ordered a programmer so I could burn a new bootloader.  The new optiboot from the optiboot software repo doesn't have this problem.

westfw

http://code.google.com/p/arduino/issues/detail?id=380

Go Up