AnsweredAssumed Answered

System software reset, effects and privileges

Question asked by zavatta.marco on Apr 21, 2012
Latest reply on Apr 24, 2012 by zavatta.marco
Hi all,

I'm building a custom bootloader and need to provide a way to write protect/unprotect the memory. In order to commit the change, a system reset is required, which I sought to be a software-triggered reset.

First off, what are the effects of a software-triggered reset? Will the program again go though ResetHandler as it does with an external reset?

I've tried the following ways to generate the system software reset:
- NVIC_SystemReset from within my code (goes into HardFault handler). This is expected to be wrong in my opinion given that the execution in not privileged.
- Supervisor call, and within the SVCHandler use NVIC_SystemReset: no effect on AIRCR i.e. bit 2 still cleared and the while(1) within NVIC_SystemReset looping forever. But at least no Hard Fault.
- Escalate privileges at startup within ResetHandler by __set_CONTROL(0x00000001): no effect.

Any hits/flaws that you see?
Thanks guys!!

Marco

Outcomes