Go Down

Topic: Arduino 0004 broke my sketch? (Read 6563 times) previous topic - next topic


You may need to upgrade the bootloader on your boards.  If you have access to an AVR-ISP or a parallel port programmer, you can use the Tools | Burn Bootloader menu item to do this.  Otherwise, you'll need to change an option in your preferences file so that Arduino 0004 will correctly handle the older bootloader.

When you reset the board, does it blink three times or flicker briefly?  If the former, you may have a older bootloader that takes up 2 Kb of the 8 Kb of program space (flash) on the ATmega8 instead of the 1 Kb used by the current bootloader.  When uploading your sketch, Arduino 0004 checks if it's too big for the ATmega8, but it basis its calculation on a 1 Kb bootloader.  If yours is bigger, only part of the sketch will be uploaded, but the software won't know, and your board will continually reset, pause, reset.  You can tell the Arduino environment the amount of space available for sketches by editing the upload.maximum_size variable in your preferences file (see: http://www.arduino.cc/en/Main/Preferences for instructions on finding the file).  Change 7168 to 6144, and the environment should correctly warn you when your sketch is too big.  

If you need the extra space and can't burn the smaller bootloader, you may need to continue using Arduino 0003.  Reducing the size of the core libraries (so your sketches can be bigger) is one of the top priorities for Arduino 0005.


Hmm, okay, now this is really strange...

When I reset my board, the LED connected to pin 13 flickers (i.e. blinks really fast) for a short time, so I assume I already have the 1k bootloader.

Then again, when I brought the sketch below your limit of 6144 bytes by commenting out some stuff, it worked... so it may really be that.

Anyways, I'll try to get hold of an USB AVR-ISP to reprogram the bootloader, but because of the led flickering rather than blinking 3 times, is it also possible that there's some sort of bug that makes the IDE assume the bootloader is 2k large when it's really just 1k and stops uploading the sketch prematurely? If it helps, the serial number of the board I'm using (with the bootloader that came with it) is 1372 (a USB pre-built board).

Good to hear 0005 will give us even more space to play around with!!


You might have a 2 Kb version of the bootloader that flickers instead of blinks.  The Arduino environment uses only the upload.maximum_size preference, so it wouldn't be getting confused by the bootloader.  Burning the current bootloader (if you can get hold of an AVR-ISP) should fix the problem.


Ok, I'll try that, thank you so much for helping me with this issue!

Go Up