From c4c341b3f915d8402876fbe44c14677f43942cb2 Mon Sep 17 00:00:00 2001 From: Ondrej Mikle Date: Thu, 14 May 2020 12:46:25 +0200 Subject: [PATCH] core: setup stack when running core on T1 --- core/embed/firmware/startup.s | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/embed/firmware/startup.s b/core/embed/firmware/startup.s index cbcfb67bd6..03081990a8 100644 --- a/core/embed/firmware/startup.s +++ b/core/embed/firmware/startup.s @@ -5,6 +5,14 @@ .global reset_handler .type reset_handler, STT_FUNC reset_handler: + +#if TREZOR_MODEL == 1 + ldr r0, =_estack - 8 // r0 = stack pointer, T1 bootloader had 8 bytes reserved at end + msr msp, r0 // set stack pointer + dsb + isb +#endif + // setup environment for subsequent stage of code ldr r0, =ccmram_start // r0 - point to beginning of CCMRAM ldr r1, =ccmram_end // r1 - point to byte after the end of CCMRAM