2021-04-17 09:28 AM
2021-04-17 09:39 AM
Summary:
STM32CubeIDE 1.6.1 debugging works on a new, blank project but fails on the UART_Printf example.
Details:
I'm running STMCubeIDE Version: 1.6.1 Build: 9958_20210326_1446 (UTC) on macOS 11.1 (Big Sur), and connecting to a NUCLEO-G431RB dev board.
I created a new, blank project for the board (New => STM32 Project => Board Selector => NUCLEO-G431RB), compiled it and started the debugger. It started without error and I could single step through the instructions. Here's what was printed on the console:
STMicroelectronics ST-LINK GDB server. Version 5.8.0
Copyright (c) 2020, STMicroelectronics. All rights reserved.
Starting server with the following options:
Persistent Mode : Disabled
Logging Level : 1
Listen Port Number : 61234
Status Refresh Delay : 15s
Verbose Mode : Disabled
SWD Debug : Enabled
InitWhile : Enabled
Waiting for debugger connection...
Debugger connected
-------------------------------------------------------------------
STM32CubeProgrammer v2.7.0-RC1
-------------------------------------------------------------------
... (continued without error)...
I then created a new example project for the board (New => STM32 Project => Example Selector => UART_Printf), selecting the version for the NUCLEO-G431RB, compiled it and started the debugger. The debugger immediately shut down. Here is what was printed on the console:
STMicroelectronics ST-LINK GDB server. Version 5.8.0
Copyright (c) 2020, STMicroelectronics. All rights reserved.
Starting server with the following options:
Persistent Mode : Disabled
Logging Level : 1
Listen Port Number : 61234
Status Refresh Delay : 15s
Verbose Mode : Disabled
SWD Debug : Enabled
InitWhile : Enabled
Waiting for debugger connection...
Debugger connected
Debugger connection lost.
Shutting down...
Just to make sure it wasn't a sequencing issue, I re-opened the blank project I previously created and launched the debugger. It worked without trouble.
Question:
So there appears to be something in the UART_Printf example that's causing the debugger to fail. What should I check for to diagnose this?
2021-04-17 03:03 PM
If you open directly the CubeIDE project (not via example selector), will it work?
2021-04-19 05:00 AM
I have this problem alvays when I forgot alow MCU debug port in configuration (in CubeMX)
2021-04-20 11:43 PM
@ONadr.1, you have this problem with STM32CubeIDE or another IDE/debugger? It should not be necessary since CubeIDE forces the required GPIO pins to be used in SWD mode when connecting to target. So this is a bit surprising to me. Any specific board this happens with?
@Robert Poor, I do not have access to this board (home office era), so cannot test run this particular example. Reading your console output it seems as if the connection to the ST-LINK crashes before CubeProg is allowed to download the example project binary. I think this rules out that there could be a problem with the elf-file of the UART_Printf example. Could you tell me which version of the CubeFW you are relying on? There are not .launch-files bundled with the example projects --> means that your CubeIDE environment was responsible to generate the debug configuration. I am wondering if it in some way could be corrupt? Things you can try:
2021-04-21 05:43 PM
For better or worse, deleting and regenerating the project fixed the problem. As a result, I've not been able to replicate the problem, so we may never know what happened.
But thank you for your answers and suggestions!
2021-06-24 12:17 AM
Hello,
Just reviving this thread due to experiencing the same problems and by now having tried all the "fixes" that I've been able to find.
STMicroelectronics ST-LINK GDB server. Version 5.8.0
Copyright (c) 2020, STMicroelectronics. All rights reserved.
Starting server with the following options:
Persistent Mode : Disabled
Logging Level : 1
Listen Port Number : 61234
Status Refresh Delay : 15s
Verbose Mode : Disabled
SWD Debug : Enabled
InitWhile : Enabled
Waiting for debugger connection...
Debugger connected
Debugger connection lost.
Shutting down...
I'm evaluating the STM32L4 (brand new nucleo-l476rg board) for a new design and thus far I have not been able to even get started...
Has there been any development regarding this issue?
Edit:
Enabling verbose mode doesn't provide me more information:
ST-LINK device status: HALT_MODE
ST-LINK detects target voltage = 3.27 V
ST-LINK device status: HALT_MODE
ST-LINK device initialization OK
Waiting for debugger connection...
Waiting for connection on port 61234...
Accepted connection on port 61234...
Debugger connected
Debugger connection lost.
Shutting down...
2024-11-06 01:02 AM
i am facing the same issue...Is anyone got the solution
STMicroelectronics ST-LINK GDB server. Version 7.8.0
Copyright (c) 2024, STMicroelectronics. All rights reserved.
Starting server with the following options:
Persistent Mode : Disabled
Logging Level : 1
Listen Port Number : 61234
Status Refresh Delay : 15s
Verbose Mode : Disabled
SWD Debug : Enabled
InitWhile : Enabled
Waiting for debugger connection...
Debugger connected
Waiting for debugger connection...
Debugger connected
Waiting for debugger connection...
Shutting down...
Exit.