From ec550d8109d88bdb8152da15854b197108d9725d Mon Sep 17 00:00:00 2001 From: Henrik Brix Andersen Date: Thu, 7 Jan 2021 13:02:12 +0100 Subject: [PATCH] boards: arm: twr_ke18f: only enable HW stack protection if !userspace Only enable hardware stack protection by default on the NXP TWR-K18F development board if userspace is not enabled. The NXP KE1xF SoC has 8 MPU regions, which is insufficient for using HW stack protection and userspace simultaneously. Fixes bc9a498bdfda135e2de3c65fb0d7eeb8bdccbcc0. Signed-off-by: Henrik Brix Andersen --- boards/arm/twr_ke18f/Kconfig.defconfig | 5 +++++ boards/arm/twr_ke18f/twr_ke18f_defconfig | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/boards/arm/twr_ke18f/Kconfig.defconfig b/boards/arm/twr_ke18f/Kconfig.defconfig index 66448b2cb5842..0945fafc4ed99 100644 --- a/boards/arm/twr_ke18f/Kconfig.defconfig +++ b/boards/arm/twr_ke18f/Kconfig.defconfig @@ -22,4 +22,9 @@ config TEMP_KINETIS default y if "$(dt_nodelabel_enabled,adc0)" depends on SENSOR && ADC +# The KE1xF has 8 MPU regions, which is not enough for both HW stack protection +# and userspace. Only enable HW stack protection if userspace is not enabled. +config HW_STACK_PROTECTION + default y if !USERSPACE + endif # BOARD_TWR_KE18F diff --git a/boards/arm/twr_ke18f/twr_ke18f_defconfig b/boards/arm/twr_ke18f/twr_ke18f_defconfig index 31224270089d5..3980435be07b2 100644 --- a/boards/arm/twr_ke18f/twr_ke18f_defconfig +++ b/boards/arm/twr_ke18f/twr_ke18f_defconfig @@ -14,4 +14,3 @@ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=120000000 # Enable MPU CONFIG_ARM_MPU=y -CONFIG_HW_STACK_PROTECTION=y