From 4ecd99f6a4b7de8575d8fa6f8ec6f6e6d7fd521d Mon Sep 17 00:00:00 2001 From: Lingkai Dong Date: Fri, 15 May 2020 14:42:27 +0100 Subject: [PATCH 1/2] stack_size_unification test: set expected stack sizes from config --- TESTS/mbed_hal/stack_size_unification/main.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/TESTS/mbed_hal/stack_size_unification/main.cpp b/TESTS/mbed_hal/stack_size_unification/main.cpp index 912630e399..23c84a4e7d 100644 --- a/TESTS/mbed_hal/stack_size_unification/main.cpp +++ b/TESTS/mbed_hal/stack_size_unification/main.cpp @@ -31,19 +31,11 @@ extern osThreadAttr_t _main_thread_attr; #endif extern uint32_t mbed_stack_isr_size; -#if !defined(MBED_CONF_RTOS_PRESENT) -#define EXPECTED_ISR_STACK_SIZE (4096) -#else -#define EXPECTED_ISR_STACK_SIZE (1024) -#endif +#define EXPECTED_ISR_STACK_SIZE (MBED_CONF_TARGET_BOOT_STACK_SIZE) -#if defined(TARGET_NUCLEO_F070RB) || defined(TARGET_STM32F072RB) || defined(TARGET_TMPM46B) || defined(TARGET_TMPM066) -#define EXPECTED_MAIN_THREAD_STACK_SIZE (3072) -#else -#define EXPECTED_MAIN_THREAD_STACK_SIZE (4096) -#endif +#define EXPECTED_MAIN_THREAD_STACK_SIZE (MBED_CONF_RTOS_MAIN_THREAD_STACK_SIZE) -#define EXPECTED_USER_THREAD_DEFAULT_STACK_SIZE (4096) +#define EXPECTED_USER_THREAD_DEFAULT_STACK_SIZE (MBED_CONF_RTOS_THREAD_STACK_SIZE) #if ((MBED_RAM_SIZE - MBED_BOOT_STACK_SIZE) <= (EXPECTED_MAIN_THREAD_STACK_SIZE + EXPECTED_ISR_STACK_SIZE)) #error [NOT_SUPPORTED] Insufficient stack for staci_size_unification tests From 0ac17eaea8aba3bfde4e4a9db765f72af24fa390 Mon Sep 17 00:00:00 2001 From: Lingkai Dong Date: Fri, 15 May 2020 15:10:41 +0100 Subject: [PATCH 2/2] Define MBED_CONF_RTOS_MAIN_THREAD_STACK_SIZE properly in rtos mbed_lib.json --- rtos/source/TARGET_CORTEX/mbed_lib.json | 3 +++ targets/TARGET_TOSHIBA/mbed_rtx.h | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/rtos/source/TARGET_CORTEX/mbed_lib.json b/rtos/source/TARGET_CORTEX/mbed_lib.json index ed275722d8..8fe9e42620 100644 --- a/rtos/source/TARGET_CORTEX/mbed_lib.json +++ b/rtos/source/TARGET_CORTEX/mbed_lib.json @@ -76,6 +76,9 @@ "STM32F072RB": { "main-thread-stack-size": 3072 }, + "TMPM46B": { + "main-thread-stack-size": 3072 + }, "NUVOTON": { "idle-thread-stack-size-debug-extra": 512 } diff --git a/targets/TARGET_TOSHIBA/mbed_rtx.h b/targets/TARGET_TOSHIBA/mbed_rtx.h index 2835015067..2110efe8de 100644 --- a/targets/TARGET_TOSHIBA/mbed_rtx.h +++ b/targets/TARGET_TOSHIBA/mbed_rtx.h @@ -25,10 +25,6 @@ #ifndef INITIAL_SP #define INITIAL_SP (0x20080000UL) #endif -#ifdef MBED_CONF_RTOS_MAIN_THREAD_STACK_SIZE -#undef MBED_CONF_RTOS_MAIN_THREAD_STACK_SIZE -#endif -#define MBED_CONF_RTOS_MAIN_THREAD_STACK_SIZE 3072 #endif