Skip to content

Commit fdd5cbe

Browse files
committed
setup: disable SYSCFG registers
1 parent c82ce39 commit fdd5cbe

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

setup.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,13 @@ void mpu_config(void)
196196
// Peripherals (0x50000000 - 0x5007ffff, read-write, execute never)
197197
MPU_RBAR = 0x50000000 | MPU_RBAR_VALID | (6 << MPU_RBAR_REGION_LSB);
198198
MPU_RASR = MPU_RASR_ENABLE | MPU_RASR_ATTR_PERIPH | MPU_RASR_SIZE_512KB | MPU_RASR_ATTR_AP_PRW_URW | MPU_RASR_ATTR_XN;
199+
// SYSCFG_* registers are disabled
200+
// (0x40013800 - 0x40013BFF, read-only, execute never)
201+
MPU_RBAR = 0x40013800 | MPU_RBAR_VALID | (7 << MPU_RBAR_REGION_LSB);
202+
MPU_RASR = MPU_RASR_ENABLE | MPU_RASR_ATTR_PERIPH | MPU_RASR_SIZE_1KB | MPU_RASR_ATTR_AP_PRO_URO | MPU_RASR_ATTR_XN;
199203

200204
// Enable MPU
201-
MPU_CTRL = MPU_CTRL_ENABLE;
205+
MPU_CTRL = MPU_CTRL_ENABLE | MPU_CTRL_HFNMIENA;
202206

203207
// Enable memory fault handler
204208
SCB_SHCSR |= SCB_SHCSR_MEMFAULTENA;

0 commit comments

Comments
 (0)