OpenOCD は、いくつかのコマンドを実行した後にデーモン化することになっていると聞いたことがあります。
コマンドを CLI 引数として指定してみます。コマンドは実行されますが、OpenOCD はその後バックグラウンドにならないため、GDB は実行されません。openocd コマンドの末尾に「&」を追加することはできますが、GDB と競合状態になります。
フラッシュのロード後に OpenOCD をデーモン化するにはどうすればよいですか?
13 # Launch OpenOCD
14 # specify our hardware debugger and mcu type
15 # reset target
16 # erase in bank 0 from 20k (0x5000) to end of flash
17 # load hex format because elf has extraneous section at 0x00000000
18 # NOTE: we don't use 'erase' so we can't blow away bootloader
19 # ??? daemonize when done so GDB can run
20 openocd -f interface/olimex-arm-usb-tiny-h.cfg -f target/stm32f1x.cfg \
21 -l .openocd.log \
22 -c "init" -c "reset init" \
23 -c "flash erase_sector 0 20 last" \
24 -c "flash write_image $HEXFILE"
25
26 # run gdb
...