Broken Arduino Mega magically repears after uploading bootloader.

Lefty
Thanks for the input. Led 13 was not flashing. But as I burned a new bootloader to fix the WDT and !!! problems this does not remove this possibility. The WDT was the reason why I started of with the UNO (actually I upgraded my duemilenova's with the UNO bootloader for the WDT problem).
I tested the Mega and it all worked fine. So something must have triggered something breaking the bootloader.
I hadn't considered the bootloader getting into a loop but that is indeed a very viable possibility.
I only use WDT as a safety net in case the "put reset pin HIGH" doesn't work. In that case I use 2 seconds as you can see in the code below.

// perform hard reset via reset pin and if fails use the watchdog
void MessageHandler::forceHardReset()
{
  Serial.println(F("triggering restart"));
  unsigned long resetTime =millis()+ (unsigned long) myForceRestartDelay;
  //Serial.flush();
  Serial.end();
  while ( resetTime > millis());
  Serial.println(F("Setting Pin High"));
  pinMode(A5,OUTPUT);
  digitalWrite(A5,HIGH);
  Serial.println(F("Pin is High"));
  delay(5000);  // this should be long enough to reset the arduino
  Serial.println(F("this should never happen; have you connected A5 to reset?"));
  delay(1000); //make sure the serial message gets send.
  // use the watchdog to try to reset
  noInterrupts(); // disable interrupts
  wdt_enable(WDTO_2S);
  interrupts();
  delay(5000);
  Serial.println(F("this should never happen; even the watchdog doesn't work?"));
}

The serial bootloader is convenient for development from the IDE but once a design is finished and debugged and test and ready to be put into some kind of permanent service, there is a lot to be said for uploading the sketch via the upload using programmer option and taking the whole bootloader out of the application.

I fully agree but.... I'm actually designing this solution to be able to continue my development of my mobile robot. Because the robot is in the garden (and it is very likely to be raining); changing settings or the sketch implies I have to go and get the robot on a "safe spot"; open it up and connect my laptop; close it again and bring the robot back to the testing area.
The setup I'm working on allows me to do all these things remotely with a wifi access point that covers the whole area and a wifi router on the robot. The fact the bootloader allows me to load a new sketch with only a serial port is a great feature for me.
Best regards
Jantje