-
Notifications
You must be signed in to change notification settings - Fork 7k
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
doc: kernel: document general policy for Zephyr without threads #29338
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
.. _nothread: | ||
|
||
Zephyr Without Threads | ||
###################### | ||
|
||
Thread support is not necessary in some applications: | ||
|
||
* Bootloaders | ||
* Simple event-driven applications | ||
* Examples intended to demonstrate core functionality | ||
|
||
Thread support can be disabled in Zephyr by setting | ||
:option:`CONFIG_MULTITHREADING` to ``n``. Since this configuration has | ||
a significant impact on Zephyr's functionality and testing of it has | ||
been limited, there are conditions on what can be expected to work in | ||
this configuration. | ||
|
||
What Can be Expected to Work | ||
**************************** | ||
|
||
These core capabilities shall function correctly when | ||
:option:`CONFIG_MULTITHREADING` is disabled: | ||
|
||
* The :ref:`build system <application>` | ||
|
||
* The ability to boot the application to ``main()`` | ||
|
||
* :ref:`Interrupt management <interrupts_v2>` | ||
|
||
* The system clock including :c:func:`k_uptime_get` | ||
|
||
* Timers, i.e. :c:func:`k_timer` | ||
|
||
* Non-sleeping delays e.g. :c:func:`k_busy_wait`. | ||
|
||
* Specifically identified drivers in certain subsystems, listed below. | ||
|
||
The expectations above affect selection of other features; for example | ||
:option:`CONFIG_SYS_CLOCK_EXISTS` cannot be set to ``n``. | ||
|
||
What Cannot be Expected to Work | ||
******************************* | ||
|
||
Functionality that will not work with :option:`CONFIG_MULTITHREADING` | ||
includes but is not limited to: | ||
|
||
* :c:func:`k_sleep()` and any other API that causes a thread to | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should consider being explicit here, just like we are explicit above. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better would be to make progress on #18970 so we can just say "Any api that sleeps except if using the no-wait path". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if the direction given was to list all API that meets the "sleeps" criteria (which I can't do until #18970 progresses to the point where we've identified that API), or to just refine the text to match what I said. So I did the latter. |
||
:ref:`api_term_sleep` except if using the :ref:`api_term_no-wait` | ||
path. | ||
|
||
.. contents:: | ||
:local: | ||
:depth: 1 | ||
|
||
Subsystem Behavior Without Thread Support | ||
***************************************** | ||
|
||
The sections below list driver and functional subsystems that are | ||
expected to work to some degree when :option:`CONFIG_MULTITHREADING` is | ||
disabled. Subsystems that are not listed here should not be expected to | ||
work. | ||
|
||
Some existing drivers within the listed subsystems do not work when | ||
threading is disabled, but are within scope based on their subsystem, or | ||
may be sufficiently isolated that supporting them on a particular | ||
platform is low-impact. Enhancements to add support to existing | ||
capabilities that were not originally implemented to work with threads | ||
disabled will be considered. | ||
|
||
Flash | ||
===== | ||
|
||
The :ref:`flash_api` is expected to work for all SoC flash peripheral | ||
drivers. Bus-accessed devices like serial memories may not be | ||
supported. | ||
|
||
*List/table of supported drivers to go here* | ||
|
||
GPIO | ||
==== | ||
|
||
The :ref:`gpio_api` is expected to work for all SoC GPIO peripheral | ||
drivers. Bus-accessed devices like GPIO extenders may not be supported. | ||
|
||
*List/table of supported drivers to go here* | ||
|
||
UART | ||
==== | ||
|
||
A subset of the :ref:`uart_api` is expected to work for all SoC UART | ||
peripheral drivers. | ||
|
||
* Applications that select :option:`CONFIG_UART_INTERRUPT_DRIVEN` may | ||
work, depending on driver implementation. | ||
|
||
* Applications that select :option:`CONFIG_UART_ASYNC_API` may | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure about this one. I always thought this actually required at least There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's unfortunate. I wouldn't expect other SoC's to have that problem. I suppose we don't support that API, then. |
||
work, depending on driver implementation. | ||
|
||
* Applications that do not select either :option:`CONFIG_UART_ASYNC_API` | ||
or :option:`CONFIG_UART_INTERRUPT_DRIVEN` are expected to work. | ||
|
||
*List/table of supported drivers to go here, including which API options | ||
are supported* |
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.
I think it would be worthwhile mentioning
SYS_CLOCK_EXISTS
here, because when no MT is often combined with no system clockThere 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.
OK, I'll have to look at that. Looks like
SYS_CLOCK_EXISTS=n
means nothing related to ticks is supported, includingk_uptime_get()
. So the only way to detect passage of time isk_cycle_get_32()
.I guess this one goes too. The value of this feature to me is diminishing rapidly....