     for (long i = 0; i < SPEED * 100000; ++i)
         if (Target.available())
             return Target.read();
+    toggleLed();
     return 0;
 }
 


#include "ParitySerial.h"

#define RX_PIN      4       // Arduino Dig.4, ATmega portD.4, ATMega328 pin.6
#define TX_PIN      14      // Arduino Ana.0, ATmega portC.0, ATMega328 pin.23
ParitySerial Target (RX_PIN, TX_PIN); // defaults to even parity

static void targetInit () { Target.begin(9600); }

#define SPEED       2       // relative CPU speed for use in busy loops

#else // probably a STM32F103 running at 64 or 72 MHz, with hardware serial


    
    Log.print("     Writing: ");
    for (uint16_t offset = 0; offset < sizeof data; offset += 256) {
        toggleLed();
        Log.print('+');
        sendCmd(WRITE_CMD);
        uint32_t addr = 0x08000000 + offset;
