Go Down

Topic: Can't upload sketches that are greater than 28674 bytes on my Uno (Read 1 time) previous topic - next topic

__Tango

Hey folks.

I think i may have a bad chip or something, but i can't seem to upload my sketch when it grows to greater than 28674 bytes.  I'm using Arduino 022 on MacOS. 

If the sketch is 28674 or fewer bytes, i see the normal upload message:

Code: [Select]
Binary sketch size: 28674 bytes (of a 32256 byte maximum)

and the code seems to work ok. 

If the sketch grows to 28676 bytes, I see this:

Code: [Select]
Binary sketch size: 28676 bytes (of a 32256 byte maximum)

avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x54
avrdude: failed to write flash memory, rc=-4
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x61


And the arduino doesn't run the code at all.

If the sketch gets much bigger than 28680, i see:

Code: [Select]
Binary sketch size: 28700 bytes (of a 32256 byte maximum)
avrdude: stk500_recv(): programmer is not responding


I originally thought it was something in my code, but I can get this problem to occur by changing the length of strings (such as within a "Serial.print()" call).

For example, if i have a sketch that compiles to 28674 bytes (and works ok), changing:

Code: [Select]
Serial.print ( "12345" );

to

Code: [Select]
Serial.print ( "123456" );

Will cause the sketch size to be 28676 bytes, and the problem will occur.

The error message seems to indicate there's a problem with the Flash space on the chip, but i'm not sure.  Do I have any recourse here (other than to get a new board or chip?)

Thanks!

...tango...

retrolefty

Quote
Do I have any recourse here (other than to get a new board or chip?)


I suspect a $6 investment in a new 328p chip (with bootloader) is your best bet as I can't think of anything else on the board that could cause the symptom.

Lefty


__Tango


Quote
Do I have any recourse here (other than to get a new board or chip?)


I suspect a $6 investment in a new 328p chip (with bootloader) is your best bet as I can't think of anything else on the board that could cause the symptom.

Lefty


Thanks.  I thought that might be it, but i was hoping there'd be something else i could try. 

OK, off to get a new chip it is.  It seems like this chip will work (http://www.sparkfun.com/products/10524), but i'm still a little fuzzy on the bootload aspect, so i'm not quite sure. 

Thanks again. 

...tango...

retrolefty

That's the correct chip/bootloader for a Uno board.

Lefty

BenF


I think i may have a bad chip or something, but i can't seem to upload my sketch when it grows to greater than 28674 bytes.  I'm using Arduino 022 on MacOS. 

Before you throw out the chip, I would check the fuse settings. If fuses are set to reserve a 4k boot section, addresses beyond 28672 (32k less 4k = 28672) would be write protected and so upload would fail.

__Tango



I think i may have a bad chip or something, but i can't seem to upload my sketch when it grows to greater than 28674 bytes.  I'm using Arduino 022 on MacOS. 

Before you throw out the chip, I would check the fuse settings. If fuses are set to reserve a 4k boot section, addresses beyond 28672 (32k less 4k = 28672) would be write protected and so upload would fail.



Thanks. 

One (super newbie) question though...how?

Thanks again.

Jack Christensen

I might try this beta bootloader:
http://arduino.cc/forum/index.php/topic,64105.msg466703.html#msg466703

One of the issues it fixes is:
Quote
380 optiboot has problems uploading sketches bigger than about 30 KB
MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

__Tango


I might try this beta bootloader:
http://arduino.cc/forum/index.php/topic,64105.msg466703.html#msg466703

One of the issues it fixes is:
Quote
380 optiboot has problems uploading sketches bigger than about 30 KB



AHA!

Thanks for that.  I didn't actually get the beta optiboot running, but i was able to get an older version (yet newer than the default optiboot that comes on the UNO) installed by using optifix (http://www.adafruit.com/forums/viewtopic.php?f=25&t=19260).

This seems to have fixed my issue.

Phew!

Go Up