From fdd5cbe20271634dc9ba4424ae40f1d11332cdf2 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Fri, 24 Aug 2018 17:06:05 +0200 Subject: [PATCH] setup: disable SYSCFG registers --- setup.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/setup.c b/setup.c index 0ab33badb..d0853db69 100644 --- a/setup.c +++ b/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;