Skip to content

Commit 84dc8d2

Browse files
djiatsaf-stjhedberg
authored andcommitted
soc: st: stm32: add common kconfig symbols for kernel stack size
Provide default values for common kconfig symbols for main, idle and isr stack sizes, which apply on all STM32 MCU families with low RAM memory(less than 8 KiB). These kconfig symbols help reduce kernel sizes to fit within limited RAM. Signed-off-by: Fabrice DJIATSA <[email protected]>
1 parent caae24e commit 84dc8d2

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

soc/st/stm32/Kconfig.defconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,21 @@ config CLOCK_CONTROL
2020
config CORTEX_M_SYSTICK
2121
default n if STM32_LPTIM_TIMER
2222

23+
# Reduce kernel stack sizes to fit MCUs with 8 KiB RAM or less
24+
config MAIN_STACK_SIZE
25+
default 320 if SRAM_SIZE <= 2
26+
default 512 if SRAM_SIZE <= 4
27+
default 640 if SRAM_SIZE <= 8
28+
29+
config IDLE_STACK_SIZE
30+
default 100 if SRAM_SIZE <= 2
31+
default 150 if SRAM_SIZE <= 4
32+
default 200 if SRAM_SIZE <= 8
33+
34+
config ISR_STACK_SIZE
35+
default 256 if SRAM_SIZE <= 2
36+
default 512 if SRAM_SIZE <= 8
37+
2338
DT_STM32_RCC_PATH := $(dt_nodelabel_path,rcc)
2439
DT_STM32_RCC_CLOCK_FREQ := $(dt_node_int_prop_int,$(DT_STM32_RCC_PATH),clock-frequency)
2540

0 commit comments

Comments
 (0)