Permalink
Browse files

setup: disable SYSCFG registers

  • Loading branch information...
prusnak committed Aug 24, 2018
1 parent c82ce39 commit fdd5cbe20271634dc9ba4424ae40f1d11332cdf2
Showing with 5 additions and 1 deletion.
  1. +5 −1 setup.c
@@ -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;

0 comments on commit fdd5cbe

Please sign in to comment.