stmhal/modmachine: Make machine.bootloader() work when MPU is enabled.

This commit is contained in:
Damien George 2017-08-23 16:58:48 +10:00
parent 1f78e7a431
commit 49316b864b
1 changed files with 5 additions and 0 deletions

View File

@ -202,6 +202,11 @@ STATIC NORETURN mp_obj_t machine_bootloader(void) {
HAL_RCC_DeInit();
HAL_DeInit();
#if (__MPU_PRESENT == 1)
// MPU must be disabled for bootloader to function correctly
HAL_MPU_Disable();
#endif
#if defined(MCU_SERIES_F7)
// arm-none-eabi-gcc 4.9.0 does not correctly inline this
// MSP function, so we write it out explicitly here.