Skip to main content
Associate II
September 8, 2025
Question

Trying to setup CLion environment with ST-LINK_gdbserver

  • September 8, 2025
  • 1 reply
  • 1052 views

Hi everyone,

I am a little desperate due to my problem in debugging my programs on my newly purchased STM32N6570-DK discovery board. I am running all the software on my Macbook Pro 2024 with M4 Max processor with macOS Sequoia 15.6.1.

I have been using STM32 Cube IDE version 1.19 and have successfully managed to debug a binary. It was the classic blink example. It seems to be working fine in the Cube IDE but not when I am trying to setup a debug target in my CLion environment. I have been comparing all of the parameters to the debugger between Cube IDE and CLion and tried using exact same. I have also tried using the separate CLT package for the programmer and debugger from ST.

It always results in a timeout and releasing debugger with a disconnection and the following message:

Error in initializing ST-LINK device.
Reason: Target not halted.
GDB Server stopped, exit code 9

Anyone having ideas?

1 reply

Ghofrane GSOURI
Technical Moderator
September 12, 2025

Hello @nilssonm 

Thank you for reaching out regarding your setup with CLion. Our support is focused on STM32CubeIDE and the tools officially provided by STMicroelectronics. While we understand the importance of integrating with other development environments, we are unable to provide detailed assistance for third-party IDEs such as CLion, as it falls outside our official support scope.

For issues related to STM32CubeIDE, we are more than happy to assist you. If you encounter any problems or have questions about STM32CubeIDE, please let us know, and we will do our best to help.

THX

Ghofrane

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
nilssonmAuthor
Associate II
September 15, 2025

Hello,

I would like to say that this is not a CLion problem. I only mentioned it because of the context. I would like to describe this as a problem when I am trying to use the command line tools from ST instead of running all in the CubeIDE. I am getting this error when starting my application using the command line tools to debug. I have been able to successfully debug the application when clearing all pin-assignments in the CubeMX tool before using the generated code, but because I thought that I could let the default assignments be when running this on the Discovery board results in the problem described.

Is there some default assignment that could be a conflict with debugging?

Thanks,

Mats

Ghofrane GSOURI
Technical Moderator
September 15, 2025

Hello @nilssonm 

As shown in the following screenshot 

GhofraneGSOURI_0-1757937443459.png

CubeMX is warning about a debug conflict:

Debug Conflict with:
PE0 mapped with GPIO_Output and
PA15(TDI) mapped with ULTCD_RS and/or
PA05 mapped with GPIO_input and/or
PD0 mapped with GPIO_input and/or
PD1 mapped with GPIO_input

This prevents the debugger from working because the hardware cannot use the same pin for both debugging and another peripheral at the same time.
This is the root cause of your "Target not halted" and ST-LINK errors.

CubeMX is intentionally designed to offer flexibility, allowing you to customize or reassign pin functions according to your project’s requirements. While it provides warnings about such conflicts, it leaves the final decision to you.

THX

Ghofrane

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.