【发布时间】:2019-09-27 00:02:47
【问题描述】:
我正在尝试找出 ARM (STM32042) 上的半主机。如果我直接从命令行运行openocd 并通过TCP 从gdb 连接到它,我可以看到printf 输出。但如果我从gdb 内部启动openocd,输出会转到天空中的某个大/dev/null。
如果我自己启动openocd
$ openocd -f interface/stlink-v2-1.cfg -f target/stm32f0x.cfg
然后像这样从gdb 连接到它
(gdb) target remote localhost:3333
我在opeocd 终端中看到printf 输出。但是,如果我按照this link 的建议从gdb 内部启动openocd,
(gdb) target remote | openocd -f interface/stlink-v2-1.cfg -f target/stm32f0x.cfg -c "gdb_port pipe"
我看到了所有 openocd 调试消息(例如,xPSR: 0xc1000000 pc: 0x08001648 msp: 0x20001800, semihosting),但没有看到我的 printfs。
【问题讨论】:
-
你发现了吗?
-
是的,我做到了。谢谢你提醒我。见下文。
标签: arm gdb openocd semihosting