diff options
author | Damien George <damien.p.george@gmail.com> | 2014-06-08 14:01:43 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-06-08 14:01:43 +0100 |
commit | 57b4dfa9c991b1101b119b62f80051c66915087e (patch) | |
tree | f70d23ee616d54af8e8a3714a31453155556e20d | |
parent | 26a95ae1e7470bafbb616000c98b5b2c729ca510 (diff) | |
download | micropython-57b4dfa9c991b1101b119b62f80051c66915087e.tar.gz micropython-57b4dfa9c991b1101b119b62f80051c66915087e.zip |
stmhal: Fix pyb.bootloader so it works for gcc-4.9.0.
See PR #618.
-rw-r--r-- | stmhal/modpyb.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/stmhal/modpyb.c b/stmhal/modpyb.c index 7ec25038bf..44bcba1d79 100644 --- a/stmhal/modpyb.c +++ b/stmhal/modpyb.c @@ -72,7 +72,12 @@ STATIC NORETURN mp_obj_t pyb_bootloader(void) { HAL_DeInit(); __HAL_REMAPMEMORY_SYSTEMFLASH(); - __set_MSP(*((uint32_t*) 0x00000000)); + + // arm-none-eabi-gcc 4.9.0 does not correctly inline this + // MSP function, so we write it out explicitly here. + //__set_MSP(*((uint32_t*) 0x00000000)); + __ASM volatile ("movs r3, #0\nldr r3, [r3, #0]\nMSR msp, r3\n" : : : "r3", "sp"); + ((void (*)(void)) *((uint32_t*) 0x00000004))(); while (1); |