1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-23 06:48:16 +00:00

core: setup stack when running core on T1

This commit is contained in:
Ondrej Mikle 2020-05-14 12:46:25 +02:00
parent fb5a220b46
commit c4c341b3f9

View File

@ -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