|
|
|
@ -27,6 +27,7 @@
|
|
|
|
|
#if !EMULATOR
|
|
|
|
|
#include <libopencm3/cm3/scb.h>
|
|
|
|
|
#include <libopencm3/cm3/vector.h>
|
|
|
|
|
#include "timer.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
// Statement expressions make these macros side-effect safe
|
|
|
|
@ -68,6 +69,7 @@ static inline void __attribute__((noreturn)) jump_to_firmware(const vector_table
|
|
|
|
|
// Set stack pointer
|
|
|
|
|
__asm__ volatile("msr msp, %0" :: "r" (vector_table->initial_sp_value));
|
|
|
|
|
} else { // untrusted firmware
|
|
|
|
|
timer_init();
|
|
|
|
|
mpu_config_firmware(); // * configure MPU for the firmware
|
|
|
|
|
__asm__ volatile("msr msp, %0" :: "r" (_stack));
|
|
|
|
|
}
|
|
|
|
|