Skip to content

Commit

Permalink
cpu/cortexm: Use DEVELHELP to add stack guard
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKevinWeiss committed Sep 8, 2021
1 parent 73e3220 commit 636c6c4
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
7 changes: 7 additions & 0 deletions Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,10 @@ config TEST_KCONFIG
This is used during the Kconfig migration to test the module dependency
modelling. Don't change the default value unless you know what you are
doing.

config DEVELHELP
bool "Development Help"
help
Set to enable code in RIOT that does safety checking which might not be
needed in a production environment but helps in the development
process.
12 changes: 11 additions & 1 deletion cpu/cortexm_common/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,20 @@ config HAS_CORTEXM_SVC
help
Indicates that ARM Cortex-M Supervisor Calls are available.

menu "Cortex-M"
depends on TEST_KCONFIG
depends on CPU_CORE_CORTEX_M

config MODULE_CORTEXM_FPU
bool "Cortex-M Floating Point Unit (FPU) support"
default y
depends on HAS_CORTEXM_FPU
depends on TEST_KCONFIG

config MODULE_MPU_STACK_GUARD
bool "Memory Protection Unit (MPU) stack guard"
default y if DEVELHELP
depends on HAS_CORTEXM_MPU

endmenu # Cortex-M

rsource "periph/Kconfig"
5 changes: 5 additions & 0 deletions makefiles/kconfig.mk
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ ifeq (1,$(TEST_KCONFIG))
SHOULD_RUN_KCONFIG := 1
endif

# Expose DEVELHELP to kconfig
ifeq (1,$(DEVELHELP))
RIOT_CONFIG_DEVELHELP ?= y
endif

# export variable to make it visible in other Makefiles
export SHOULD_RUN_KCONFIG

Expand Down

0 comments on commit 636c6c4

Please sign in to comment.