1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-08 22:40:59 +00:00

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

This commit is contained in:
Pavol Rusnak 2021-05-20 16:40:14 +02:00
parent 8c6b93e0bd
commit 4f1274c9c4

View File

@ -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)
;