Skip to main content
Nadreoh
Associate II
March 28, 2025
Solved

STM32G0B0RET - SFTRSTF not working?

  • March 28, 2025
  • 1 reply
  • 345 views

Hi there,

Context

I implement a basic code where I check the reset cause flag SFTRSTF (i.e. software reset). If this flag is active, I activate the LED on (LED off otherwise).

I read out the reset cause from:

uint32_t myResetCause = RCC->CSR;
RCC->CSR |= RCC_CSR_RMVF; // Clean reset causes for next start

 Issue

After flashing this code, I power off my MCU and I remove the debugger cable.
Then I power on my MCU and it activates the LED, meaning the software reset has been detected, but I triggered an hardware reset ...!

Do I miss to clean another register?
Is there any information somewhere about this behavior?
Is it an expected behavior??

This topic has been closed for replies.
Best answer by Nadreoh

Ok my issue is related to a RAM area that I configured to be ignored by the BSS and that took random values at boot.

1 reply

Nadreoh
NadreohAuthorBest answer
Associate II
March 28, 2025

Ok my issue is related to a RAM area that I configured to be ignored by the BSS and that took random values at boot.