问题描述
我正在尝试使用eclipse上的openocd一次调试多个设备.我有2个STM32F303发现对象,我已将hla_serial标志设置为适当的板,但是仍然没有运气.
I am trying to debug multiple devices at once with openocd on eclipse. I have 2x STM32F303 discovery borards, I have set the hla_serial flag to a proper board, but still no luck.
单独的板工作正常,但是在尝试调试时,Eclipse表示最后一个顺序出错.
Separate boards are doing ok, but when trying to debug it's Eclipse saying it'came to error in last sequence.
因此,如果有人对此有经验.谢谢
So if anyone had experience with that. Thanks
推荐答案
我们可以在openocd 0.9+ ONLY 中使用hla_serial选项.我建议从下载 GNU ARM Eclipse 项目或自行编译.
We can use hla_serial option within openocd 0.9+ ONLY. I'd recommend to download fromGNU ARM Eclipse project or compile yourself.
要获取hla_serial,这是阅读包含此选项的补丁后找到的最简单的方法( http://openocd.zylin.com/#/c/2198/),更具体的功能" string_descriptor_equal ",它提供了错误的序列号,因此它将打印正确的序列号.
To obtain hla_serial, the easiest way found after reading the patch that included this option (http://openocd.zylin.com/#/c/2198/), more specific function "string_descriptor_equal", was to provide a wrong serial, so it would print the correct one.
下面的命令将创建文件 log_with_correct_serial.txt .交换板的配置文件,用于当前正在使用的文件.
The command below will create file log_with_correct_serial.txt. Switch board config file for the one currently being used.
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 ++之类的东西来复制序列,因为它是十六进制数字.
So create a derived config (for example stm32f4discovery-mydevice1.cfg, assuming stm32f4discovery is used) inside folder board on openocd root directory. Use something like Notepad++ to copy serial as it is hex numbers.
# 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适配器开始调试.
Now to open your device you can use the command below to start debugging using ST-Link adapter.
openocd.exe -f board/stm32f4discovery-mydevice1.cfg
在每个Eclipse项目中,为每个项目提供不同的电路板配置,您很高兴.
In each eclipse project provides a different board config for each project and you are good to go.
这篇关于OpenOCD一次调试多个设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!