I'd like to get a multi-core debugging running with my STLINK adapter. I've got experiences in debugging with other tools (e.g., uTrace/Trace32 from Lauterbach). Now, I'd like to setup a multi-core arrangement as a hobby project at home - where I don't have a uTrace but only different versions of the STLink (much cheaper). Sadly, I'm not experienced at all in using OpenOCD. Any help is highly appreciated!
What I did so far
RTFM.1 I see many typical use cases in the manual, but not a systematic description on which commands include/require (which) sub-commands. This impedes recognizing the solution to my (exotic ?) use case.
Setup a working single-core OpenOCD configuration:
stlink.cfg
(interface: hla
),
stm32f1x.cfg
(swj-dp.tcl
, mem_helper.tcl
)Inspected other OpenOCD example files among my STM32CubeIDE installation.
stm32h7x_dual_core.cfg
is made for the wrong µ-controller, but it includes a dual-core option. Inside, I found this warning:
# Issue a warning when hla is used, and fallback to single core configuration
if { [set $_CHIPNAME.DUAL_CORE] && [using_hla] } {
echo "Warning : hla does not support multicore debugging"
set $_CHIPNAME.DUAL_CORE 0
}
Hence, interface hla
cannot be used for multi-core debug (as far as this comment is correct, and I understand it).
[EDIT]
Integration of the dual-core variants in the STM32H7 family is described here. Still, these controllers only comprise a single TAP in the JTAG chain, which allows access to several Access Ports (APs) at an internal bus behind it.
[/EDIT]
The following steps describe how I tried to get an STLINK/JTAG configuration running for a single board, with a different interface setting than hla
.
Look for other interface
options in OpenOCD
OpenOCD supports a number of different interfaces,
**C:\Temp>** C:\ST\STM32CubeIDE_1.3.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.openocd.win32_1.3.0.202002181050\tools\bin\openocd.exe -c "interface st-link" -c "transport list"
Open On-Chip Debugger 0.10.0+dev-01193-g5ce997d (2020-02-20-10:57)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
The following transports are available:
jtag
aice_jtag
stlink_swd
stlink_jtag
swd
stlink_swim
hla_jtag
hla_swd
[...]
but together with my STLINK, I'm getting interface
-related error messages unless I choose an hla
option or either of the following two:
stlink_swd
- SWD won't support daisy chains, so that's not an option for me!
stlink_jtag
- JTAG is what I'm looking for, but this doesn't seem to work:
With the following minimal (?) script
interface st-link
transport select stlink_jtag
I'm getting no connection but the following log (activating plenty of debug):
Debug: 17 15 options.c:184 add_default_dirs(): bindir=/src/work/openocd/win32/build/bin
Debug: 18 15 options.c:185 add_default_dirs(): pkgdatadir=/src/work/openocd/win32/build/share/openocd
Debug: 19 15 options.c:186 add_default_dirs(): exepath=C:/ST/STM32CubeIDE_1.3.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.openocd.win32_1.3.0.202002181050/tools/bin
Debug: 20 15 options.c:187 add_default_dirs(): bin2data=../share/openocd
Debug: 21 15 configuration.c:42 add_script_search_dir(): adding C:\Users\x\AppData\Roaming/OpenOCD
Debug: 22 15 configuration.c:42 add_script_search_dir(): adding C:/ST/STM32CubeIDE_1.3.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.openocd.win32_1.3.0.202002181050/tools/bin/../share/openocd/site
Debug: 23 15 configuration.c:42 add_script_search_dir(): adding C:/ST/STM32CubeIDE_1.3.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.openocd.win32_1.3.0.202002181050/tools/bin/../share/openocd/scripts
Debug: 24 15 configuration.c:97 find_file(): found openocd.cfg
Debug: 25 15 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_interface st-link
Debug: 26 15 command.c:143 script_debug(): command - interface ocd_interface st-link
Debug: 28 15 command.c:364 register_command_handler(): registering 'ocd_st-link'...
Debug: 29 15 command.c:364 register_command_handler(): registering 'ocd_st-link'...
Debug: 30 15 command.c:364 register_command_handler(): registering 'ocd_st-link'...
Debug: 31 15 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select stlink_jtag
Debug: 32 15 command.c:143 script_debug(): command - ocd_transport ocd_transport select stlink_jtag
Debug: 33 15 adi_v5_stlink.c:223 stlink_jtag_select(): stlink_jtag_select()
Debug: 34 15 command.c:364 register_command_handler(): registering 'ocd_stlink_dap'...
User : 35 15 command.c:693 command_run_line(): stlink_jtag
User : 36 15 command.c:695 command_run_line():
Info : 37 15 server.c:311 add_service(): Listening on port 6666 for tcl connections
Info : 38 15 server.c:311 add_service(): Listening on port 4444 for telnet connections
Debug: 39 15 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_init
Debug: 40 15 command.c:143 script_debug(): command - init ocd_init
Debug: 42 15 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target init
Debug: 43 15 command.c:143 script_debug(): command - ocd_target ocd_target init
Debug: 45 15 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target names
Debug: 46 15 command.c:143 script_debug(): command - ocd_target ocd_target names
Debug: 47 15 target.c:1438 handle_target_init_command(): Initializing targets...
Debug: 48 15 stlink_usb.c:3755 stlink_dap_init(): stlink_dap_init()
Debug: 49 15 stlink_usb.c:2674 stlink_usb_open(): stlink_usb_open
Debug: 50 15 stlink_usb.c:2688 stlink_usb_open(): transport: 2 vid: 0x0483 pid: 0x3744 serial:
Debug: 51 15 stlink_usb.c:2688 stlink_usb_open(): transport: 2 vid: 0x0483 pid: 0x3748 serial:
Debug: 52 15 stlink_usb.c:2688 stlink_usb_open(): transport: 2 vid: 0x0483 pid: 0x374b serial:
Debug: 53 15 stlink_usb.c:2688 stlink_usb_open(): transport: 2 vid: 0x0483 pid: 0x3752 serial:
Debug: 54 15 stlink_usb.c:2688 stlink_usb_open(): transport: 2 vid: 0x0483 pid: 0x374d serial:
Debug: 55 15 stlink_usb.c:2688 stlink_usb_open(): transport: 2 vid: 0x0483 pid: 0x374e serial:
Debug: 56 15 stlink_usb.c:2688 stlink_usb_open(): transport: 2 vid: 0x0483 pid: 0x374f serial:
Debug: 57 15 stlink_usb.c:2688 stlink_usb_open(): transport: 2 vid: 0x0483 pid: 0x3753 serial:
Info : 58 46 stlink_usb.c:1000 stlink_usb_version(): STLINK V3J6M2B4S1 (API v3) VID:PID 0483:374F
Info : 59 46 stlink_usb.c:2810 stlink_usb_open(): using stlink api v3
Debug: 60 46 stlink_usb.c:1230 stlink_exit_mode(): MODE: 0x01
Debug: 61 46 stlink_usb.c:1278 stlink_usb_init_mode(): MODE: 0x01
Info : 62 46 stlink_usb.c:1032 stlink_usb_check_voltage(): Target voltage: 3.278671
Debug: 63 46 stlink_usb.c:1303 stlink_usb_init_mode(): MODE: 0x01
Debug: 64 46 stlink_usb.c:1130 stlink_usb_mode_enter(): stlink_usb_mode_enter(JTAG)
Debug: 65 46 stlink_usb.c:740 stlink_usb_error_check(): UNKNOWN_JTAG_CHAIN
Error: 66 46 stlink_usb.c:2819 stlink_usb_open(): init mode failed (unable to connect to the target)
Debug: 67 46 stlink_usb.c:1230 stlink_exit_mode(): MODE: 0x01
Debug: 68 46 command.c:642 run_command(): Command failed with error code -4
User : 69 46 command.c:705 command_run_line():
Check the OpenOCD mailing list archives.
There are some hints that multicore-JTAG+STLINK hasn't been supported in earlier OpenOCD revisions, but there have been some (preliminary?) changes about STLINK driver code in OpenOCD that I don't understand. Therefore, I'm still wondering which is the current status.
The Question
Does anybody know if OpenOCD supports JTAG through STLINK at all, or if I'm trying in vain? Do I have to add the correct JTAG chain/TAP/target definitions to get rid of the basic error messages, or is it pointless to try further?
Details - I'm using the following tool versions:
Info : STLINK V3J6M2B4S1 (API v3) VID:PID 0483:374F
)1 "OpenOCD User’s Guide", 0.10.0+dev, STM, 20 February 2020 (st-openocd.pdf, part of STM32CubeIDE installation)
Probably a bit late but:
From UM2448 "The STLINK-V3SET does not support the chaining of devices in JTAG (daisy chain).