Skip to content

Commit

Permalink
disable/reset the MPU leaving openblt
Browse files Browse the repository at this point in the history
  • Loading branch information
mck1117 committed Feb 17, 2025
1 parent 553e42f commit 02440ff
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions firmware/bootloader/openblt_chibios/openblt_chibios.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ void CpuStartUserProgram(void)
#endif
/* reset the HAL */
chSysDisable();

// Clear all MPU settings, as they may immediately cause a fault after the jump to firmware
mpuDisable();
for (int i = 0; i < 8; i++) {
mpuConfigureRegion(i, 0, 0);
}
__DSB();
__ISB();

/* reset the timer */
TimerReset();
/* remap user program's vector table */
Expand Down

0 comments on commit 02440ff

Please sign in to comment.