-
Notifications
You must be signed in to change notification settings - Fork 3k
Musca targets: align and clean up configurations #14467
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
Conversation
@LDong-Arm, thank you for your changes. |
@ARMmbed/mbed-os-core This PR was created some days ago, but should be a quick one anyway. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still curious about the values. Looks like there's memory limit .
User stack size not sufficient but also we need to limit libspace allocation for threads?
Both TF-M itself as well as its tests rely on the Automatic Dynamic RAM allocation capability of CMSIS-RTOSv2. We should be able to be more conservative here in mbed-os and only enable what's needed for TF-M to operate. We don't need all this RAM wasted in the default general-purpose case (yes wasted, because the memory is dedicated to these memory pools and not available to any other use case; due to how TF-M's os_wrapper is designed and implemented for CMSIS-RTOSv2, we can't easily switch to using heap-allocated objects-- although maybe now that's possible if additional hooks [like "free thread"] have been added since our first port to Mbed OS). The mbed-os-tf-m-regression-tests test application can use a different configuration, to provide enough RTOS objects to run the tests; we don't need to copy this for the default Mbed OS configuration.
The reason we reduced the stack size available for dynamically created threads was because, given the number of threads the TF-M regression tests employ, we'd run out of RAM if we used the default amount. |
The TF-M secure binary has a fixed baud rate of 115200. Having a different baud rate on the non-secure side results in broken serial outputs.
On Armv8 targets, the PSA interface on the non-secure side only requires mutexes, thus we remove other RTOS overrides to reduce memory usage in general use cases. TF-M and PSA test applications require more RTOS resources, and they have their own configurations defined in mbed-os-tf-m-regression-tests. This commit also adds missing configuration for ARM_MUSCA_B1.
@Patater Completely agree. For a general use case (incl. mbed-os-example-psa), only mutexes are needed by the PSA non-secure interface on Armv8 targets. I've removed all the other RTOS overrides, and mbed-os-tf-m-regressions-tests enables more resources in its own |
Ready for review again. |
CI started |
Jenkins CI Test : ✔️ SUCCESSBuild Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & ArtifactsCLICK for Detailed Summary
|
Summary of changes
Preceding PR: #14455
This PR fixes the out of memory crash when running mbed-os-example-blinky on Musca B1:
This PR enables mutexes on Musca B1 to fix this issue, and removes unneeded RTOS overrides from Musca S1.
Also, change the default baud rate to 115200 (aligned with the TF-M secure image, and Musca S1) to avoid broken text on serial when transitioning between secure and non-secure execution.
Impact of changes
Migration actions required
Documentation
None.
Pull request type
Test results
Now Greentea tests can run on Musca B1.
Reviewers
@ARMmbed/mbed-os-security