10 years, 2 months ago.

reset command (soft reset)

Hi, I want to know is there any way to reset the K64F micro controller through software command. I know there is one for the lpc1768, but i need to reset the mbed from my software application, for example if flag is greater than 100, then reset the mbed

3 Answers

10 years, 2 months ago.

Look at cmsis header file for your core, core_cm4.h, where function NVIC_SystemReset is defined.

Definition from core_cm4.h

__STATIC_INLINE void NVIC_SystemReset(void)
{
  __DSB();                                                     /* Ensure all outstanding memory accesses included
                                                                  buffered write are completed before reset */
  SCB->AIRCR  = ((0x5FA << SCB_AIRCR_VECTKEY_Pos)      |
                 (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) |
                 SCB_AIRCR_SYSRESETREQ_Msk);                   /* Keep priority group unchanged */
  __DSB();                                                     /* Ensure completion of memory access */
  while(1);                                                    /* wait until reset */
}

i am a bit confuse, where i am supposed to write this code, in main ??

posted by zain aftab 24 Sep 2014

I am also getting the error pinmap not found for peripheral

posted by zain aftab 24 Sep 2014
10 years, 2 months ago.

As Martin said, you just need to call NVIC_SystemReset(); so:

if (flag > 100) {
    NVIC_SystemReset();
}

i hav Nucleo F103 if i use NVIC_SystemReset(); my board stop to work !!! not reboot

posted by Hamza BENDALI BRAHAM 30 Oct 2015
8 years, 3 months ago.

Some problem have, NVIC_SystemReset(); not work on my F103RB! Program just freeze and that's all.

Connecting NRST pin to other DigitalOut-ed pin - not work too (Reset work's but freeze after 0,2-0,5 sec)

I'm do simple, adding a elec-cap 10uF betwen NRST and VCC and it works!

Solve found here: https://developer.mbed.org/questions/55279/How-can-I-soft-reset-F103RB-with-mbed-AP/

(I can't do any changes to system initialization proccess cause i'm using online compiler)