]> begriffs open source - cmsis-freertos/blob - main/page_technical_data.html
Update documentation for branch main
[cmsis-freertos] / main / page_technical_data.html
1 <!-- HTML header for doxygen 1.9.6-->
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
4 <head>
5 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
6 <meta http-equiv="X-UA-Compatible" content="IE=11"/>
7 <meta name="viewport" content="width=device-width, initial-scale=1"/>
8 <title>CMSIS-FreeRTOS: Technical Data and Limitations</title>
9 <link href="doxygen.css" rel="stylesheet" type="text/css" />
10 <script type="text/javascript" src="jquery.js"></script>
11 <script type="text/javascript" src="dynsections.js"></script>
12 <script type="text/javascript" src="tabs.js"></script>
13 <script type="text/javascript" src="footer.js"></script>
14 <script type="text/javascript" src="navtree.js"></script>
15 <link href="navtree.css" rel="stylesheet" type="text/css"/>
16 <script type="text/javascript" src="navtreedata.js"></script>
17 <script type="text/javascript" src="navtree.js"></script>
18 <script type="text/javascript" src="resize.js"></script>
19 <script type="text/javascript" src="cookie.js"></script>
20 <link href="search/search.css" rel="stylesheet" type="text/css"/>
21 <script type="text/javascript" src="search/searchdata.js"></script>
22 <script type="text/javascript" src="search/search.js"></script>
23 <script type="text/javascript">
24 /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
25   $(function() { init_search(); });
26 /* @license-end */
27 </script>
28 <script type="text/javascript" src="darkmode_toggle.js"></script>
29 <link href="extra_stylesheet.css" rel="stylesheet" type="text/css"/>
30 <link href="extra_navtree.css" rel="stylesheet" type="text/css"/>
31 <link href="extra_search.css" rel="stylesheet" type="text/css"/>
32 <link href="extra_tabs.css" rel="stylesheet" type="text/css"/>
33 <link href="version.css" rel="stylesheet" type="text/css"/>
34 <script type="text/javascript" src="../version.js"></script>
35 </head>
36 <body>
37 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
38 <div id="titlearea">
39 <table cellspacing="0" cellpadding="0">
40  <tbody>
41  <tr style="height: 55px;">
42   <td id="projectlogo" style="padding: 1.5em;"><a href="https://www.keil.arm.com/cmsis" target="_blank"><img alt="Logo" src="cmsis_logo_white_small.png"/</a></td>
43   <td style="padding-left: 1em; padding-bottom: 1em;padding-top: 1em;">
44    <div id="projectname">CMSIS-FreeRTOS
45    &#160;<span id="projectnumber"><script type="text/javascript">
46      <!--
47      writeHeader.call(this);
48      writeVersionDropdown.call(this, "CMSIS-FreeRTOS");
49      //-->
50     </script>
51    </span>
52    </div>
53    <div id="projectbrief">CMSIS-RTOS2 compliant FreeRTOS Implementation</div>
54   </td>
55    <td>        <div id="MSearchBox" class="MSearchBoxInactive">
56         <span class="left">
57           <span id="MSearchSelect"                onmouseover="return searchBox.OnSearchSelectShow()"                onmouseout="return searchBox.OnSearchSelectHide()">&#160;</span>
58           <input type="text" id="MSearchField" value="" placeholder="Search" accesskey="S"
59                onfocus="searchBox.OnSearchFieldFocus(true)" 
60                onblur="searchBox.OnSearchFieldFocus(false)" 
61                onkeyup="searchBox.OnSearchFieldChange(event)"/>
62           </span><span class="right">
63             <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
64           </span>
65         </div>
66 </td>
67  </tr>
68  </tbody>
69 </table>
70 </div>
71 <!-- end header part -->
72 <div id="CMSISnav" class="tabs1">
73   <ul class="tablist">
74     <script type="text/javascript">
75       writeComponentTabs.call(this);
76     </script>
77   </ul>
78 </div>
79 <!-- Generated by Doxygen 1.13.2 -->
80 <script type="text/javascript">
81 /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
82 var searchBox = new SearchBox("searchBox", "search/",'.html');
83 /* @license-end */
84 </script>
85 <script type="text/javascript">
86 /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
87 $(function() { codefold.init(0); });
88 /* @license-end */
89 </script>
90 </div><!-- top -->
91 <div id="side-nav" class="ui-resizable side-nav-resizable">
92   <div id="nav-tree">
93     <div id="nav-tree-contents">
94       <div id="nav-sync" class="sync"></div>
95     </div>
96   </div>
97   <div id="splitbar" style="-moz-user-select:none;" 
98        class="ui-resizable-handle">
99   </div>
100 </div>
101 <script type="text/javascript">
102 /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
103 $(function(){initNavTree('page_technical_data.html',''); initResizable(true); });
104 /* @license-end */
105 </script>
106 <div id="doc-content">
107 <!-- window showing the filter options -->
108 <div id="MSearchSelectWindow"
109      onmouseover="return searchBox.OnSearchSelectShow()"
110      onmouseout="return searchBox.OnSearchSelectHide()"
111      onkeydown="return searchBox.OnSearchSelectKey(event)">
112 </div>
113
114 <!-- iframe showing the search results (closed by default) -->
115 <div id="MSearchResultsWindow">
116 <div id="MSearchResults">
117 <div class="SRPage">
118 <div id="SRIndex">
119 <div id="SRResults"></div>
120 <div class="SRStatus" id="Loading">Loading...</div>
121 <div class="SRStatus" id="Searching">Searching...</div>
122 <div class="SRStatus" id="NoMatches">No Matches</div>
123 </div>
124 </div>
125 </div>
126 </div>
127
128 <div><div class="header">
129   <div class="headertitle"><div class="title">Technical Data and Limitations</div></div>
130 </div><!--header-->
131 <div class="contents">
132 <div class="textblock"><p><a class="anchor" id="md_src_2technical__data"></a></p>
133 <p>This lists the technical data of CMSIS-FreeRTOS.</p>
134 <h1><a class="anchor" id="autotoc_md10"></a>
135 Limitations</h1>
136 <p>The following list briefly describes the limitations and unsupported features of the CMSIS-RTOS2 wrapper for FreeRTOS:</p>
137 <ul>
138 <li>Static memory allocation will only work if <em>all</em> memory (from attributes structure) is provided statically. In order to allocate object memory statically, you need to:<ul>
139 <li>provide the memory for control blocks and stack in the <code>osThreadAttr_t</code> structure for threads.</li>
140 <li>provide the memory for control blocks and message data in the <code>osMessageQueueAttr_t</code> structure for memory queues.</li>
141 <li>provide the memory for control blocks for other objects in the object's attributes structure.</li>
142 </ul>
143 </li>
144 <li>Each timer object requires additional 8 bytes of memory:<ul>
145 <li>to allocate all memory statically, provide the memory for control block of size (sizeof(StaticTimer_t) + 8 bytes)</li>
146 <li>otherwise, additional 8 bytes of dynamic memory will be used</li>
147 </ul>
148 </li>
149 <li><code>osKernelSuspend</code> and <code>osKernelResume</code> are not supported.</li>
150 <li><code>osThreadDetach</code>, <code>osThreadJoin()</code> and attribute <code>osThreadJoinable</code> are not supported (<code>osThreadNew</code> returns NULL when <code>osThreadJoinable</code> attribute is specified).</li>
151 <li><code>osThreadGetStackSize</code> is not implemented.</li>
152 <li>Event flags are limited to 24 bits.</li>
153 <li><code>osEventFlagsGetName</code> is not implemented.</li>
154 <li><code>osEventFlagsWait</code> cannot be called from an ISR.</li>
155 <li>Priority inherit protocol is used as default mutex behavior (<code>osMutexNew</code> creates priority inherit mutex object by default and ignores <code>osMutexPrioInherit</code> attribute when specified).</li>
156 <li>Robust mutex objects are not supported (<code>osMutexNew</code> returns NULL when <code>osMutexRobust</code> attribute is specified).</li>
157 <li><code>osMutexGetName</code> is not implemented and always returns NULL.</li>
158 <li><code>osSemaphoreGetName</code> is not implemented and always returns NULL.</li>
159 <li><code>osMessageQueueGetName</code> is not implemented and always returns NULL.</li>
160 <li><code>osMessageQueuePut</code> and <code>osMessageQueueGet</code> always ignore message priority.</li>
161 <li><em>Process Isolation (Functional Safety)</em> functions are not implemented.</li>
162 </ul>
163 <h1><a class="anchor" id="autotoc_md11"></a>
164 Validation Suite Results</h1>
165 <p>CMSIS provides a <a href="https://arm-software.github.io/CMSIS_6/latest/RTOS2/rtosValidation.html">CMSIS-RTOS2 validation suite</a> that can be used to test a real-time operating system for compliance to the standard. The test suite has been executed successfully on the CMSIS-FreeRTOS implementation (<a href="cmsis_rtos2_validation.txt">see results</a>).</p>
166 <p>The following table explains the exceptions:</p>
167 <table class="markdownTable">
168 <tr class="markdownTableHead">
169 <th class="markdownTableHeadNone">Test Case   </th><th class="markdownTableHeadNone">Result   </th><th class="markdownTableHeadNone">Reason   </th><th class="markdownTableHeadNone">Summary    </th></tr>
170 <tr class="markdownTableRowOdd">
171 <td class="markdownTableBodyNone">TC_osKernelGetState_2   </td><td class="markdownTableBodyNone">not executed   </td><td class="markdownTableBodyNone">unsupported feature   </td><td class="markdownTableBodyNone">Test attempts to call <code>osKernelGetState</code> after a <code>osKernelSuspend</code> call. <code>osKernelSuspend</code> is not implemented.    </td></tr>
172 <tr class="markdownTableRowEven">
173 <td class="markdownTableBodyNone">TC_osKernelLock_2   </td><td class="markdownTableBodyNone">not executed   </td><td class="markdownTableBodyNone">unsupported feature   </td><td class="markdownTableBodyNone">Test attempts to call <code>osKernelLock</code> after a <code>osKernelSuspend</code> call. <code>osKernelSuspend</code> is not implemented.    </td></tr>
174 <tr class="markdownTableRowOdd">
175 <td class="markdownTableBodyNone">TC_osKernelUnlock_2   </td><td class="markdownTableBodyNone">not executed   </td><td class="markdownTableBodyNone">unsupported feature   </td><td class="markdownTableBodyNone">Test attempts to call <code>osKernelUnlock</code> after a <code>osKernelSuspend</code> call. <code>osKernelSuspend</code> is not implemented.    </td></tr>
176 <tr class="markdownTableRowEven">
177 <td class="markdownTableBodyNone">TC_osKernelSuspend_1   </td><td class="markdownTableBodyNone">not executed   </td><td class="markdownTableBodyNone">unsupported feature   </td><td class="markdownTableBodyNone">Test validates <code>osKernelSuspend</code> which is not implemented.    </td></tr>
178 <tr class="markdownTableRowOdd">
179 <td class="markdownTableBodyNone">TC_osKernelResume_1   </td><td class="markdownTableBodyNone">not executed   </td><td class="markdownTableBodyNone">unsupported feature   </td><td class="markdownTableBodyNone">Test validates <code>osKernelResume</code> which is not implemented.    </td></tr>
180 <tr class="markdownTableRowEven">
181 <td class="markdownTableBodyNone">TC_osThreadNew_3   </td><td class="markdownTableBodyNone">not executed   </td><td class="markdownTableBodyNone">unsupported feature   </td><td class="markdownTableBodyNone">Test attempts to create joinable thread using <code>osThreadJoinable</code> attribute. FreeRTOS does not support joinable threads.    </td></tr>
182 <tr class="markdownTableRowOdd">
183 <td class="markdownTableBodyNone">TC_osThreadGetName_1   </td><td class="markdownTableBodyNone">failed   </td><td class="markdownTableBodyNone">deviation   </td><td class="markdownTableBodyNone">Test attempt to retrieve a name on an unnamed thread. An empty string is returned instead of NULL pointer.    </td></tr>
184 <tr class="markdownTableRowEven">
185 <td class="markdownTableBodyNone">TC_osThreadGetState_3   </td><td class="markdownTableBodyNone">not executed   </td><td class="markdownTableBodyNone">unsupported feature   </td><td class="markdownTableBodyNone">Test attempts to retrieve a state of a terminated joinable thread. FreeRTOS does not support joinable threads.    </td></tr>
186 <tr class="markdownTableRowOdd">
187 <td class="markdownTableBodyNone">TC_osThreadDetach_1   </td><td class="markdownTableBodyNone">not executed   </td><td class="markdownTableBodyNone">unsupported feature   </td><td class="markdownTableBodyNone">Test validates <code>osThreadDetach</code> which is not implemented.    </td></tr>
188 <tr class="markdownTableRowEven">
189 <td class="markdownTableBodyNone">TC_osThreadDetach_2   </td><td class="markdownTableBodyNone">not executed   </td><td class="markdownTableBodyNone">unsupported feature   </td><td class="markdownTableBodyNone">Test validates <code>osThreadDetach</code> which is not implemented.    </td></tr>
190 <tr class="markdownTableRowOdd">
191 <td class="markdownTableBodyNone">TC_osThreadJoin_1   </td><td class="markdownTableBodyNone">not executed   </td><td class="markdownTableBodyNone">unsupported feature   </td><td class="markdownTableBodyNone">Test validates <code>osThreadJoin</code> which is not implemented.    </td></tr>
192 <tr class="markdownTableRowEven">
193 <td class="markdownTableBodyNone">TC_osThreadJoin_2   </td><td class="markdownTableBodyNone">not executed   </td><td class="markdownTableBodyNone">unsupported feature   </td><td class="markdownTableBodyNone">Test validates <code>osThreadJoin</code> which is not implemented.    </td></tr>
194 <tr class="markdownTableRowOdd">
195 <td class="markdownTableBodyNone">TC_osThreadJoin_3   </td><td class="markdownTableBodyNone">not executed   </td><td class="markdownTableBodyNone">unsupported feature   </td><td class="markdownTableBodyNone">Test validates <code>osThreadJoin</code> which is not implemented.    </td></tr>
196 <tr class="markdownTableRowEven">
197 <td class="markdownTableBodyNone">TC_osThreadGetStackSize_1   </td><td class="markdownTableBodyNone">not executed   </td><td class="markdownTableBodyNone">unsupported feature   </td><td class="markdownTableBodyNone">Test validates <code>osThreadGetStackSize</code> which is not implemented.    </td></tr>
198 <tr class="markdownTableRowOdd">
199 <td class="markdownTableBodyNone">TC_ThreadReturn   </td><td class="markdownTableBodyNone">not executed   </td><td class="markdownTableBodyNone">unsupported feature   </td><td class="markdownTableBodyNone">Test attempts to terminate a thread by just returning from a thread. FreeRTOS threads may not return.    </td></tr>
200 <tr class="markdownTableRowEven">
201 <td class="markdownTableBodyNone">TC_osEventFlagsSet_1   </td><td class="markdownTableBodyNone">failed   </td><td class="markdownTableBodyNone">deviation   </td><td class="markdownTableBodyNone">Test attempts to set event flags by calling <code>osEventFlagsSet</code> multiple times without leaving ISR handler. To process ISR requests, FreeRTOS uses timer deamon which wakes-up after ISR execution.    </td></tr>
202 <tr class="markdownTableRowOdd">
203 <td class="markdownTableBodyNone">TC_osEventFlagsClear_1   </td><td class="markdownTableBodyNone">failed   </td><td class="markdownTableBodyNone">deviation   </td><td class="markdownTableBodyNone">Test attempts to clear event flags by calling <code>osEventFlagsClear</code> multiple times without leaving ISR handler. To process ISR requests, FreeRTOS uses timer deamon which wakes-up after ISR execution.    </td></tr>
204 <tr class="markdownTableRowEven">
205 <td class="markdownTableBodyNone">TC_osEventFlagsWait_1   </td><td class="markdownTableBodyNone">failed   </td><td class="markdownTableBodyNone">unsupported feature   </td><td class="markdownTableBodyNone">Test attempts to wait for flags from ISR with zero timeout (try-semantic). FreeRTOS does not support such operation.    </td></tr>
206 <tr class="markdownTableRowOdd">
207 <td class="markdownTableBodyNone">TC_osEventFlagsGetName_1   </td><td class="markdownTableBodyNone">not executed   </td><td class="markdownTableBodyNone">unsupported feature   </td><td class="markdownTableBodyNone">Test validates <code>osEventFlagsGetName</code> which is not implemented.    </td></tr>
208 <tr class="markdownTableRowEven">
209 <td class="markdownTableBodyNone">TC_osMutexNew_4   </td><td class="markdownTableBodyNone">not executed   </td><td class="markdownTableBodyNone">unsupported feature   </td><td class="markdownTableBodyNone">Test attempts to create a robust mutex. FreeRTOS implementation does not support robust mutexes.    </td></tr>
210 <tr class="markdownTableRowOdd">
211 <td class="markdownTableBodyNone">TC_osMutexGetName_1   </td><td class="markdownTableBodyNone">not executed   </td><td class="markdownTableBodyNone">unsupported feature   </td><td class="markdownTableBodyNone">Test validates <code>osMutexGetName</code> which is not implemented.    </td></tr>
212 <tr class="markdownTableRowEven">
213 <td class="markdownTableBodyNone">TC_MutexRobust   </td><td class="markdownTableBodyNone">not executed   </td><td class="markdownTableBodyNone">unsupported feature   </td><td class="markdownTableBodyNone">Test attempts to validate robust mutex behavior. FreeRTOS implementation does not support robust mutexes.    </td></tr>
214 <tr class="markdownTableRowOdd">
215 <td class="markdownTableBodyNone">TC_MutexOwnership   </td><td class="markdownTableBodyNone">not executed   </td><td class="markdownTableBodyNone">unsupported feature   </td><td class="markdownTableBodyNone">Test attempts to release a mutex from a thread which is not the mutex owner. FreeRTOS implementation does not verify ownership on mutex release.    </td></tr>
216 <tr class="markdownTableRowEven">
217 <td class="markdownTableBodyNone">TC_osSemaphoreGetName_1   </td><td class="markdownTableBodyNone">not executed   </td><td class="markdownTableBodyNone">unsupported feature   </td><td class="markdownTableBodyNone">Test validates <code>osSemaphoreGetName</code> which is not implemented.    </td></tr>
218 <tr class="markdownTableRowOdd">
219 <td class="markdownTableBodyNone">TC_osMessageQueueGetName_1   </td><td class="markdownTableBodyNone">not executed   </td><td class="markdownTableBodyNone">unsupported feature   </td><td class="markdownTableBodyNone">Test validates <code>osMessageQueueGetName</code> which is not implemented.   </td></tr>
220 </table>
221 <h1><a class="anchor" id="autotoc_md12"></a>
222 Troubleshooting</h1>
223 <p>Users looking for help shall check <a href="https://www.freertos.org/Why-FreeRTOS/FAQs">subsection of the full FreeRTOS FAQ</a>. It contains many useful information that also apply when using FreeRTOS in context of CMSIS-FreeRTOS.</p>
224 <p>Additionally, please take a look at the following:</p>
225 <ol type="1">
226 <li><p class="startli"><b>Interrupts are disabled when main is called or before the kernel is started</b></p>
227 <p class="startli">Before the FreeRTOS kernel is started, threads (i.e. tasks) may be created together with other objects like mutexes, semaphores, message queues etc. When functions like <code>xTaskCreate</code>, <code>xSemaphoreCreateMutex</code>, <code>xQueueCreate</code> and others get called, they prevent interrupt handlers from calling FreeRTOS API functions in order to keep FreeRTOS kernel variables and state machine consistent (see also here <a href="https://www.freertos.org/Why-FreeRTOS/FAQs">Interrupts are not executing</a>). In cases when interrupts may be executed after object creation and before the FreeRTOS kernel is started they can be re-enabled: </p><div class="fragment"><div class="line">portENABLE_INTERRUPTS();</div>
228 </div><!-- fragment --><p> Make sure that the interrupts you execute in such case do not call FreeRTOS API. </p>
229 </li>
230 </ol>
231 </div></div><!-- contents -->
232 </div><!-- PageDoc -->
233 </div><!-- doc-content -->
234 <!-- start footer part -->
235 <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
236   <ul>
237     <li class="footer">
238       <script type="text/javascript">
239         <!--
240         writeFooter.call(this);
241         //-->
242       </script> 
243     </li>
244   </ul>
245 </div>
246 </body>
247 </html>