From 8f8427686752943389d24412f8ee8c80e1c06d03 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Wed, 3 May 2017 18:01:14 -0700 Subject: startup: initialize stack pointer in startup code Initialize stack pointer in startup code. This fixes issues when loading the firmware with loading mechanism which do not setup the stack pointer correctly (e.g. Toradex U-Boot 2016.11 with elf file format). Signed-off-by: Stefan Agner --- platform/devices/MCIMX7D/startup/gcc/startup_MCIMX7D_M4.S | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/platform/devices/MCIMX7D/startup/gcc/startup_MCIMX7D_M4.S b/platform/devices/MCIMX7D/startup/gcc/startup_MCIMX7D_M4.S index 5726a36..328fa9b 100644 --- a/platform/devices/MCIMX7D/startup/gcc/startup_MCIMX7D_M4.S +++ b/platform/devices/MCIMX7D/startup/gcc/startup_MCIMX7D_M4.S @@ -204,6 +204,11 @@ __isr_vector: .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: + /* + * Set stack pointer manually. Not all loading mechanism setup stack + * e.g. when using elf file format with Toradex U-Boot 2016.11 + */ + ldr sp,=__stack; cpsid i /* Mask interrupts */ #ifndef __NO_SYSTEM_INIT bl SystemInit -- cgit v1.2.3