Pages: [1]   Go Down
Author Topic: Arduino Uno sketch limit size  (Read 4948 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 217
Posts: 13734
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: January 11, 2011, 05:26:53 pm by robtillaart » Logged

Rob Tillaart

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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?

Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 217
Posts: 13734
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: January 12, 2011, 08:07:46 am by robtillaart » Logged

Rob Tillaart

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: January 12, 2011, 08:25:21 am by ccpetersen » Logged

Portland area, Oregon, USA
Offline Offline
Newbie
*
Karma: 2
Posts: 15
Was using PICBasic, now Arduino
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 134
Posts: 6762
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: