anchor.diff:  
   : boot-init
     spi2-init  +spi2  \ permanently held low
  -  %0000000001010100 SPI2-CR1 !  \ clk/8, i.e. 4.5 MHz, master
  +\ %0000000001010100 SPI2-CR1 !  \ clk/8, i.e. 4.5 MHz, master
     uart-irq-init
     RESET-PIN ioc!  OMODE-PP RESET-PIN io-mode!
     BOOT0-PIN ios!  OMODE-PP BOOT0-PIN io-mode!
  
positive.code:   millis
    boot-mode
    sof check-ack
    get-cmd hex.
  \ get-version hex.
    get-id hex.
    rd-unp
    wr-unp
    512 erase
    320 0 do ( [char] + emit ) 0 i 128 * $08000000 + pgm loop
    millis swap - .
  ;
  
  boot-init
  
negative.code:   $79 >spi2
    $79 = ;
  
  : check-ack ( -- )
    wait-ack not if ."  NAK?" usb-poll reset then ;
  
  : send ( b -- )  dup >spi2  xsum @ xor xsum ! ;
  : send2 ( n -- )  dup 8 rshift send  send ;
  