Skip to content

Commit

Permalink
setup: disable SYSCFG registers
Browse files Browse the repository at this point in the history
  • Loading branch information
prusnak committed Aug 27, 2018
1 parent c82ce39 commit fdd5cbe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion setup.c
Expand Up @@ -196,9 +196,13 @@ void mpu_config(void)
// Peripherals (0x50000000 - 0x5007ffff, read-write, execute never)
MPU_RBAR = 0x50000000 | MPU_RBAR_VALID | (6 << MPU_RBAR_REGION_LSB);
MPU_RASR = MPU_RASR_ENABLE | MPU_RASR_ATTR_PERIPH | MPU_RASR_SIZE_512KB | MPU_RASR_ATTR_AP_PRW_URW | MPU_RASR_ATTR_XN;
// SYSCFG_* registers are disabled
// (0x40013800 - 0x40013BFF, read-only, execute never)
MPU_RBAR = 0x40013800 | MPU_RBAR_VALID | (7 << MPU_RBAR_REGION_LSB);
MPU_RASR = MPU_RASR_ENABLE | MPU_RASR_ATTR_PERIPH | MPU_RASR_SIZE_1KB | MPU_RASR_ATTR_AP_PRO_URO | MPU_RASR_ATTR_XN;

// Enable MPU
MPU_CTRL = MPU_CTRL_ENABLE;
MPU_CTRL = MPU_CTRL_ENABLE | MPU_CTRL_HFNMIENA;

// Enable memory fault handler
SCB_SHCSR |= SCB_SHCSR_MEMFAULTENA;
Expand Down

0 comments on commit fdd5cbe

Please sign in to comment.