Skip to content

Commit 01d06a9

Browse files
committed
LPC4088: Fix hardfault occuring after power-cycle
Since revision 5499db1 (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. - Revision ca661f9 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: #5065
1 parent 3bc2d2e commit 01d06a9

File tree

1 file changed

+3
-2
lines changed
  • targets/TARGET_NXP/TARGET_LPC408X

1 file changed

+3
-2
lines changed

targets/TARGET_NXP/TARGET_LPC408X/sleep.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@
1919

2020
void hal_sleep(void) {
2121
LPC_SC->PCON = 0x0;
22-
22+
2323
// SRC[SLEEPDEEP] set to 0 = sleep
2424
SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk;
25-
25+
2626
// wait for interrupt
2727
__WFI();
28+
__NOP();
2829
}
2930

3031
/*

0 commit comments

Comments
 (0)