diff options
| author | Damien George <damien@micropython.org> | 2022-03-17 17:11:03 +1100 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2022-03-22 12:49:00 +1100 |
| commit | a92d45c3df893c845571506afe6fbbfb3e7a85aa (patch) | |
| tree | 85be282cabbe4b8ea87f57367c210c886ee77fa2 | |
| parent | dc91024a7312894997020e57502cccf0ebbca4ff (diff) | |
stm32/mboot: Always check the magic number to enter filesystem loading.
Even if MBOOT_FSLOAD is disabled, mboot should still check for 0x70ad0080
so it can immediately return to the application if this feature is not
enabled. Otherwise mboot will get stuck in DFU mode.
Signed-off-by: Damien George <damien@micropython.org>
| -rw-r--r-- | ports/stm32/mboot/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ports/stm32/mboot/main.c b/ports/stm32/mboot/main.c index ac564d1d0..341cf1817 100644 --- a/ports/stm32/mboot/main.c +++ b/ports/stm32/mboot/main.c @@ -1539,8 +1539,8 @@ enter_bootloader: mboot_pack_init(); #endif - #if MBOOT_FSLOAD if ((initial_r0 & 0xffffff80) == 0x70ad0080) { + #if MBOOT_FSLOAD // Application passed through elements, validate then process them const uint8_t *elem_end = elem_search(ELEM_DATA_START, ELEM_TYPE_END); if (elem_end != NULL && elem_end[-1] == 0) { @@ -1553,11 +1553,11 @@ enter_bootloader: *status_ptr = ret; } } + #endif // Always reset because the application is expecting to resume led_state_all(0); leave_bootloader(); } - #endif dfu_init(); |
