Skip to content

Commit 22906ac

Browse files
authored
Merge pull request #4442 from jepler/m7-reboot-bootloader
mimxrt1011: Fix reset-to-bootloader
2 parents 3fcb6b2 + 06743d9 commit 22906ac

File tree

1 file changed

+4
-2
lines changed
  • ports/mimxrt10xx/common-hal/microcontroller

1 file changed

+4
-2
lines changed

ports/mimxrt10xx/common-hal/microcontroller/__init__.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
#include "supervisor/shared/safe_mode.h"
4040
#include "supervisor/shared/translate.h"
4141

42+
#define DBL_TAP_REG SNVS->LPGPR[3]
43+
4244
void common_hal_mcu_delay_us(uint32_t delay) {
4345
mp_hal_delay_us(delay);
4446
}
@@ -72,10 +74,10 @@ void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) {
7274
}
7375
// Pretend to be the first of the two reset presses needed to enter the
7476
// bootloader. That way one reset will end in the bootloader.
75-
SNVS->LPGPR[0] = DBL_TAP_MAGIC;
77+
DBL_TAP_REG = DBL_TAP_MAGIC;
7678
} else {
7779
// Set up the default.
78-
SNVS->LPGPR[0] = DBL_TAP_MAGIC_QUICK_BOOT;
80+
DBL_TAP_REG = DBL_TAP_MAGIC_QUICK_BOOT;
7981
}
8082
if (runmode == RUNMODE_SAFE_MODE) {
8183
safe_mode_on_next_reset(PROGRAMMATIC_SAFE_MODE);

0 commit comments

Comments
 (0)