From 3c51257524ba7478cfd8a36ac0c600157e993c90 Mon Sep 17 00:00:00 2001 From: Sarah Marsh Date: Fri, 22 Feb 2019 11:57:30 +0000 Subject: [PATCH] Change MOV to MOVS for M0+ --- platform/mbed_application.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/platform/mbed_application.c b/platform/mbed_application.c index d9ac547cd9..43ffd168f0 100644 --- a/platform/mbed_application.c +++ b/platform/mbed_application.c @@ -161,7 +161,11 @@ static void powerdown_scb(uint32_t vtor) __asm static void start_new_application(void *sp, void *pc) { +#if defined(__CORTEX_M0PLUS) + MOVS R2, #0 +#else MOV R2, #0 +#endif MSR CONTROL, R2 // Switch to main stack MOV SP, R0 MSR PRIMASK, R2 // Enable interrupts @@ -174,7 +178,7 @@ void start_new_application(void *sp, void *pc) { __asm volatile( #if defined(__CORTEX_M0PLUS) - "mov r2, #0 \n" // No MOVW instruction on Cortex-M0+ + "movs r2, #0 \n" // No MOVW instruction on Cortex-M0+ #else "movw r2, #0 \n" // Fail to compile "mov r2, #0" with ARMC6. Replace with MOVW. #endif