summaryrefslogtreecommitdiff
path: root/chip/stm32/dfu_bootmanager_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'chip/stm32/dfu_bootmanager_main.c')
-rw-r--r--chip/stm32/dfu_bootmanager_main.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/chip/stm32/dfu_bootmanager_main.c b/chip/stm32/dfu_bootmanager_main.c
index bad07c23b7..cec747e762 100644
--- a/chip/stm32/dfu_bootmanager_main.c
+++ b/chip/stm32/dfu_bootmanager_main.c
@@ -51,7 +51,10 @@
*/
static int rw_is_empty(void)
{
- return crec_flash_is_erased(CONFIG_RW_MEM_OFF, 8);
+ if (IS_ENABLED(CONFIG_FLASH_CROS))
+ return crec_flash_is_erased(CONFIG_RW_MEM_OFF, 8);
+ /* No flash support, we cannot tell. Assume not empty. */
+ return 0;
}
/*
@@ -131,6 +134,11 @@ static void jump_to_arm_reset_vector(uint32_t addr)
/* Load stack pointer */
"ldr r0, [r1, 0]\n"
"msr msp, r0\n"
+ /*
+ * Memory barrier to ensure subsequent instructions uses modified
+ * stack pointer.
+ */
+ "isb\n"
/* Load reset vector */
"ldr r0, [r1, 4]\n"
/* Jump without saving return address (would modify msp) */