Skip to content

Commit ab43962

Browse files
authored
Merge pull request #12979 from LDong-Arm/stack_size_expectation_from_config
stack_size_unification test: set expected stack sizes from config
2 parents e0c7f25 + 0ac17ea commit ab43962

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed

TESTS/mbed_hal/stack_size_unification/main.cpp

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,11 @@ extern osThreadAttr_t _main_thread_attr;
3131
#endif
3232
extern uint32_t mbed_stack_isr_size;
3333

34-
#if !defined(MBED_CONF_RTOS_PRESENT)
35-
#define EXPECTED_ISR_STACK_SIZE (4096)
36-
#else
37-
#define EXPECTED_ISR_STACK_SIZE (1024)
38-
#endif
34+
#define EXPECTED_ISR_STACK_SIZE (MBED_CONF_TARGET_BOOT_STACK_SIZE)
3935

40-
#if defined(TARGET_NUCLEO_F070RB) || defined(TARGET_STM32F072RB) || defined(TARGET_TMPM46B) || defined(TARGET_TMPM066)
41-
#define EXPECTED_MAIN_THREAD_STACK_SIZE (3072)
42-
#else
43-
#define EXPECTED_MAIN_THREAD_STACK_SIZE (4096)
44-
#endif
36+
#define EXPECTED_MAIN_THREAD_STACK_SIZE (MBED_CONF_RTOS_MAIN_THREAD_STACK_SIZE)
4537

46-
#define EXPECTED_USER_THREAD_DEFAULT_STACK_SIZE (4096)
38+
#define EXPECTED_USER_THREAD_DEFAULT_STACK_SIZE (MBED_CONF_RTOS_THREAD_STACK_SIZE)
4739

4840
#if ((MBED_RAM_SIZE - MBED_BOOT_STACK_SIZE) <= (EXPECTED_MAIN_THREAD_STACK_SIZE + EXPECTED_ISR_STACK_SIZE))
4941
#error [NOT_SUPPORTED] Insufficient stack for staci_size_unification tests

rtos/source/TARGET_CORTEX/mbed_lib.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@
7676
"STM32F072RB": {
7777
"main-thread-stack-size": 3072
7878
},
79+
"TMPM46B": {
80+
"main-thread-stack-size": 3072
81+
},
7982
"NUVOTON": {
8083
"idle-thread-stack-size-debug-extra": 512
8184
}

targets/TARGET_TOSHIBA/mbed_rtx.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@
2525
#ifndef INITIAL_SP
2626
#define INITIAL_SP (0x20080000UL)
2727
#endif
28-
#ifdef MBED_CONF_RTOS_MAIN_THREAD_STACK_SIZE
29-
#undef MBED_CONF_RTOS_MAIN_THREAD_STACK_SIZE
30-
#endif
31-
#define MBED_CONF_RTOS_MAIN_THREAD_STACK_SIZE 3072
3228

3329
#endif
3430

0 commit comments

Comments
 (0)