diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2017-05-03 18:01:14 -0700 |
---|---|---|
committer | Stefan Agner <stefan.agner@toradex.com> | 2017-05-03 18:01:14 -0700 |
commit | 8f8427686752943389d24412f8ee8c80e1c06d03 (patch) | |
tree | 03dbdb800bc9375bf74a0193f2e7ac81406cbcf4 | |
parent | acebb1dd18f01174edc21dfb310444d344bd4563 (diff) |
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 <stefan.agner@toradex.com>
-rw-r--r-- | platform/devices/MCIMX7D/startup/gcc/startup_MCIMX7D_M4.S | 5 |
1 files changed, 5 insertions, 0 deletions
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 |