Skip to content
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

Merged
merged 9 commits into from
Aug 11, 2016

Conversation

c1728p9
Copy link
Contributor

@c1728p9 c1728p9 commented Aug 9, 2016

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.

c1728p9 and others added 9 commits August 9, 2016 13:44
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.
@c1728p9
Copy link
Contributor Author

c1728p9 commented Aug 9, 2016

/morph test

@c1728p9
Copy link
Contributor Author

c1728p9 commented Aug 9, 2016

@mbed-bot: TEST

HOST_OSES=windows
BUILD_TOOLCHAINS=GCC_ARM,ARM,IAR
TARGETS=K64F,NRF51_DK,NRF51_MICROBIT,NUCLEO_F411RE

@mbed-bot
Copy link

mbed-bot commented Aug 9, 2016

[Build 790]
SUCCESS: Building succeeded and tests were run! Be sure to check the test results

@mbed-bot
Copy link

mbed-bot commented Aug 9, 2016

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 623

Test failed!

@bridadan
Copy link
Contributor

bridadan commented Aug 9, 2016

/morph test

@mbed-bot
Copy link

mbed-bot commented Aug 9, 2016

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 624

All builds and test passed!

@0xc0170 0xc0170 assigned 0xc0170 and unassigned 0xc0170 Aug 10, 2016
@sg-
Copy link
Contributor

sg- commented Aug 11, 2016

LGTM 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants