From 14233fcc268f2d16192657420f7ac5df11b1056d Mon Sep 17 00:00:00 2001 From: mcudev <29890609+mcudev@users.noreply.github.com> Date: Mon, 9 Apr 2018 05:16:38 -0400 Subject: [PATCH] mpu_config: depend on MEMORY_PROTECT --- setup.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.c b/setup.c index f78c8ec61..15d497b4a 100644 --- a/setup.c +++ b/setup.c @@ -163,6 +163,7 @@ void setupApp(void) // Never use in bootloader! Disables access to PPB (including MPU, NVIC, SCB) void mpu_config(void) { +#if MEMORY_PROTECT // Disable MPU MPU_CTRL = 0; @@ -206,4 +207,5 @@ void mpu_config(void) // Switch to unprivileged software execution to prevent access to MPU set_mode_unprivileged(); +#endif }