Skip to main content
Nadreoh
Associate II
Mar 28, 2025 1:22 PM UTC
Solved

STM32G0B0RET - SFTRSTF not working?

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.
Nadreoh
NadreohBest answer
Associate II
Mar 28, 2025 1:27 PM UTC

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
Mar 28, 2025 1:27 PM UTC

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.