From eba017632a25b0838abbdab1b5348c53df504278 Mon Sep 17 00:00:00 2001 From: Benjamin Walsh Date: Mon, 28 Nov 2016 12:22:35 -0500 Subject: [PATCH] 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 --- arch/arm/core/cortex_m/reset.S | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm/core/cortex_m/reset.S b/arch/arm/core/cortex_m/reset.S index e80d7f5f4f2..631b1076639 100644 --- a/arch/arm/core/cortex_m/reset.S +++ b/arch/arm/core/cortex_m/reset.S @@ -79,6 +79,11 @@ SECTION_SUBSEC_FUNC(TEXT,_reset_section,__start) msr BASEPRI, r0 #endif +#ifdef CONFIG_WDOG_INIT + /* board-specific watchdog initialization is necessary */ + bl _WdogInit +#endif + #ifdef CONFIG_INIT_STACKS ldr r0, =_interrupt_stack ldr r1, =0xaa @@ -97,11 +102,6 @@ SECTION_SUBSEC_FUNC(TEXT,_reset_section,__start) movs.n r0, #2 /* switch to using PSP (bit1 of CONTROL reg) */ msr CONTROL, r0 -#ifdef CONFIG_WDOG_INIT - /* board-specific watchdog initialization is necessary */ - bl _WdogInit -#endif - b _PrepC #if defined(CONFIG_SOC_TI_LM3S6965_QEMU)