-
Notifications
You must be signed in to change notification settings - Fork 3k
rtos: Improve CMSIS-RTOSv2 app compatibility #12736
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
I can see this could be useful. Hmm, I wasn't actually aware of the existing options there following that naming pattern. "app" config options are supposed to be config options for the application, not the OS. The existing ones seem to be written as "if That's weird. Applications should be overriding So can I suggest you ignore the "app" options, and just put them as "rtos" ones, so in rtos/source/TARGET_CORTEX/mbed_lib.json. Set the defaults there as 0, and code like
Not 100% happy with the name |
@Patater @kjbracey-arm |
Is this reffering to if app config present use it otherwise default to rtos config ? Isn't this how config works, set this value in the config in app, |
An app should be flipping the default for system components by doing the System components shouldn't be looking at application configuration options - they should be for the application code itself (eg configuring server address to connect to, or which LED to blink, or something). |
Test run: FAILEDSummary: 3 of 3 test jobs failed Failed test jobs:
|
Please ignore lts jobs here , not valid for this PR. We will restart testing and fix lts status here later once 5.15 jobs are in
we know what should be updated here now |
Some non-Mbed-OS, pre-existing CMSIS-RTOSv2 applications depend on CMSIS-RTOSv2 Automatic Dynamic Allocation, also known as Object-specific memory pools. Mbed OS doesn't by default provide any memory to the CMSIS-RTOSv2 Automatic Dynamic Allocation pool, as doing so would waste memory if the feature is not used; even if the feature is used, as a platform, Mbed OS can't know how many objects of which types will be created by an application and therefore will either waste memory or not provide enough memory in a hard to debug manner. Portable CMSIS-RTOSv2 applications depending on CMSIS-RTOSv2 Automatic Dynamic Allocation should instead configure the memory pools themselves, as applications know best their memory requirements. Add Mbed configuration options which can be used by applications to control the amounts of memory available to the CMSIS-RTOSv2 Automatic Dynamic Allocation subsystem. This enables portable CMSIS-RTOSv2 applications, which can run on any CMSIS-RTOSv2 OS, to be able to run on Mbed OS as well. RTX's configuration options for CMSIS-RTOSv2 memory are documented at http://www.keil.com/pack/doc/CMSIS_Dev/RTOS2/html/config_rtx5.html Signed-off-by: Devaraj Ranganna <[email protected]> Signed-off-by: Jaeden Amero <[email protected]>
Rebased to:
|
CI started |
Test run: SUCCESSSummary: 6 of 6 test jobs passed |
Summary of changes
Some non-Mbed-OS, pre-existing CMSIS-RTOSv2 applications depend on
CMSIS-RTOSv2 Automatic Dynamic Allocation, also known as Object-specific
memory pools. Mbed OS doesn't by default provide any memory to the
CMSIS-RTOSv2 Automatic Dynamic Allocation pool, as doing so would waste
memory if the feature is not used; even if the feature is used, as a
platform, Mbed OS can't know how many objects of which types will be
created by an application and therefore will either waste memory or not
provide enough memory in a hard to debug manner. Portable CMSIS-RTOSv2
applications depending on CMSIS-RTOSv2 Automatic Dynamic Allocation
should instead configure the memory pools themselves, as applications
know best their memory requirements.
Add Mbed configuration options which can be used by applications to
control the amounts of memory available to the CMSIS-RTOSv2 Automatic
Dynamic Allocation subsystem. This enables portable CMSIS-RTOSv2
applications, which can run on any CMSIS-RTOSv2 OS, to be able to run on
Mbed OS as well.
Signed-off-by: Devaraj Ranganna [email protected]
Signed-off-by: Jaeden Amero [email protected]
Impact of changes
Applications written for CMSIS-RTOSv2 that use CMSIS-RTOSv2 Automatic Dynamic Allocation can now also run on Mbed OS, when the application specifies how much memory to use in their
mbed_app.json
. CMSIS-RTOSv2 docs claim that Automatic Dynamic Allocation is "fully portable", and now that's at least more true than before where Mbed is concerned.The TF-M regression tests are a concrete example of an application written making use of CMSIS-RTOSv2 Automatic Dynamic Allocation. We have an incredibly easier time running (and maintaining) those tests with Mbed OS, validating the TF-M integration with Mbed OS does not break TF-M functionality, when Mbed OS supports application-configured CMSIS-RTOSv2 Automatic Dynamic Allocation.
Migration actions required
None
Documentation
We should document how to specify this memory in
mbed_app.json
. No doc PRs have been raised yet.Pull request type
Test results
TODO
We probably should add tests before merging this.
Reviewers
@bulislaw