STM32H503 Debugging Issue in CLion 2026.2.3

I'm having trouble debugging STM32H503 devices from CLion 2026.2.3 using the built-in STM32 support.

Tested hardware:

NUCLEO-H503RB (onboard ST-LINK/V3)
Custom STM32H503 board + ST-LINK/V3SET

Both configurations fail with the same error:

C:\ST\STM32CubeCLT_1.22.0\STLink-gdb-server\bin\ST-LINK_gdbserver.exe -p 61234 -cp C:\ST\STM32CubeCLT_1.22.0\STM32CubeProgrammer\bin --halt --apid 0 -d --frequency 8000


STMicroelectronics ST-LINK GDB server. Version 7.14.0
Copyright (c) 2026, 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

Target unknown error 32

Error in initializing ST-LINK device.
Reason: Unknown. Please check power and cabling to target.

Debug Server terminated: Unknown error.
 

Initially I suspected the onboard debugger of the NUCLEO board, but the exact same issue occurs with an external ST-LINK/V3SET connected to custom STM32H503 hardware. The ST-LINK/V3SET works fine with CLion when debugging STM32G0 and STM32G4 devices.

The same STM32H503 hardware works correctly with:

STM32CubeIDE 2.2.0
STM32CubeProgrammer 2.23.0

I was eventually able to get debugging working in CLion by creating a custom Embedded GDB Server configuration using the same ST-LINK GDB Server command line generated by CubeIDE.

With the custom configuration I can successfully:

Download firmware
Start debug sessions
Set breakpoints
Single-step
Inspect variables

Is there a known issue with STM32H5 devices and CLion's built-in STM32 integration, or is there a way to customize the generated ST-LINK GDB Server configuration?
 

0
4 comments

Hi MarcV!

I'm having trouble debugging STM32H503 devices from CLion 2026.2.3 using the built-in STM32 support.

By the built-in STM32 support, do you mean the ST-LINK debug profile (Settings | Build, Execution, Deployment | Debugger | Debug Profiles)?

If so, please provide screenshots of all tabs of this debug profile.

I was eventually able to get debugging working in CLion by creating a custom Embedded GDB Server configuration using the same ST-LINK GDB Server command line generated by CubeIDE.

Please share the command with which the debugging process succeeded and a screenshot of the Embedded GDB Server configuration.

0

By the built-in STM32 support, do you mean the ST-LINK debug profile (Settings | Build, Execution, Deployment | Debugger | Debug Profiles)?

Yes, I use the built-in ST-LINK profile that works perfectly fine with my STM32G0 and STM32G4 projects, but not with a STM32H5 based board.

With the help of an AI tool I managed to figure out how to setup a custom Embedded GDB Server configuration which seems to work…

The name of this particular project is “speedtest”…

These are essentially the settings as they are used by STM32CubeIDE for that type of microcontroller. With this configuration I can start a debug session but the “RUN” button is greyed out.

0

MarcV, thank you for the provided details!

I see that in the command used by the ST-LINK debug profile, the GDB server and programmer from C:\ST\STM32CubeCLT_1.22.0 are used. While in the Embedded GDB Server configuration, you use the GDB server and programmer from C:\ST\STM32CubeIDE_2.2.0\STM32CubeIDE\plugins.

Could you please check if this makes any difference? What happens if you change the GDB server and programmer in the Embedded GDB Server configuration to C:\ST\STM32CubeCLT_1.22.0\STLink-gdb-server\bin\ST-LINK_gdbserver.exe and C:\ST\STM32CubeCLT_1.22.0\STM32CubeProgrammer\bin? Does it still work?

0

That works equally well. It didn't occur to me that it referred to the STM32CubeIDE variants. That's what you get when blindly following AI 🫣.

It is now setup like this:

When I start the debug session, I get this output:

The error message pops up every time, also when using the STM32CubeIDE based configuration.

0

Please sign in to leave a comment.