     Serial.print(" FAILED - got 0x");
     Serial.println(b, HEX);
     digitalWrite(ERROR_PIN, 1);
-    while (true) ; // halt
+
+    while (digitalRead(START_PIN) == 0)
+        ;
+    RESET();
 }
 
 static void sendByte (uint8_t b) {

        Target.write(Serial.read());
    if (Target.available())
        Serial.write(Target.read());
}

    Serial.print(sizeof data);
    Serial.println(" bytes uploaded.");
    digitalWrite(GREEN_PIN, 1);

    Target.begin(115200, false, false); // disable parity
    resetTarget(false);
