From 14ed03074e7352cd94c623beb13d0e6344b07547 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Sun, 8 Jan 2017 10:52:59 +0100 Subject: [PATCH 1/6] cpu: lpc2387: make THREAD_STACKSIZE_IDLE configurable --- cpu/lpc2387/include/cpu_conf.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cpu/lpc2387/include/cpu_conf.h b/cpu/lpc2387/include/cpu_conf.h index c6b883e7c4..2a214834d3 100644 --- a/cpu/lpc2387/include/cpu_conf.h +++ b/cpu/lpc2387/include/cpu_conf.h @@ -48,7 +48,9 @@ extern "C" { #define THREAD_STACKSIZE_DEFAULT (1024) #endif +#ifndef THREAD_STACKSIZE_IDLE #define THREAD_STACKSIZE_IDLE (160) +#endif /** @} */ /** @@ -93,7 +95,9 @@ extern "C" { * @brief Stack size used for the interrupt (ISR) stack * @{ */ +#ifndef ISR_STACKSIZE #define ISR_STACKSIZE (400) +#endif /** @} */ /** From 84745365fd0296e5d34844289b6b25904a050c04 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Thu, 10 Jan 2019 11:07:35 +0100 Subject: [PATCH 2/6] cpu: atmega_common: make THREAD_STACKSIZE_IDLE configurable --- cpu/atmega_common/include/cpu_conf.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cpu/atmega_common/include/cpu_conf.h b/cpu/atmega_common/include/cpu_conf.h index 37ede8582f..7e7986137b 100644 --- a/cpu/atmega_common/include/cpu_conf.h +++ b/cpu/atmega_common/include/cpu_conf.h @@ -48,7 +48,9 @@ extern "C" { /* keep THREAD_STACKSIZE_IDLE > THREAD_EXTRA_STACKSIZE_PRINTF * to avoid not printing of debug in interrupts */ +#ifndef THREAD_STACKSIZE_IDLE #define THREAD_STACKSIZE_IDLE (128) +#endif /** @} */ /** From c86ccfcf67957e0a691f012e515902fab32cd3fe Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Thu, 10 Jan 2019 11:10:08 +0100 Subject: [PATCH 3/6] cpu: esp32: make THREAD_STACKSIZE_IDLE/DEFAULT configurable --- cpu/esp32/include/cpu_conf.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cpu/esp32/include/cpu_conf.h b/cpu/esp32/include/cpu_conf.h index bef2de93c1..58f24ba7f8 100644 --- a/cpu/esp32/include/cpu_conf.h +++ b/cpu/esp32/include/cpu_conf.h @@ -38,8 +38,12 @@ extern "C" { * @{ */ #define THREAD_EXTRA_STACKSIZE_PRINTF (1024) +#ifndef THREAD_STACKSIZE_DEFAULT #define THREAD_STACKSIZE_DEFAULT (2048) +#endif +#ifndef THREAD_STACKSIZE_IDLE #define THREAD_STACKSIZE_IDLE (2048) +#endif /** @} */ /** From f88fa2e3f2c862ec929450a6724f623841d97119 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Thu, 10 Jan 2019 11:30:23 +0100 Subject: [PATCH 4/6] tests/minimal: reduce main/idle stacksize --- tests/minimal/Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/minimal/Makefile b/tests/minimal/Makefile index afa80076a9..233f8add8e 100644 --- a/tests/minimal/Makefile +++ b/tests/minimal/Makefile @@ -8,4 +8,9 @@ DISABLE_MODULE += test_utils_interactive_sync USEMODULE += stdio_null +# adjust stack sizes to very small values +ifneq (native,$(BOARD)) + CFLAGS += -DTHREAD_STACKSIZE_MAIN=256 -DTHREAD_STACKSIZE_IDLE=128 +endif + include $(RIOTBASE)/Makefile.include From b2278b64a833870e1f01a8cbeb06b87e90be275b Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Mon, 14 Jan 2019 17:51:35 +0100 Subject: [PATCH 5/6] sys/ps: ignore IST_STACKSIZE if it is == 0 (undefined) --- sys/ps/ps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/ps/ps.c b/sys/ps/ps.c index 3007ebc2a1..c251953cc7 100644 --- a/sys/ps/ps.c +++ b/sys/ps/ps.c @@ -75,7 +75,7 @@ void ps(void) #endif "state"); -#if defined(DEVELHELP) && defined(ISR_STACKSIZE) +#if defined(DEVELHELP) && ISR_STACKSIZE int isr_usage = thread_isr_stack_usage(); void *isr_start = thread_isr_stack_start(); void *isr_sp = thread_isr_stack_pointer(); From b0e7d6abd6d0e57ada82b1f52c8b5de9f7c0aa3d Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Thu, 12 Mar 2020 13:33:59 +0100 Subject: [PATCH 6/6] cpu/atmega32u4: make THREAD_STACKSIZE_IDLE configurable --- cpu/atmega32u4/include/cpu_conf.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cpu/atmega32u4/include/cpu_conf.h b/cpu/atmega32u4/include/cpu_conf.h index 31812c92b1..65c6ea2c3e 100644 --- a/cpu/atmega32u4/include/cpu_conf.h +++ b/cpu/atmega32u4/include/cpu_conf.h @@ -39,7 +39,9 @@ extern "C" { #define THREAD_STACKSIZE_DEFAULT (256) #endif +#ifndef THREAD_STACKSIZE_IDLE #define THREAD_STACKSIZE_IDLE (128) +#endif /** @} */ #ifdef __cplusplus