Add an mcu_reset impl for the kiibohd bootloader. (#25963)

* Fixes resetting and split watchdog on the Ergodox Infinity.
This commit is contained in:
Dominic Clifton
2026-03-28 03:31:07 +01:00
committed by GitHub
parent a20facf8ec
commit 3d0ccbb1d5
+18 -1
View File
@@ -30,4 +30,21 @@ __attribute__((weak)) void bootloader_jump(void) {
// request reset
SCB->AIRCR = SCB_AIRCR_VECTKEY_WRITEMAGIC | SCB_AIRCR_SYSRESETREQ_Msk;
}
__attribute__((weak)) void mcu_reset(void) {}
__attribute__((weak)) void mcu_reset(void) {
/* Ensure all outstanding memory operations complete */
__DSB();
__ISB();
/* Request system reset (preserve PRIGROUP) */
uint32_t aircr = SCB->AIRCR;
aircr &= ~SCB_AIRCR_VECTKEY_Msk;
aircr |= SCB_AIRCR_VECTKEY_WRITEMAGIC;
aircr |= SCB_AIRCR_SYSRESETREQ_Msk;
SCB->AIRCR = aircr;
/* Wait for reset to occur */
while (true) {
__NOP();
}
}