This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Cortex-M0 hangs up after soft reset

We have a device which is used with NXP1115/303 MCU(cortex M0 core). Application doesn't do much, most of the time it sleeps in the deep power mode since the device  is on 3V lithium batery. The system do a soft reset every 30sec. Reset is implemented via Reset Control Register by setting SYSRESETREQ attribute(NVIC_SystemReset function):

__STATIC_INLINE void NVIC_SystemReset(void)
{
      __disable_irq();
   __DSB(); 
   SCB->AIRCR = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | SCB_AIRCR_SYSRESETREQ_Msk);
   __DSB(); 

   for(;;) /* wait until reset */
   {
     __NOP();
   }
}

The Reset Handler looks like this:

Reset_Handler PROC
              EXPORT Reset_Handler [WEAK]
              IMPORT __main
              LDR R0, =__main
              BX R0
              ENDP

SystemInit is at the beggining of the main function.


The issue is that MCU sometimes hangs up after the reset procedure. But it's not every time. It hangs up quite randomly, approx. 1 out of 100k(or even more) resets. It's clear that it doesn't hang up in the SystemInit or in the main. It's not really clear what is happening with the MCU at the hang up state, but it looks like it is in lock up state.

Some known information:

  • When MCU is hanged up, it can be reseted by full power up or with RESET pin;
  • The current consumption is 3,4 mA, wich ussual is for a device when only MCU is working (peripheral is sleeping or turned off);
  • As it can be seen from the code snippet above, before the NVIC reset interrupts are disabled;
  • MCU doesn't hang up in the main, it's prior that or during the RESET procedure;
  • The external crystal is not used;
  • Possibility to occur this case is aprrox. 1 out of >100k resets.

Is there any suggestions which can be tried? Any ideas is welcome!