Skip to main content
Associate III
Question

STM32CubeIDE 2.3.0 GDB doesn't restore target and close J-Link connection when programming with J-Link

When I flash a board using a Segger J-Link programmer in STMCubeIDE 2.3.0, the target does not run after programming, and requires a power cycle/reset. I have tried Software Reset and Hardware Reset in the Run Configuration options.

This issue was present in 2.2.0 also, but not 2.1.0.  I previously posted about 2.2.0 here, which has further details: 

Basically, GDB is not restoring the target state, closing the J-Link connection, and shutting down at the end of programming.  This can be seen by examining the GDB console log. From 2.1.0:

Read 4 bytes @ address 0x08011B0A (Data = 0x47706818)
GDB closed TCP/IP connection (Socket 948)
Restoring target state and closing J-Link connection...
Shutting down...

The end of the log in 2.3.0:

Read 4 bytes @ address 0x0800112C (Data = 0x682B43C4)
Reading 64 bytes @ address 0x2004FFC0
GDB closed TCP/IP connection (Socket 976)

It would be helpful if I didn’t have to manually reset or power cycle the board after every program, though that is a workaround.  Is there something that can be added to the Run Configuration settings to force a reset or restore the behavior from 2.1.0?