If code contains string with three and more symbols '!' each other, uploading on mega 2560 is freezing.
For example this sketch never has been uploaded:
char str[5];
void setup() {
sprintf(str, "!!!");
}
void loop() {
}
This bug is only with Mega 2560, in all versions of IDE; my system is windows 7 x32 prof. Uno is normally uploaded.
Some versions of the bootloader apparently do not like three exclamation points (!!!). It causes them to enter some type of debug mode or something. Unless you feel like the statement is so important (like the sky is falling), try using two instead. Or if the sky is falling, put some other character between them.
It's more insidious than that. If the three exclamation points are in data or code, it won't load. Several people have encountered this because a data table had that in it (33,33,33) or something like that. Really annoying when it happens.
I've been trying to get this fixed for several months in the official version that is released so we could reload the boot loader on existing boards and get on with life to no avail. I do have a copy that works that I pillaged from the source area that I'm using. The other killer problem is that the bootloader doesn't work with the watchdog timer either. If you use the watchdog, you'll have to power down the board to get it out of an infinite wdt loop.
The UNO works fine, so fixing something like this isn't hard.
I have the MEGA 2560 rev 3 that a bought in March 2012. It times out on the upload.
Sometimes, if I unplug the USB cable and the power cable, wait 10 seconds, hold down
the reset, then plug in power, then the USB Cable, wait 4 seconds, then release the
reset, then select the upload icon, the board may program.
So what is the solution, 1 dump the board, 2 send it back, 3 get mad!!!
nik1311:
If code contains string with three and more symbols '!' each other, uploading on mega 2560 is freezing.
I had the same problem with my Mega2560 Rev 3 board and IDE 1.0. I had a:
lcd.print("It's working!!!");
And needless to say it didn't, it failed during the upload. It was only that I had read earlier on (on this board or somewhere?) that I quickly worked out what had happened. It never bricked my board and altering the code, resetting the board and uploading made things work as they should.
I think it's a bug people need to be aware of until its fixed.