Go Down

Topic: Problem uploading specific sketch on MEGA2560 ... (Read 871 times) previous topic - next topic


I have a sketch that I'm working on that has been uploading fine for a week and now I can't get uploading to complete (using V.1.0.1).  I'm using a Seeeduino Mega board (and have been for many months without any problems).  I'm not getting any visible errors reported in the IDE for this sketch (and normal compile completes without errors), it just won't finish an upload cycle on this specific sketch.  I can upload other sketches without problems.  Here's what it looks like when it hangs:

When it begins to upload, the TX & RX LEDs blink for a bit (as expected) and then it appears the pin13 LED is lighted and it hangs (I'm not using the pin13 OUTPUT in this sketch).  If I shutdown the IDE and remove/reset power to the board, it doesn't seem like its running any program and the pin13 LED appears to blink in a sequence (2 quick pulses, OFF, repeat).  I'm a little perplexed, appreciate any help.



You might want to post your code.

If you have any "!!!" in your code, that will cause an upload hang in some versions of the Mega.
Code: [Select]
Serial.println("It works!!!");


Wow!  I did have a "!!!" in a Serial.print in my code.  Took that out and it uploaded OK.  Is this an issue specific to 1.0.1 or does it happen in 1.0.3 too?

Does this occur only with 3 !'s or any number of !'s?  Why does that character (string) cause an upload hang?  Is it only an issue with a Serial.print or could similar problems occur if there is just a reference to a "!!!" string in the program?  Why does this happen?  Are there any other characters to watch out for?  Is there a list of "oddities" like this that is maintained somewhere?  Thanks for the help.


That is the only glitch as far as I know. It happens in all IDE versions. It is a bootloader issue. If you can avoid getting really excited and use "!!" instead of "!!!", you can avoid that issue.

Go Up