if I compile the RT-STM32G0B1RE-NUCLEO64 demo with the default configuration the debugging session works perfectly.
When I disable the clock dynamic in mcuconf.h the GDB debugger finds the target, programs it, launches the application but then got stuck because the program counter never reaches the main(). Specifically it never exit from stm32_clock_init().
Best regards.
Environment:
ChibiOs on branch stable_21.11.x (subversion repository)
IDE: STM32CubeIde v1.19.0
Demo: RT-STM32G0B1RE-NUCLEO64
Compiler: GCC v13.3.1
How to reproduce the problem:
Disable clock dynamic feature in mcuconf.h, from
Code: Select all
#define STM32_CLOCK_DYNAMIC TRUEto
Code: Select all
#define STM32_CLOCK_DYNAMIC FALSEGDB session log:
STMicroelectronics ST-LINK GDB server. Version 7.11.0
Copyright (c) 2025, STMicroelectronics. All rights reserved.
Starting server with the following options:
Persistent Mode : Disabled
LogFile Name : /home/cesare/git_repositories/nucleo-stm32g0b1re/src/gdb.log
Logging Level : 31
Listen Port Number : 61234
Status Refresh Delay : 15s
Verbose Mode : Enabled
SWD Debug : Enabled
InitWhile : Enabled
COM frequency = 4000 kHz
Target connection mode: Under reset
Reading ROM table for AP 0 @0xf0000fd0
Hardware watchpoint supported by the target
ST-LINK Firmware version : V2J46M33
Device ID: 0x467
PC: 0x8000190
ST-LINK device status: HALT_MODE
ST-LINK detects target voltage = 3.22 V
ST-LINK device status: HALT_MODE
ST-LINK device initialization OK
Stm32Device, pollAndNotify running...
SwvSrv state change: 0 -> 1
Waiting for debugger connection...
Waiting for connection on port 61234...
Waiting for connection on port 61235...
Accepted connection on port 61234...
Debugger connected
Waiting for debugger connection...
Waiting for connection on port 61234...
GDB session thread running
GdbSessionManager, session started: 1
Accepted connection on port 61234...
Debugger connected
Waiting for debugger connection...
Waiting for connection on port 61234...
GDB session thread running
GdbSessionManager, session started: 2
Stm32Device, closeDevice() entry
GDB session, device event: 6
GDB session, device event: 6
Stm32Device, pollAndNotify stopped
Stm32Device, closeDevice() exit
------ Switching to STM32CubeProgrammer -----
-------------------------------------------------------------------
STM32CubeProgrammer v2.20.0
-------------------------------------------------------------------
Log output file: /tmp/STM32CubeProgrammer_yNbnJc.log
ST-LINK SN : 066FFF495087534867062659
ST-LINK FW : V2J46M33
Board : NUCLEO-G0B1RE
Voltage : 3,22V
SWD freq : 4000 KHz
Connect mode: Under Reset
Reset mode : Hardware reset
Device ID : 0x467
Revision ID : Rev A
Device name : STM32G0B0xx/B1xx/C1xx
Flash size : 512 KBytes
Device type : MCU
Device CPU : Cortex-M0+
BL Version : 0x92
Opening and parsing file: ST-LINK_GDB_server_ZivTkI.srec
Memory Programming ...
File : ST-LINK_GDB_server_ZivTkI.srec
Size : 77.57 KB
Address : 0x08000000
Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 38]
Download in Progress:
[==================================================] 100%
File download complete
Time elapsed during download operation: 00:00:02.131
------ Switching context -----
COM frequency = 4000 kHz
Target connection mode: Under reset
Reading ROM table for AP 0 @0xf0000fd0
Hardware watchpoint supported by the target
ST-LINK Firmware version : V2J46M33
Device ID: 0x467
PC: 0x8000190
ST-LINK detects target voltage = 3.22 V
ST-LINK device status: HALT_MODE
GDB session, device event: 7
GDB session, device event: 7
Stm32Device, pollAndNotify running...
GDB session, device event: 4
GDB session, device event: 4
GDB session, device event: 2
GDB session, device event: 2
ST-LINK device status: Failed to get status, Target not responding, retrying... 19
Target is not responding, retrying...
ST-LINK device status: Failed to get status, Target not responding, retrying... 19
Target is not responding, retrying...
ST-LINK device status: Failed to get status, Target not responding, retrying... 19
Target is not responding, retrying...
ST-LINK device status: Failed to get status, Target not responding, retrying... 19
Target is not responding, retrying...
ST-LINK device status: Failed to get status, Target not responding, retrying... 19
Target is not responding, retrying...
ST-LINK device status: Failed to get status, Target not responding, retrying... 19
Target is not responding, retrying...
ST-LINK device status: Failed to get status, Target not responding, retrying... 19
Target is not responding, retrying...
ST-LINK device status: Failed to get status, Target not responding, retrying... 19
Target is not responding, retrying...
ST-LINK device status: Failed to get status, Target not responding, retrying... 19
Target is not responding, retrying...
ST-LINK device status: Failed to get status, Target not responding, retrying... 19
Target is not responding, retrying...
ST-LINK device status: TMO (Max Retries)
GDB session, device event: 3
GDB session, device event: 3
GdbSession, Lost target connection, Exiting...
GDB session terminated
GdbSessionManager, session terminated: 2
GdbSession, Lost target connection, Exiting...
GDB session terminated
GdbSessionManager, session terminated: 1
GdbSrv, last session terminated, signal dispose
Stopping port 61234
Stm32Device, pollAndNotify stopped
Received stop for port 61234, not accepting new connections.
GdbSrv, deInit entry.
Shutting down...
GdbSessionManager, deInit entry.
GDB session disposed: 2
GDB session disposed: 1
GdbSessionManager, deInit exit
SwvSrv deInit entry
Stopping port 61235
Received stop for port 61235, not accepting new connections.
SwvSrv deInit exit
SemihostSrv deInit entry
SemihostSrv deInit exit
Stm32Device, closeDevice() entry
Stm32Device, closeDevice() exit
Stm32Device, deInit success
GdbSrv, deInit exit.
Exit.