2024-06-09 05:01 PM
So as these things go I have an, two actually, ST NUCLEO-H503RB dev board that I cannot get the debugger to work with it. My colleague on the other side of the country has the same boards and a similar setup and he is having no problems debugging. We have also verified that the zero ohm jumpers on his board match my board (in case there was an install error at the factory). This is the error I get in Windows / Linux and different versions of the IDE:
Error in final launch sequence:
Failed to start GDB server
Failed to start GDB server
Error in initializing ST-LINK device.
Reason: (255) Unknown. Please check power and cabling to target.
Here is what we have checked.
Our jumpers are the same are in the same configuration and in the recommended positions for on-board ST-Link debugging (JP2/JP6 installed, 5V_STLN installed, JP1 not installed)
We are using the same project.
The firmware on the on-board ST-Link's have been updated to the latest version (that the IDE programmer wanted installed). I have tried version V3J15M6 with HSE/3 8MHz (Default), HSE/4 6MHz, HSE/5 4.8MHz and both STM32Debug+VCP and STM32Debug+Mass storage+VCP
I can program and erase both boards with ST Prog (in both Windows 11 and Linux)
I get the same error when trying to debug (in both Windows 11 and Linux).
I have tried the latest IDE 1.15.1 (in both Windows 11 and Linux)
I have tried an older IDE 1.12.1 (that I use frequently with other boards).
I have tried both boards with both OS's.
I have tired disabling the onboard ST-Link3 on the dev board and use an external ST-Link3 with ST-Prog and the IDE. Like the on board ST-Link the ST-Prog works but the debugger does not.
I have tried generic out of the box project in Linux.
I have tried to run the GDB Server on the command line with increased debug levels and got this output:
$ /opt/st/stm32cubeide_1.15.1/plugins/com.st.stm32cube.ide.mcu.externaltools.stlink-gdb-server.linux64_2.1.300.202403291623/tools/bin/ST-LINK_gdbserver -p 61235 -l 31 -d -s -cp /opt/st/stm32cubeide_1.15.1/plugins/com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.linux64_2.1.201.202404072231/tools/bin -m 0 -g
STMicroelectronics ST-LINK GDB server. Version 7.7.0
Copyright (c) 2024, STMicroelectronics. All rights reserved.
Starting server with the following options:
Persistent Mode : Disabled
Logging Level : 31
Listen Port Number : 61235
Status Refresh Delay : 15s
Verbose Mode : Disabled
SWD Debug : Enabled
COM frequency = 24000 kHz
Target connection mode: Attach
Target connection failed
COM frequency = 8000 kHz
Target connection mode: Attach
Target connection failed
COM frequency = 3300 kHz
Target connection mode: Attach
Target connection failed
COM frequency = 1000 kHz
Target connection mode: Attach
Target connection failed
COM frequency = 200 kHz
Target connection mode: Attach
Target connection failed
COM frequency = 50 kHz
Target connection mode: Attach
Target connection failed
COM frequency = 5 kHz
Target connection mode: Attach
Target connection failed
Target unknown error 32
Error in initializing ST-LINK device.
Reason: Unknown. Please check power and cabling to target.
The debug configuration looks like this:
Both of these Nucleo boards are fresh out of the box yesterday.
I have verified that the DNF and jumpers related to connecting the ST-Link3 to the target MCU match the schematic from ST.
I have no firewall on on my Linux machine and the debugger works with a different boards (Though H7 chips). But the exact command line connection to GDB works with the H7 boards.
$ /opt/st/stm32cubeide_1.15.1/plugins/com.st.stm32cube.ide.mcu.externaltools.stlink-gdb-server.linux64_2.1.300.202403291623/tools/bin/ST-LINK_gdbserver -p 61235 -l 31 -d -s -cp /opt/st/stm32cubeide_1.15.1/plugins/com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.linux64_2.1.201.202404072231/tools/bin -m 0 -g
STMicroelectronics ST-LINK GDB server. Version 7.7.0
Copyright (c) 2024, STMicroelectronics. All rights reserved.
Starting server with the following options:
Persistent Mode : Disabled
Logging Level : 31
Listen Port Number : 61235
Status Refresh Delay : 15s
Verbose Mode : Disabled
SWD Debug : Enabled
COM frequency = 4000 kHz
Target connection mode: Attach
Reading ROM table for AP 0 @0xe00fefd0
Hardware watchpoint supported by the target
ST-LINK Firmware version : V2J43S7
Device ID: 0x450
PC: 0x0
ST-LINK device status: RUN_MODE
ST-LINK detects target voltage = 3.22 V
ST-LINK device status: RUN_MODE
ST-LINK device initialization OK
Stm32Device, pollAndNotify running...
SwvSrv state change: 0 -> 1
Waiting for debugger connection...
Waiting for connection on port 61236...
Waiting for connection on port 61235...
This last test (same exact command line, different ST-Link and Target) really make me think there is an issue with the boards I received.
Jacob
Solved! Go to Solution.
2024-06-10 02:53 AM
Hello,
Just wondering why Access port is set to "Cortex-M3" while it needs to be "Cortex-M33"?
If you try any STM32CubeIDE project example from STM32H5 Cube package and go to Debug Configuration you get (from GPIO_IOToggle example):
2024-06-10 02:53 AM
Hello,
Just wondering why Access port is set to "Cortex-M3" while it needs to be "Cortex-M33"?
If you try any STM32CubeIDE project example from STM32H5 Cube package and go to Debug Configuration you get (from GPIO_IOToggle example):
2024-06-10 09:29 AM
That's a great question. I looked at my colleagues Debug Configuration again and his is indeed set to 1 - CortexM33. The only option I have is 0 - CortexM3. I imported the project using the .ioc file. I went back and checked the project I built using the NUCLEO-H503RB and noticed that I had a second project open in STMCubeIDE and it was the one launching when I was trying to debug. When I closed the other project I am indeed able to launch and debug the sample project.
So I think this gets me half way there. Two open questions.
1. How do I change this to 1 - CortexM33 if the option is not available.
2. More importantly, how do I open and existing working project that is created on a colleagues computer and get the correct settings so I don't spend 5 hours trying to get the debugger to work in the future.
Jacob
2024-06-10 09:44 AM
Hello,
1. "How do I change this to 1 - CortexM33 if the option is not available."
-> I think there were an issue during the code generation. If CortexM33 option is not available for a generated code for H503 device it should be an issue during the code generation.
2. "More importantly, how do I open and existing working project that is created on a colleagues computer and get the correct settings so I don't spend 5 hours trying to get the debugger to work in the future."
-> Not sure I understood the comment but if your colleague provided you a complete workspace with the correct .project and .cproject will be able to open the project with the same settings.
If my previous comment solved your issue, please Accept it as solution.
Thank you.
2024-06-10 12:44 PM
Your going to laugh because I'm crying here... I cloned the wrong project and it was for STM32F1 chip. It was very similarly named. Nothing to see here...
Jacob
2024-06-10 12:47 PM
I guess advice for someone looking at this thread in the future is make sure you have the right chip in your .ioc file in the "Project Manager" tab:
Or on the Pinout & Configuration Tab:
Jacob