-
Notifications
You must be signed in to change notification settings - Fork 178
Add CMSIS-RTOS documentation #160
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
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.
@bulislaw I've left four queries for you. Would you like me to make my grammar edits directly to your PR, or would you like me to leave them in comment form for you to make?
docs/advanced/cmsis-rtos.md
Outdated
@@ -0,0 +1,77 @@ | |||
# CMSIS & RTX | |||
|
|||
CMSIS/RTX code is imported from the original CMSIS repository which can be found: https://github.com/ARM-software/CMSIS_5/ |
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.
Query: Who or what does the importing? Please clarify.
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.
CMSIS/RTX is a separate repository (also owned by ARM). We take code from this external repo and import it in mbed OS codebase. Every now and again we will import new version of the code.
docs/advanced/cmsis-rtos.md
Outdated
|
||
## Configuration | ||
|
||
mbed OS changes to RTX configuration are all maintained in a single file: `mbed-os/rtos/rtx2/mbed_rtx_conf.h` |
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.
Query: Who or what maintains these changes? Please clarify.
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.
We do. The point is not to change configuration options in different places of mbed OS as we used to do it, but have one central file where all of the default changes are made.
docs/advanced/cmsis-rtos.md
Outdated
|
||
#### Other | ||
|
||
* irq_cm0.s is used for both M0 and M0P cores in mbed OS for all toolchains |
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.
Query: Who or what uses irq_cm0.s? Please clarify.
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.
mbed OS is using these files for M0/M0P boards. The point i wanted to make is that there's one original file, with name suggesting it's for M0 only, but in reality we use it for both type of cores.
docs/advanced/cmsis-rtos.md
Outdated
rtx_os.h | Doxygen added; added per-thread uVisor context | | ||
irq_cm4.s | For all toolchains: added case for Cortex M4 cores without VFP | | ||
svc_user.c | Removed as it's template file and should not be in our code base | | ||
rt_OsEventObserver.{c,h} | Added an interface for uVisor to get notified about certain events from privileged code | |
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.
Query: Is the Description column a description of what the filename does? If so, could you please reword the Description column to be in present tense [such as "Adds Doxygen" instead of "Doxygen added"]? If not, could you please clarify?
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.
It's part of the 'Changes' section, 'description' column documents what changes we (mbed OS) made to the original code imported from external repository.
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.
Thanks for that! Sounds better now :)
docs/advanced/cmsis-rtos.md
Outdated
|
||
## Memory considerations | ||
|
||
Please note that mbed OS doesn't use any of the RTX memory models, which are based on static carveouts (memory pools). This approach is not ideal for generic system like mbed OS as calculating required numbers of RTOS objects is impossible. To avoid declaring arbitrary large buffers, carved out on compile time, limiting amount of available memory, mbed OS shifts the responsibility of supplying the backing memory to CMSIS-RTOS2 users. | ||
Please note that mbed OS doesn't use any of the RTX memory models, which are based on static carveouts (memory pools). This approach is not ideal for generic system, such as mbed O,S because calculating required numbers of RTOS objects is impossible. To avoid declaring arbitrary large buffers, carved out on compile time, limiting amount of available memory, mbed OS shifts the responsibility of supplying the backing memory to CMSIS-RTOS2 users. |
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.
O,S because
docs/advanced/cmsis-rtos.md
Outdated
|
||
Therefore developers will need to use mbed OS RTOS C++ API or supply backing memory for RTX objects to `os*New` calls when using CMSIS-RTOS2 APIs directly (please consult CMSIS-RTOS2 documentation for API details). `mbed_rtos_storage.h` header provides handy wrappers that can be used to secure required memory without exposing the code to RTX implementation details. | ||
Therefore developers need to use the mbed OS RTOS C++ API or supply backing memory for RTX objects to `os*New` calls when using CMSIS-RTOS2 APIs directly. (Please consult CMSIS-RTOS2 documentation for API details.) `mbed_rtos_storage.h` header provides handy wrappers that you can use to secure required memory without exposing the code to RTX implementation details. |
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.
directly. (Please consult CMSIS-RTOS2 documentation for API details.)
I think the dot should be on the other side of the bracketed bit, as it refers to the CMSIS-RTOS2 rather than mbed_rtos_storage.h
docs/advanced/cmsis-rtos.md
Outdated
|
||
## Code structure | ||
|
||
Due to differences in how mbed OS and CMSIS directory structures look like, we can't import the original code directly, some directory changes are necessary: | ||
Due to differences in how the mbed OS and CMSIS directory structures look, you can't import the original code directly. Some directory changes are necessary: |
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.
That's not a big deal, but it's not about the users, it's about the maintainers (us). This import is done, and may be needed to be done in the future to update CMSIS (external component) version.
docs/advanced/cmsis-rtos.md
Outdated
@@ -51,6 +51,7 @@ Due to different use cases between mbed OS and CMSIS, we had to make some modifi | |||
Filename | Description | | |||
---------|-------------| | |||
`cmsis_compiler.h` | Added IAR missing __ALIGNED attribute for earlier (less than 7.8.4) versions | | |||
``cmain.S`` | custom IAR non-rtos boot sequence for mbed | |
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.
Please change "non-rtos" to "non-RTOS" for consistent capitalization.
docs/advanced/cmsis-rtos.md
Outdated
|
||
## Memory considerations | ||
|
||
Please note that mbed OS doesn't use any of the RTX memory models, which are based on static carveouts (memory pools). This approach is not ideal for generic system, such as mbed O,S because calculating required numbers of RTOS objects is impossible. To avoid declaring arbitrary large buffers, carved out on compile time, limiting amount of available memory, mbed OS shifts the responsibility of supplying the backing memory to CMSIS-RTOS2 users. |
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.
generic system => generic systems or a generic system
mbed O,S => mbed OS,
carved out on compile time => carved out at compile time
limiting amount of available memory => limiting the amount of available memory
docs/advanced/cmsis-rtos.md
Outdated
|
||
Please note that mbed OS doesn't use any of the RTX memory models, which are based on static carveouts (memory pools). This approach is not ideal for generic system, such as mbed O,S because calculating required numbers of RTOS objects is impossible. To avoid declaring arbitrary large buffers, carved out on compile time, limiting amount of available memory, mbed OS shifts the responsibility of supplying the backing memory to CMSIS-RTOS2 users. | ||
|
||
Therefore developers need to use the mbed OS RTOS C++ API or supply backing memory for RTX objects to `os*New` calls when using CMSIS-RTOS2 APIs directly. (Please consult CMSIS-RTOS2 documentation for API details.) `mbed_rtos_storage.h` header provides handy wrappers that you can use to secure required memory without exposing the code to RTX implementation details. |
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.
My preference is to avoid starting a paragraph with "Therefore"
docs/advanced/cmsis-rtos.md
Outdated
Filename | Description | | ||
---------|-------------| | ||
`cmsis_compiler.h` | Added IAR missing __ALIGNED attribute for earlier (less than 7.8.4) versions | | ||
``cmain.S`` | custom IAR non-RTOS boot sequence for mbed | |
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.
Wrong number of ` should be one.
docs/advanced/cmsis-rtos.md
Outdated
`svc_user.c` | Removed as its template file and should not be in our code base | | ||
`rt_OsEventObserver.{c,h}` | Added an interface for uVisor to be notified about certain events from privileged code | | ||
|
||
#### Other |
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.
Should be on the same level as RTX: 3*#
@bulislaw Once y'all resolve the comments from @theotherjimmy, could you please add the missing "t" in "documentation" in the subject line? If you'd like me to, I can also make that change for you. Just let me know. Thanks so much. |
Copy edit, mostly for active voice, consistent tense and consistent code format.
Should be fixed now. |
@bulislaw Is it OK if I move this to the 5.5 docs branch, which I just created? |
@theotherjimmy Is this OK to merge? |
yes |
Document CMSIS-RTOS and RTX usage in mbed OS.
Should be merged after ARMmbed/mbed-os#4294
@AnotherButler could you please have a look