From 2f30aaaf0676b533a520094e29c626d59a75f850 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Thu, 25 Jun 2020 13:14:59 +0200 Subject: [PATCH 1/2] cpu/cortexm_common: use mpu stack guard if DEVELHELP is enabled --- cpu/cortexm_common/Makefile.dep | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cpu/cortexm_common/Makefile.dep b/cpu/cortexm_common/Makefile.dep index 3b3c0bc9fe..472b903407 100644 --- a/cpu/cortexm_common/Makefile.dep +++ b/cpu/cortexm_common/Makefile.dep @@ -18,3 +18,8 @@ FEATURES_OPTIONAL += cortexm_fpu ifneq (,$(filter cortexm_fpu,$(FEATURES_USED))) DEFAULT_MODULE += cortexm_fpu endif + +# Enable the MPU stack guard if develhelp is enabled +ifeq (1, $(DEVELHELP)) + FEATURES_OPTIONAL += cortexm_mpu +endif From 43d6c4147a8034a1a115a061a1b8ca0705c86222 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Thu, 25 Jun 2020 15:57:55 +0200 Subject: [PATCH 2/2] features_modules: cortexm_mpu -> mpu_stack_guard --- makefiles/features_modules.inc.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/makefiles/features_modules.inc.mk b/makefiles/features_modules.inc.mk index 8a8bcbff76..4ff401c1a0 100644 --- a/makefiles/features_modules.inc.mk +++ b/makefiles/features_modules.inc.mk @@ -33,3 +33,8 @@ USEMODULE += $(filter cortexm_svc, $(FEATURES_USED)) ifeq (, $(filter no_idle_thread, $(FEATURES_USED))) USEMODULE += core_idle_thread endif + +# use mpu_stack_guard if the feature is used +ifneq (,$(filter cortexm_mpu,$(FEATURES_USED))) + USEMODULE += mpu_stack_guard +endif