2024-12-16 10:37 PM
I am trying to use CLion to program STM32 MCUs as an alternative to other IDEs. For flashing and debugging, I want to use the Embedded GDB Server provided by ST, specifically ST-LINK_gdbserver.exe.
I prefer not to use OpenOCD because I have found it to be less stable for my use case.
I am struggling to find the correct configuration to make ST-LINK_gdbserver.exe work properly with CLion. I tried using a configuration I found in this GitHub issue:
Link: Official ST-LINK gdbserver support · Issue #354 · Marus/cortex-debug
However, when I try to run the GDB Server with this configuration:
I receive the following error:
C:\ST\STM32CubeIDE_1.13.1\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.stlink-gdb-server.win32_2.2.0.202409170845\tools\bin\ST-LINK_gdbserver.exe -p 3333 -cp C:\ST\STM32CubeIDE_1.13.1\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_2.2.0.202409170845\tools\bin -k
STMicroelectronics ST-LINK GDB server. Version 7.9.0
Copyright (c) 2024, STMicroelectronics. All rights reserved.
Starting server with the following options:
Persistent Mode : Disabled
Logging Level : 1
Listen Port Number : 3333
Status Refresh Delay : 15s
Verbose Mode : Disabled
InitWhile : Enabled
Target unknown MCU target
Error in initializing ST-LINK device.
Reason: Unknown MCU found on target.
GDB Server stopped, exit code 5
Process finished with exit code 0
The error message "Unknown MCU found on target" is confusing because the project is explicitly set up for an STM32F411RE, and the board is correctly connected. I have tested the board with STM32CubeProgrammer, and it connects without any issues.
What is the correct configuration or setup to use ST-LINK_gdbserver.exe with CLion? Are there any additional arguments or steps I need to add to resolve this issue?
Any help or insight is greatly appreciated!