From 25769e3fffd3796a4514277a2e1474bd0a290116 Mon Sep 17 00:00:00 2001 From: Carlo Caione Date: Mon, 20 Jan 2020 14:14:06 +0100 Subject: [PATCH] samples: cmsis_rtos_v1: Grow stack size to the maximum allowed Some architectures require more space on the stack when running samples and tests while the philosopher test (cmsis_rtos_v1) is still using a fixed-size stack size. Since the test is going to use CMSIS v1 we cannot directly use CONFIG_TEST_EXTRA_STACKSIZE to grow the stack size because the extra space allocated can excess the maximum size allowed by CMSIS and defined by CONFIG_CMSIS_THREAD_MAX_STACK_SIZE, causing the sample to halt on the assertion (thread_def->stacksize <= CONFIG_CMSIS_THREAD_MAX_STACK_SIZE). To avoid this problem (and align the test to what has been already done on the philosopher test using CMSISv2) we set the stack size to the maximum allowed size of CONFIG_CMSIS_THREAD_MAX_STACK_SIZE. Signed-off-by: Carlo Caione --- samples/portability/cmsis_rtos_v1/philosophers/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/portability/cmsis_rtos_v1/philosophers/src/main.c b/samples/portability/cmsis_rtos_v1/philosophers/src/main.c index e5d83c1dcf0..e82fd698480 100644 --- a/samples/portability/cmsis_rtos_v1/philosophers/src/main.c +++ b/samples/portability/cmsis_rtos_v1/philosophers/src/main.c @@ -72,7 +72,7 @@ osSemaphoreId forks[NUM_PHIL]; #define fork(x) (forks[x]) -#define STACK_SIZE 512 +#define STACK_SIZE CONFIG_CMSIS_THREAD_MAX_STACK_SIZE #if DEBUG_PRINTF #define PR_DEBUG printk