failed to load mega2560 or com5 already in use

I was having problems uploading to my Mega2560 and was reading some older posts, one of which happened to catch my eye. If you use three or more exclamation points in your code, it screws up the bootloader. I happened to have more than three in a print statement. After deleting the three !!!, it worked fine - Mega2560 back up and running.

This should be clearly documented - if it is, I haven't found it.

I just spent my whole friday night debugging the same issue. To add some specifics:

The follow sketch will compile and upload just fine:

void setup( void ) {
  char buf1[] = "testing";
  char buf2[] = "testing!";
  char buf3[] = "testing!!";
  char buf4[] = "testing!!!";
  char buf5[] = "testing!!!!";
  char buf6[] = "testing111";
  char buf7[] = "testingXXXX";  
void loop( void ) { ; }

the following will also compile, but will only upload if the lines commented with // :frowning: WTF? are commented out:

void setup( void ) {
  char buf[255];

  sprintf( buf, "testing" );            // this line is ok.
  sprintf( buf, "testing!" );           // this line is ok.
  sprintf( buf, "testing!!" );          // this line is ok.
  sprintf( buf,  "testing!!!" );    // :(  WTF?
  sprintf( buf,  "testing!!!!" );   // :(  WTF?
  sprintf( buf,  "testing111" );        // this line is ok.
  sprintf( buf, "testingXXXX" );      // this line is ok.
void loop( void ) { ; }

messed up eh?

My setup is:
Mega2560, arduino 0022, XP- SP3, nothing at all connected to the arduino except USB.


The troubling aspect of documenting this issue is that Google ignores punctuation. So it makes searching for it difficult.

As James described, this problem is tough to search for. However, it has been noted and talked about and fixed (sorta). See the thread I've been keeping up to date regarding the 2560 bootloader.