Skip to content

mimxrt1011: Fix reset-to-bootloader #4442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions ports/mimxrt10xx/common-hal/microcontroller/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
#include "supervisor/shared/safe_mode.h"
#include "supervisor/shared/translate.h"

#define DBL_TAP_REG SNVS->LPGPR[3]

void common_hal_mcu_delay_us(uint32_t delay) {
mp_hal_delay_us(delay);
}
Expand Down Expand Up @@ -72,10 +74,10 @@ void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) {
}
// Pretend to be the first of the two reset presses needed to enter the
// bootloader. That way one reset will end in the bootloader.
SNVS->LPGPR[0] = DBL_TAP_MAGIC;
DBL_TAP_REG = DBL_TAP_MAGIC;
} else {
// Set up the default.
SNVS->LPGPR[0] = DBL_TAP_MAGIC_QUICK_BOOT;
DBL_TAP_REG = DBL_TAP_MAGIC_QUICK_BOOT;
}
if (runmode == RUNMODE_SAFE_MODE) {
safe_mode_on_next_reset(PROGRAMMATIC_SAFE_MODE);
Expand Down