OpenOCD debugging multiple devices at once

2019-05-08 04:00发布

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

2条回答
Deceive 欺骗
2楼-- · 2019-05-08 04:21

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.

查看更多
三岁会撩人
3楼-- · 2019-05-08 04:30

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.

查看更多
登录 后发表回答