This is my convenience stuff for working with openOCD. “debug” loads the “executable” bin and halts the MCU. “run” loads the “executable” bin and starts it running. “samples” loads some data in to the second bank of flash.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
source [find interface/ftdi/olimex-arm-usb-ocd-h.cfg] #source [find interface/ftdi/flyswatter2.cfg] # GDB can also flash my flash! gdb_memory_map enable gdb_flash_program enable #source [find target/stm32f1x.cfg] source [find target/stm32xl.cfg] source [find chip/st/stm32/stm32.tcl] proc debug {} { reset halt flash probe 0 stm32f1x mass_erase 0 flash write_bank 0 main.bin 0 reset init } proc run {} { reset halt flash probe 0 stm32f1x mass_erase 0 flash write_bank 0 main.bin 0 reset run } proc samples {} { reset halt flash probe 1 stm32f1x mass_erase 1 flash write_bank 1 samples.bin 0 reset init } |