我听说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
...发布于 2014-04-03 15:21:32
与用OpenOCD编写闪存不同,您可以使用monitor命令从GDB中编写闪存。
将OpenOCD更改为启动,如下所示:
20 openocd -f interface/olimex-arm-usb-tiny-h.cfg -f target/stm32f1x.cfg \
21 -l .openocd.log \
22 -c "init" &然后使用类似于以下内容的.gdbinit:
target remote localhost:3333
monitor reset halt
monitor flash erase_sector 0 20 last
monitor flash write_image build/my_project.hex
set remote hardware-breakpoint-limit 6
set remote hardware-watchpoint-limit 4
break main
continue您仍然有一个竞赛条件,因为OpenOCD仍然需要时间来启动,但这对我来说还行,没有任何延迟。
https://stackoverflow.com/questions/22841742
复制相似问题