fix(legacy): set STAY_IN_BOOTLOADER_FLAG before the reboot of intermediate_fw

pull/1626/head
Pavol Rusnak 3 years ago
parent 8c6b93e0bd
commit 4f1274c9c4

@ -31,6 +31,7 @@
#include "oled.h"
#include "rng.h"
#include "setup.h"
#include "supervise.h"
#include "timer.h"
#include "util.h"
@ -86,6 +87,7 @@ static void __attribute__((noinline, section(".data"))) erase_firmware(void) {
void __attribute__((noinline, noreturn, section(".data"))) reboot_device(void) {
__disable_irq();
*STAY_IN_BOOTLOADER_FLAG_ADDR = STAY_IN_BOOTLOADER_FLAG;
SCB_AIRCR = SCB_AIRCR_VECTKEY | SCB_AIRCR_SYSRESETREQ;
while (1)
;

Loading…
Cancel
Save