1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #12312 from kaspar030/cortexm_dont_disable_irq_in_cpu_jump_to_image

cpu/cortexm: don't disable IRQs in cpu_jump_to_image()
This commit is contained in:
Marian Buschsieweke 2019-10-08 11:20:06 +02:00 committed by GitHub
commit d749e2de5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -199,8 +199,19 @@ static inline void cortexm_isr_end(void)
*/
static inline void cpu_jump_to_image(uint32_t image_address)
{
/* Disable IRQ */
__disable_irq();
/* On Cortex-M platforms, the flash begins with:
*
* 1. 4 byte pointer to stack to be used at startup
* 2. 4 byte pointer to the reset vector function
*
* On powerup, the CPU sets the stack pointer and starts executing the
* reset vector.
*
* We're doing the same here, but we'd like to start at image_address.
*
* This function must be called while executing from MSP (Master Stack
* Pointer).
*/
/* set MSP */
__set_MSP(*(uint32_t*)image_address);