Hello @yinqiu,
The SRAM content is preserved across functional reset.

The SRAM is initialized in startup_cm7.s up to __INT_SRAM_END, which is by default set to ORIGIN(ram_rsvd2), so you need to adjust that.
After any reset, when the debugger is disconnected, we can trap the execution is a loop like this.

Regards,
Daniel