Skip to content

Change stack sizes of threads used in tests. GR_LYCHEE failing CI #11417

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions TESTS/mbed_platform/stats_cpu/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@ using namespace utest::v1;

DigitalOut led1(LED1);

// Targets with these cores have their RAM enough size to create threads with bigger stacks
#if defined(__CORTEX_A9) || defined(__CORTEX_M23) || defined(__CORTEX_M33) || defined(__CORTEX_M7)
#define MAX_THREAD_STACK 512
#else
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the link between core and memory size....?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Targets with these cores have their RAM enough size.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment above stating this assumption.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

#define MAX_THREAD_STACK 384
#endif

#define SAMPLE_TIME 1000 // msec
#define LOOP_TIME 2000 // msec

Expand Down
12 changes: 4 additions & 8 deletions TESTS/mbedmicro-rtos-mbed/threads/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,14 @@
#else

#define THREAD_STACK_SIZE 512
#if defined(__CORTEX_A9)
#if defined(__CORTEX_A9) || defined(__CORTEX_M23) || defined(__CORTEX_M33) || defined(TARGET_ARM_FM) || defined(TARGET_CY8CKIT_062_WIFI_BT_PSA)
#define PARALLEL_THREAD_STACK_SIZE 512
#elif defined(__CORTEX_M23) || defined(__CORTEX_M33)
#define PARALLEL_THREAD_STACK_SIZE 512
#elif defined(TARGET_ARM_FM)
#define PARALLEL_THREAD_STACK_SIZE 512
#elif defined(TARGET_CY8CKIT_062_WIFI_BT_PSA)
#define PARALLEL_THREAD_STACK_SIZE 512
#define CHILD_THREAD_STACK_SIZE 512
#else
#define PARALLEL_THREAD_STACK_SIZE 384
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we get PARALLEL_THREAD_STACK_SIZE fixed to 512? I think in some case some small target would not fit final compiled the images. GR_LYCHEE is an A9 target, maybe we need to make the macro defines as well in the stats_cpu tests

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could, but i tried to remove too many #if statements as it was working on STM32F070RB and the size of the stack was reduced to make it pass on this target.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we get PARALLEL_THREAD_STACK_SIZE fixed to 512? I think in some case some small target would not fit final compiled the images. GR_LYCHEE is an A9 target, maybe we need to make the macro defines as well in the stats_cpu tests

Such targets should be optimized in the way as it was done here:
f24ac50
37bfc9e

#endif
#define CHILD_THREAD_STACK_SIZE 384
#endif


using namespace utest::v1;

Expand Down