mirror of https://github.com/ARMmbed/mbed-os.git
LPC4088: Fix hardfault occuring after power-cycle
Since revisionpull/6598/head5499db1
(mbed-os-5.6.0) a hardfault occurs after a power-cycle. It doesn't occur after a reset when the application has been downloaded using drag-and-drop or via debugger. This is probably the reason why this problem isn't detected when testing new mbed releases. The hardfault occured in hal_sleep(). Adding a __NOP after __WFI solves the problem although I don't fully understand why. - Revisionca661f9
is the last revision where the problem doesn't occur. - The problem doesn't occur when compiling with GCC instead of ARM compiler - This issue describes a similar, but not identical problem and led me to test adding a __NOP: https://github.com/ARMmbed/mbed-os/issues/5065
parent
3bc2d2e1db
commit
01d06a9f51
|
@ -19,12 +19,13 @@
|
||||||
|
|
||||||
void hal_sleep(void) {
|
void hal_sleep(void) {
|
||||||
LPC_SC->PCON = 0x0;
|
LPC_SC->PCON = 0x0;
|
||||||
|
|
||||||
// SRC[SLEEPDEEP] set to 0 = sleep
|
// SRC[SLEEPDEEP] set to 0 = sleep
|
||||||
SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk;
|
SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk;
|
||||||
|
|
||||||
// wait for interrupt
|
// wait for interrupt
|
||||||
__WFI();
|
__WFI();
|
||||||
|
__NOP();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue