OpenOCD debugging multiple devices at once

谁都会走 提交于 2019-12-07 10:05:41

问题


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.

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


回答1:


We can use hla_serial option within openocd 0.9+ ONLY. I'd recommend to download from GNU ARM Eclipse project or compile yourself.

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.

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

Opening log_with_correct_serial.txt you will find correct serial in line containing something like

 Debug: 229 23 libusb1_common.c:67 string_descriptor_equal(): Device serial number 'xxxxxxxxxxx' doesn't match requested serial 'wrong_serial'

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)?

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

In each eclipse project provides a different board config for each project and you are good to go.




回答2:


This tutorial was very helpful. I would recommend you to keep both servers opened through the command line, since I got a connection error when I tried to connect the debuggers simultaneously with both connected to the USB.



来源:https://stackoverflow.com/questions/29121050/openocd-debugging-multiple-devices-at-once

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!