4

我正在尝试在 Eclipse 上使用 openocd 一次调试多个设备。我有 2 个 STM32F303 发现板,我已将 hla_serial 标志设置为正确的板,但仍然没有运气。

单独的电路板运行良好,但在尝试调试时,Eclipse 说它在最后一个序列中出错。

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

4

2 回答 2

11

我们可以在 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 根目录的文件夹板内创建派生配置(例如stm32f4discovery-mydevice1.cfg,假设使用 stm32f4discovery) 。使用 Notepad++ 之类的东西来复制序列号,因为它是十六进制数字。

# 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 项目中为每个项目提供了不同的板配置,你很高兴。

于 2015-04-06T16:16:43.163 回答
2

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

于 2015-04-06T17:53:22.750 回答