AnsweredAssumed Answered

Software reset flag (SFTRSTF) in RCC CSR register: what source?

Question asked by Jesper on Apr 9, 2013
Latest reply on Apr 7, 2014 by Mike U
Hi all,

I'm currently working on a custom bootloader. Whenever a reset occurs, it should check if that reset was initiated by the user application. The user application generates a reset by calling the NVIC_SystemReset function.

It seemed logically to me, that this equals generating a software reset so i could check the SFTRSTF flag in  RCC_CSR. However, it isn't set when calling NVIC_SystemReset. The reference manual RM0008 states that it is "Set by hardware when a software reset occurs." [RM0008 rev 14,page 148].

So, I'm wondering what causes the SFTRSTF-flag bit to be set by hardware as stated in the reference manual?
I'm currently setting the flag manually before calling NVIC_SystemReset, but I'm not sure if that's a correct solution.

Regards Jesper.

Outcomes