cancel
Showing results for 
Search instead for 
Did you mean: 

ST-LINK GDB Server issue with STM32C5

AdrienST
Visitor

Hello, 

I'm using a NUCLEO-C5A3ZG. Not sure it's the right place to write but my goal is to setup the debugger using the STM32CubeCLT_1.21.0 Package under a VSCode environment (already using cortex-debug extension for other projects).

I am able to reach the target using the embedded stlink for example with a reading of the flash :

 /c/Program Files (x86)/ST/STM32CubeCLT_1.21.0/STM32CubeProgrammer
$ ./bin/STM32_Programmer_CLI.exe -c port=SWD freq=1000 mode=UR -r32 0x08000000 10
      -------------------------------------------------------------------
                       STM32CubeProgrammer v2.22.0
      -------------------------------------------------------------------

ST-LINK SN  : 005100353235511237333439
ST-LINK FW  : V3J17M10
Board       : NUCLEO-C5A3ZG
Voltage     : 3.29V
SWD freq    : 1000 KHz
Connect mode: Under Reset
Reset mode  : Hardware reset
Device ID   : 0x45A
Revision ID : Rev Z
Device name : STM32C59x/5A3
NVM size  : 1 MBytes
Device type : MCU
Device CPU  : Cortex-M33
BL Version  : 0x100
Debug in Low Power mode enabled


Reading 32-bit memory content
  Size          : 12 Bytes
  Address:      : 0x08000000
0x08000000 : 20000480 0800137D 080012B5

However when i try to use the GDB Server it fails with :

/c/Program Files (x86)/ST/STM32CubeCLT_1.21.0/STLink-gdb-server
$ ./bin/ST-LINK_gdbserver.exe --swd --halt -l 31


STMicroelectronics ST-LINK GDB server. Version 7.13.0
Copyright (c) 2026, STMicroelectronics. All rights reserved.

Starting server with the following options:
        Persistent Mode            : Disabled
        Logging Level              : 31
        Listen Port Number         : 61234
        Status Refresh Delay       : 15s
        Verbose Mode               : Disabled
        SWD Debug                  : Enabled

COM frequency = 24000 kHz
Target connection mode: Default
Target connection failed. Try connecting under reset
Target connection failed
COM frequency = 8000 kHz
Target connection mode: Default
Target connection failed. Try connecting under reset
Target connection failed
COM frequency = 3300 kHz
Target connection mode: Default
Target connection failed. Try connecting under reset
Target connection failed
COM frequency = 1000 kHz
Target connection mode: Default
Target connection failed. Try connecting under reset
Target connection failed
COM frequency = 200 kHz
Target connection mode: Default
Target connection failed. Try connecting under reset
Target connection failed
COM frequency = 50 kHz
Target connection mode: Default
Target connection failed. Try connecting under reset
Target connection failed
COM frequency = 5 kHz
Target connection mode: Default
Target connection failed. Try connecting under reset
Target connection failed
Target unknown error 32

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

I tried in a linux environment, same behavior.

I checked the correct behavior on an other nucleo board NUCLEO-H7A3ZI & it is ok.

Thank's for your help.

1 ACCEPTED SOLUTION

Accepted Solutions
LaurentL
ST Employee

Hello,

This device has the CPU core on access port 1 so you should add "-m 1" in your args.

Rgds,

Laurent

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.

View solution in original post

3 REPLIES 3
LaurentL
ST Employee

Hello,

This device has the CPU core on access port 1 so you should add "-m 1" in your args.

Rgds,

Laurent

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.
AdrienST
Visitor

Thank you very much !

Just for my understanding, as it's not a multicore device, what's the explanation for this change ?

Have a look in the Reference Manual on "Debug support (DBG)" chapter and then Access Ports :

There are two access ports (AP) attached to the DP.
• System debug access port (AP0): Enables access to the DBGMCU and the system ROM table via an APB bus.
• Cortex-M33 debug access port (AP1): Enables access to the debug and trace features integrated in the Cortex-M33 processor core via its internal AHB bus.

 

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.