From ec0d170176c3efeb220811b0f38467c3621f45e8 Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Wed, 13 Feb 2019 13:06:53 +0100 Subject: [PATCH] Fixed bug in do_boot: Don't use stack if we are moving SP --- src/wolfboot.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wolfboot.c b/src/wolfboot.c index 33deb708..0f68d031 100644 --- a/src/wolfboot.c +++ b/src/wolfboot.c @@ -76,17 +76,17 @@ void isr_empty(void) * - Call the application entry point * */ +static void *app_entry; +static uint32_t app_end_stack; + void do_boot(const uint32_t *app_offset) { - const uint32_t * const app_IV = (const uint32_t *)app_offset; - void *app_entry; - uint32_t app_end_stack; #ifndef NO_VTOR /* Disable interrupts */ asm volatile("cpsid i"); /* Update IV */ - VTOR = ((uint32_t)app_IV); + VTOR = ((uint32_t)app_offset); #endif /* Get stack pointer, entry point */