OpenOCD一次调试多个设备

时间:2015-03-18 11:38:32

标签: eclipse debugging openocd

我试图在eclipse上使用openocd同时调试多个设备。我有2x STM32F303发现borards,我已将hla_serial标志设置为正确的板,但仍然没有运气。

单独的主板正常运行,但在尝试调试时,Eclipse会说它在最后一个序列中出现错误。

所以,如果有人有这方面的经验。感谢

2 个答案:

答案 0 :(得分:9)

我们可以在openocd 0.9+ ONLY 中使用hla_serial选项。我建议从中下载 GNU ARM Eclipse投射或编译自己。

要获得hla_serial,在阅读包含此选项(http://openocd.zylin.com/#/c/2198/),更具体的功能" string_descriptor_equal"的补丁后找到的最简单的方法是提供错误的序列,所以它会打印正确的。

以下命令将创建文件 log_with_correct_serial.txt 。切换板配置文件,用于当前正在使用的文件。

openocd.exe -d3 -f board/stm32f4discovery.cfg  -c "hla_serial wrong_serial" 2>log_with_correct_serial.txt

打开 log_with_correct_serial.txt ,您会发现包含类似

之类的正确序列
 Debug: 229 23 libusb1_common.c:67 string_descriptor_equal(): Device serial number 'xxxxxxxxxxx' doesn't match requested serial 'wrong_serial'

因此,在openocd根目录下的文件夹 board 内创建派生配置(例如 stm32f4discovery-mydevice1.cfg ,假设使用了stm32f4discovery)。使用Notepad ++之类的东西来复制serial,因为它是十六进制数字。

# This is an STM32F4 discovery board with a single STM32F407VGT6 chip.
# http://www.st.com/internet/evalboard/product/252419.jsp
# hla_serial thanks to http://wunderkis.de/stlink-serialno/index.html

source [find board/stm32f4discovery.cfg]
hla_serial V?nIpSU)?

现在要打开您的设备,您可以使用以下命令开始使用ST-Link适配器进行调试。

openocd.exe -f board/stm32f4discovery-mydevice1.cfg

在每个eclipse项目中为每个项目提供不同的板配置,你就可以了。

答案 1 :(得分:2)

本教程非常有用。我建议你通过命令行保持两个服务器都打开,因为当我尝试同时连接调试器时连接到USB都会出现连接错误。