Debug the NUCLEO-L476RG in linux
The System Workbench for STM32 and CubeSTM32 declare to support the NUCLEO-L476RG I have an issue on debug.
I imported very simple code from Cube to SW, compiled and linked (no errors).
When debugging and downloading the code I get the following error:
Error message from debugger back end:
localhost:3333: Connection timed out.
Launching Eclipse from the terminal we can see the complete command string composed by eclipse to run the debugger:
OpenOCD launch command (run in /home/rob/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.debug_1.8.0.201603291114/resources/openocd/scripts/st_board):
/home/rob/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.openocd.linux64_1.8.0.201603291120/tools/openocd/bin/openocd -f nucleo_l476rg.cfg -s /home/rob/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.debug_1.8.0.201603291114/resources/openocd/scripts/st_board -s /home/rob/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.debug_1.8.0.201603291114/resources/openocd/scripts -c gdb_port 3333
adding to this string a log-file and debug options (-l mylog -d), the command will be:
/home/rob/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.openocd.linux64_1.8.0.201603291120/tools/openocd/bin/openocd -f nucleo_l476rg.cfg -s /home/rob/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.debug_1.8.0.201603291114/resources/openocd/scripts/st_board -s /home/rob/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.debug_1.8.0.201603291114/resources/openocd/scripts -l mylog.log -d -c gdb_port 3333
We can run this command from terminal after changing the directory to
/home/rob/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.debug_1.8.0.201603291114/resources/openocd/scripts/st_board
The last lines of the log file are in my case:
Info : 248 12 core.c:1388 adapter_init(): clock speed 1800 kHz
Debug: 249 12 openocd.c:137 handle_init_command(): Debug Adapter init complete
Debug: 250 12 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_transport init
Debug: 251 12 command.c:145 script_debug(): command - ocd_transport ocd_transport init
Debug: 253 12 transport.c:240 handle_transport_init(): handle_transport_init
Debug: 254 12 hla_transport.c:154 hl_transport_init(): hl_transport_init
Debug: 255 12 hla_transport.c:171 hl_transport_init(): current transport hla_swd
Debug: 256 12 hla_interface.c:44 hl_interface_open(): hl_interface_open
Debug: 257 12 hla_layout.c:42 hl_layout_open(): hl_layout_open
Debug: 258 12 stlink_usb.c:1697 stlink_usb_open(): stlink_usb_open
Debug: 259 12 stlink_usb.c:1714 stlink_usb_open(): transport: 1 vid: 0x0483 pid: 0x374b serial:
Error: 260 15 stlink_usb.c:1727 stlink_usb_open(): open failed
Debug: 261 15 hla_layout.c:49 hl_layout_open(): failed
Debug: 262 15 command.c:628 run_command(): Command failed with error code -4
User : 263 15 command.c:689 command_run_line(): in procedure ‘init’
in procedure ‘ocd_bouncer’
Debug: 264 15 command.c:628 run_command(): Command failed with error code -4
User : 265 15 command.c:689 command_run_line():
Debug: 266 15 hla_interface.c:119 hl_interface_quit(): hl_interface_quit
so the problem seems to be the communication link between the ocd-server and the st-link/v2-1,
but I am not able to investigate further.
Thx.