From 3772830176ca17677bd5288d8d48094ccabf279a Mon Sep 17 00:00:00 2001 From: "Peter D. Gray" Date: Mon, 11 Feb 2019 13:46:28 -0500 Subject: [PATCH] Preserve SP during callgate process. Bump copyright, version --- stm32/bootloader/startup.S | 13 ++++++++----- stm32/bootloader/version.h | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/stm32/bootloader/startup.S b/stm32/bootloader/startup.S index 06166c89..dd4337a1 100644 --- a/stm32/bootloader/startup.S +++ b/stm32/bootloader/startup.S @@ -65,9 +65,9 @@ my_version_code: .align 4 - .ascii "(c) Copyright 2018 by Coinkite Inc. \n" + .ascii "(c) Copyright 2018-2019 by Coinkite Inc. \n" .ascii " \n" - .ascii "This space for rent. Just 1BTC/year. \n" + .ascii "This space for rent! Just 2BTC/year. \n" .ascii " \n" // @@ -125,14 +125,17 @@ wipe_loop1: cmp r9, r10 bne wipe_loop1 - // switch to our own stack + // switch to our own stack (but save caller's stack ptr) + mov r10, sp mov sp, r9 + push {r10, lr} // do the real work - push {lr} dispatcher: // just for debuger view bl firewall_dispatch - pop {lr} + + pop {r10, lr} + mov sp, r10 // clear our sram completely movw r9, BL_SRAM_BASE & 0xffff diff --git a/stm32/bootloader/version.h b/stm32/bootloader/version.h index 7eaeec28..51cc2ee3 100644 --- a/stm32/bootloader/version.h +++ b/stm32/bootloader/version.h @@ -6,7 +6,7 @@ #include // Public version number for humans. Lots more version data added by Makefile. -#define RELEASE_VERSION "1.1.0" +#define RELEASE_VERSION "1.2.0" extern const char version_string[];