-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Main thread stack checking alt impl #2402
Main thread stack checking alt impl #2402
Conversation
Set well defined limits for the heap and configure GCC and ARMCC to correctly check these. IAR already correctly checked its heap. This also statically declares the main thread stack so the linker is responsible for its placement.
Decrease the main stack size for the nrf51 so there is more heap space available.
When new or new[] fails to allocate space trigger an error.
With the latest K64F linker file the initial stack is out of sync with INITIAL_SP when uVisor is not present. This patch removes the incorrect declaration.
Since the heap and stack are no longer shared, stack checking on the main thread can be turned back on. This allows stack overflows on the main thread to be caught quickly.
Test the following components of the heap and stacks: -Heap and interrupt stack are at the expected locations -Entire heap can be used -Heap limit is properly enforced and returns NULL when out of of memory
Decrease the interrupt stack of the NUC472 from 12KB to 8KB. This frees up enough space to allow the core tests to run.
Set the initial stack pointer to the end of ram so it matches INITIAL_SP defined in RTX_CM_lib.h.
The config store tests use more than 2K of the interrupt stack, causing an overflow. This patch bumps the K64F interrupt stack size to 4K for ARMCC and GCC. The IAR interrupt stack is left untouched since it is 32K.
/morph test |
@mbed-bot: TEST HOST_OSES=windows |
[Build 790] |
Result: FAILUREYour command has finished executing! Here's what you wrote!
Outputmbed Build Number: 623 Test failed! |
/morph test |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
Outputmbed Build Number: 624 All builds and test passed! |
LGTM 👍 |
This is an alternative implementation of #2367 which statically defines the main thread stack rather than placing it at runtime in the heap region. This makes the memory layout simpler since the main thread is treated the same for GCC ARMCC and IAR. The downside to this is that due to the K22F's two region memory, it can no longer fit nanostack for GCC_ARM. If RAM0 and RAM1 could be combined into a single region this would not be a problem.