Skip to content

Commit 70028dd

Browse files
benwrsAnas Nashif
authored andcommitted
arm/frdm_k64f: fix boot issue with MBED bootloader and INIT_STACKS=y
Initializing the interrupt stack before initializing (turning off) the watchdog on the FRDM board pushed the initialization of the watchdog too late, causing it to fire and reset the board. The board would be kept in a reboot loop. Move the initialization of the watchdog earlier: this runs on the main stack now, instead of the interrupt stack, the same stack the interrupt stack initalization code runs on. Change-Id: Ic0006f4f4f4090393571d8355a80dc9390c9fbc6 Signed-off-by: Benjamin Walsh <[email protected]> (cherry picked from commit eba0176)
1 parent d15b758 commit 70028dd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

arch/arm/core/cortex_m/reset.S

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ SECTION_SUBSEC_FUNC(TEXT,_reset_section,__start)
7979
msr BASEPRI, r0
8080
#endif
8181

82+
#ifdef CONFIG_WDOG_INIT
83+
/* board-specific watchdog initialization is necessary */
84+
bl _WdogInit
85+
#endif
86+
8287
#ifdef CONFIG_INIT_STACKS
8388
ldr r0, =_interrupt_stack
8489
ldr r1, =0xaa
@@ -97,11 +102,6 @@ SECTION_SUBSEC_FUNC(TEXT,_reset_section,__start)
97102
movs.n r0, #2 /* switch to using PSP (bit1 of CONTROL reg) */
98103
msr CONTROL, r0
99104

100-
#ifdef CONFIG_WDOG_INIT
101-
/* board-specific watchdog initialization is necessary */
102-
bl _WdogInit
103-
#endif
104-
105105
b _PrepC
106106

107107
#if defined(CONFIG_SOC_TI_LM3S6965_QEMU)

0 commit comments

Comments
 (0)