feat(legacy): reboot to bootloader supervisor call constants

pull/1461/head
Ondrej Mikle 3 years ago committed by Pavol Rusnak
parent 65aa3b49d9
commit 1699d33cfa
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

@ -64,7 +64,7 @@ static uint32_t svhandler_flash_lock(void) {
}
static void __attribute__((noreturn)) svhandler_reboot_to_bootloader(void) {
__asm__ __volatile__("ldr r12, =0x55aa55aa");
*RETURN_TO_BOOTLOADER_FLAG_ADDR = RETURN_TO_BOOTLOADER_FLAG;
scb_reset_system();
}

@ -31,6 +31,9 @@
#define SVC_TIMER_MS 4
#define SVC_REBOOT_TO_BOOTLOADER 5
#define RETURN_TO_BOOTLOADER_FLAG_ADDR ((uint32_t *)0x20010000)
#define RETURN_TO_BOOTLOADER_FLAG 0x11
/* Unlocks flash. This function needs to be called before programming
* or erasing. Multiple calls of flash_program and flash_erase can
* follow and should be completed with flash_lock().
@ -73,7 +76,7 @@ inline uint32_t svc_timer_ms(void) {
}
/* Reboot to bootloader.
* Sets a flag in register and reboots. When bootloader runs, it will recognize
* Sets a flag in memory and reboots. When bootloader runs, it will recognize
* flag and won't run firmware, but enter bootloader mode.
*/
inline void svc_reboot_to_bootloader(void) {

Loading…
Cancel
Save