Merge pull request #7674 from jepler/m7-bootloader-reset

use right DBL_TAP_REG when resetting to bootloader
This commit is contained in:
Scott Shawcroft 2023-03-03 13:44:22 -08:00 committed by GitHub
commit 8a10069995
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 3 deletions

View File

@ -39,8 +39,6 @@
#include "supervisor/shared/safe_mode.h"
#include "supervisor/shared/translate/translate.h"
#define DBL_TAP_REG SNVS->LPGPR[3]
void common_hal_mcu_delay_us(uint32_t delay) {
mp_hal_delay_us(delay);
}

View File

@ -33,6 +33,7 @@
#include "py/mpconfig.h"
// Copied from inc/uf2.h in https://github.com/Microsoft/uf2-samd21
#define DBL_TAP_REG SNVS->LPGPR[3]
#define DBL_TAP_MAGIC 0xf01669ef // Randomly selected, adjusted to have first and last bit set
#define DBL_TAP_MAGIC_QUICK_BOOT 0xf02669ef

View File

@ -301,7 +301,7 @@ void reset_port(void) {
}
void reset_to_bootloader(void) {
SNVS->LPGPR[0] = DBL_TAP_MAGIC;
DBL_TAP_REG = DBL_TAP_MAGIC;
reset();
}