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
Use newlib-nano headers, FreeRTOS _impure_ptr hooks #2126
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
avtolstoy
force-pushed
the
fix/newlib-nano
branch
from
June 10, 2020 13:47
4cf63fc
to
92161e4
Compare
…es_on_context_switch test
avtolstoy
force-pushed
the
fix/newlib-nano
branch
from
June 23, 2020 09:02
92161e4
to
d19dd0e
Compare
sergeuz
approved these changes
Jun 23, 2020
avtolstoy
added
ready to merge
PR has been reviewed and tested
and removed
needs review
labels
Jun 25, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
When building DeviceOS with ARM GCC toolchain, we link with a variant of newlib (an implementation of C standard library) called nano, which has certain trade-offs to reduce the code/RAM size.
In order to support thread-safety for a number of libc functions, we are allocating a so-called reentrant structure for each thread. This is a FreeRTOS feature which we have enabled on all the platforms because we've seen various crashes due to absence of that.
There is currently a number of problems:
_impure_ptr
pointer residing in RAM will not get changed on thread context switches. We need to add hooks into other modules, so that we can do that from the system part with FreeRTOS.Solution
--specs=nano.specs
in CFLAGS now, to ensure that not only we are linking with nano variant of the newlib, but also that we are using the correct include paths when building DeviceOS_impure_ptr
accordingly in all the modulesThis PR also adds appropriate tests to
wiring/no_fixture
and moves SPI tests out of that test suite into a separatewiring/no_fixture_spi
in order to fit 128K on Electron.Steps to Test
wiring/no_fixture
Example App
N/A
References
Completeness