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:
Is there any suggestions which can be tried? Any ideas is welcome!
UPDATED: even when reset is made by WDT (feeding the wrong sequence) the same situation occurs.