<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: FreeRTOS maximum used priority is unreasonably big, not proceeding in MCUXpresso IDE</title>
    <link>https://community.nxp.com/t5/MCUXpresso-IDE/FreeRTOS-maximum-used-priority-is-unreasonably-big-not/m-p/905597#M3969</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Keith,&lt;/P&gt;&lt;P&gt;FreeRTOS includes version number information in task.h:&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="property macro token"&gt;#define tskKERNEL_VERSION_NUMBER "V10.1.1"&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define tskKERNEL_VERSION_MAJOR 10&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define tskKERNEL_VERSION_MINOR 1&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define tskKERNEL_VERSION_BUILD 1&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But these are defines and usually do not end up in the binary, so the debugger has no chance to read that information.&lt;/P&gt;&lt;P&gt;That's why you will find the freertos_tasks_c_addition.h present in the FreeRTOS FreeRTOS:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://github.com/ErichStyger/McuOnEclipseLibrary/blob/master/lib/FreeRTOS/Source/include/freertos_tasks_c_additions.h" rel="nofollow noopener noreferrer" title="https://github.com/ErichStyger/McuOnEclipseLibrary/blob/master/lib/FreeRTOS/Source/include/freertos_tasks_c_additions.h" target="_blank"&gt;McuOnEclipseLibrary/freertos_tasks_c_additions.h at master · ErichStyger/McuOnEclipseLibrary · GitHub&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It contains a struct with all the information needed, including the kernel version. The NXP LPC-Link2/LinkServer does in fact read that information, but the SEGGER J-Link stub does not (at least not from what I can tell, so it would be able to have all the information). The FreeRTOS kernel provides all the mechanisms to provide that information to the debuggers, but it seems only the NXP port (MCUXpresso SDK) takes advantage of that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 May 2019 17:59:25 GMT</pubDate>
    <dc:creator>BlackNight</dc:creator>
    <dc:date>2019-05-10T17:59:25Z</dc:date>
    <item>
      <title>FreeRTOS maximum used priority is unreasonably big, not proceeding</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/FreeRTOS-maximum-used-priority-is-unreasonably-big-not/m-p/905591#M3963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem is the Segger debug session reports "FreeRTOS maximum used priority is unreasonably big, not proceeding" and the debug session stops.&lt;BR /&gt;When the debug session stops, the debugger is configured to let the application run.&lt;BR /&gt;When I 'attach' to the application it has run properly. The application is not hung.&lt;BR /&gt;This appears to be a problem with the debug session.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a report of a problem that seems to have persisted for a couple of years.&lt;/P&gt;&lt;P&gt;Below are links to prior reports of this issue.&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/thread/457049"&gt;https://community.nxp.com/thread/457049&lt;/A&gt; - Aug 2017&lt;/P&gt;&lt;P&gt;&lt;A href="https://forum.segger.com/index.php/Thread/4704-ABANDONED-FreeRTOS-plugin-under-Eclipse-crash/"&gt;https://forum.segger.com/index.php/Thread/4704-ABANDONED-FreeRTOS-plugin-under-Eclipse-crash/&lt;/A&gt; - Dec 2017&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/espressif/openocd-esp32/issues/7"&gt;https://github.com/espressif/openocd-esp32/issues/7&lt;/A&gt;&amp;nbsp; - Mar 2017&lt;/P&gt;&lt;P&gt;I have been able to solve this problem using the information at this link, &lt;A _jive_internal="true" href="https://community.nxp.com/thread/440321"&gt;https://community.nxp.com/thread/440321&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My environment is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: tahoma,arial,helvetica,sans-serif;"&gt;Segger J-Link Pro, Version 6.44&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: tahoma,arial,helvetica,sans-serif;"&gt;MCUXpresso 10.3.1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: tahoma,arial,helvetica,sans-serif;"&gt;Target MCU: MK22FN1M0Axxx12&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: tahoma,arial,helvetica,sans-serif;"&gt;RTOS: Amazon FreeRTOS 10.0.1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: tahoma,arial,helvetica,sans-serif;"&gt;Microsoft Windows 7&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: tahoma,arial,helvetica,sans-serif;"&gt;The default setting for &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;configUSE_PORT_OPTIMISED_TASK_SELECTION&lt;/SPAN&gt; is 1, thus FreeRTOS uses the 'ported' code to select the next task.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: tahoma,arial,helvetica,sans-serif;"&gt;Using RTOS Plugin: GDBServer/RTOSPlugin_FreeRTOS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The error message is found in this version of OpenOCD code.&lt;BR /&gt;&lt;A href="http://openocd.org/doc-release/doxygen/FreeRTOS_8c_source.html"&gt;http://openocd.org/doc-release/doxygen/FreeRTOS_8c_source.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;In the OpenOCD code, the FreeRTOS OpenOCD variable &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;uxTopUsedPriority&lt;/SPAN&gt; is part of the test that generates the error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the Segger J-Link debug console is the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;Loading RTOS plugin: GDBServer/RTOSPlugin_FreeRTOS...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;RTOS plugin (API v1.0) loaded successfully&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;RTOS plugin initialized successfully.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;Received symbol: pxCurrentTCB (0x20007FA0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;Received symbol: pxReadyTasksLists (0x20007FA4)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;Received symbol: xDelayedTaskList1 (0x200080E4)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;Received symbol: xDelayedTaskList2 (0x200080F8)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;Received symbol: pxDelayedTaskList (0x2000810C)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;Received symbol: pxOverflowDelayedTaskList (0x20008110)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;Received symbol: xPendingReadyList (0x20008114)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;Received symbol: xTasksWaitingTermination (0x20008128)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;Received symbol: xSuspendedTaskList (0x20008140)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;Received symbol: uxCurrentNumberOfTasks (0x20008154)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;Received symbol: uxTopUsedPriority (0x00000000)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;Received symbol: uxTopReadyPriority (0x2000815C)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;Received symbol: vPortEnableVFP (0x000500D8)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;Received symbol: FreeRTOSDebugConfig (0x00000000)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;All mandatory symbols successfully loaded.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notice that &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;uxTopUsedPriority&lt;/SPAN&gt; is zero.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Also &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;FreeRTOSDebugConfig&lt;/SPAN&gt; is zero, but don't know if it relates to any issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The list of symbols above is used in the OpenOCD code referenced above.&lt;BR /&gt;[I don't know if Segger is using OpenOCD, but the correlation with OpenOCD is interesting.]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The solution shown above (/thread/440321) states that one should add the following code, along with updates to FreeRTOS_Config.h.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;int uxTopUsedPriority=configMAX_PRIORITIES;&amp;nbsp;// Probably should be added to tasks.c&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The error occurs in the macro &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;prvAddTaskToReadyList()&lt;/SPAN&gt; in tasks.c of FreeRTOS.&lt;BR /&gt;The instruction that generates the error message is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;STR R3, [R2,#0]&amp;nbsp;&amp;nbsp; R3 = 0x85,&amp;nbsp; R2 = 0x2000815c = &amp;amp;uxTopReadyPriority&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The value of (R3 + 1) is the value reported with the error message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;/*-----------------------------------------------------------*/&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;/*&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;&amp;nbsp;* Place the task represented by pxTCB into the appropriate ready list for&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;&amp;nbsp;* the task.&amp;nbsp; It is inserted at the end of the list.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;&amp;nbsp;*/&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;#define prvAddTaskToReadyList( pxTCB )&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;\&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;&amp;nbsp;traceMOVED_TASK_TO_READY_STATE( pxTCB );&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;\&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;&amp;nbsp;taskRECORD_READY_PRIORITY( ( pxTCB )-&amp;gt;uxPriority );&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;\&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;&amp;nbsp;vListInsertEnd( &amp;amp;( pxReadyTasksLists[ ( pxTCB )-&amp;gt;uxPriority ] ), &amp;amp;( ( pxTCB )-&amp;gt;xStateListItem ) ); \&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;&amp;nbsp;tracePOST_MOVED_TASK_TO_READY_STATE( pxTCB )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;/*-----------------------------------------------------------*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This macro has successively created the first and second threads in my application. Tmr Svc and Idle task are also created.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure who is responsible for fixing this problem, FreeRTOS, Segger, or NXP.&lt;/P&gt;&lt;P&gt;I'll start with NXP as they consolidate FreeRTOS and Segger.&lt;/P&gt;&lt;P&gt;Hope you find this useful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 May 2019 19:11:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/FreeRTOS-maximum-used-priority-is-unreasonably-big-not/m-p/905591#M3963</guid>
      <dc:creator>Keith4DSmith</dc:creator>
      <dc:date>2019-05-08T19:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: FreeRTOS maximum used priority is unreasonably big, not proceeding</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/FreeRTOS-maximum-used-priority-is-unreasonably-big-not/m-p/905592#M3964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I assume this is because you have&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;configUSE_PORT_OPTIMISED_TASK_SELECTION set to 1.&amp;nbsp; As you call that out I guess you had that thought too.&amp;nbsp; When&amp;nbsp;&lt;SPAN&gt;configUSE_PORT_OPTIMISED_TASK_SELECTION is set to 1 the variable being read by the debugger is actually used as a bitmap so it is not interpreted correctly by the debugger - the optimization being that the highest priority ready task can be obtained using a single count leading zeros assembly instruction.&amp;nbsp; If you set&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;configUSE_PORT_OPTIMISED_TASK_SELECTION to 0 then the single asm instruction is replaced by a sequence of C code, so less efficient, but it should enable the debugger to interpret the variable properly as it is now a value rather than a bitmap.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 May 2019 22:34:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/FreeRTOS-maximum-used-priority-is-unreasonably-big-not/m-p/905592#M3964</guid>
      <dc:creator>FreeRTOS_org</dc:creator>
      <dc:date>2019-05-08T22:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: FreeRTOS maximum used priority is unreasonably big, not proceeding</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/FreeRTOS-maximum-used-priority-is-unreasonably-big-not/m-p/905593#M3965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes,&amp;nbsp;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;configUSE_PORT_OPTIMISED_TASK_SELECTION&amp;nbsp;is set to 1 as this is how FreeRTOS is shipped with the NXP SDK.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;Setting &lt;SPAN style="color: #51626f;"&gt;configUSE_PORT_OPTIMISED_TASK_SELECTION&amp;nbsp;&lt;/SPAN&gt;to 0 corrects the problem, but I consider this a workaround, not the solution.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;Having set &lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;configUSE_PORT_OPTIMISED_TASK_SELECTION&amp;nbsp;to 1 works much of the time, but now I have to change to 0 in order to debug this particular application. I am not the only developer who has encountered this problem.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;Also, the code worked correctly to create the first two threads of my application.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;Yes, the CLZ instruction is used when &lt;SPAN style="color: #51626f;"&gt;configUSE_PORT_OPTIMISED_TASK_SELECTION=1, but the instruction that is being executed when the debugger fails is&amp;nbsp;not CLZ, but STR.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;The priority bit list is 0x46, well within the 32-bit limit when setting configUSE_PORT_OPTIMISED_TASK_SELECTION=1.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;The error message is output in the Segger debug console, not by FreeRTOS (The error string appears in OpenOCD code). Thus the debugger is raising the error, not FreeRTOS.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;[Back in 2015, the lack of &lt;SPAN style="color: #51626f; font-family: Courier New; "&gt;uxTopUsedPriority&lt;/SPAN&gt; in FreeRTOS required an update to OpenOCD. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;&lt;A href="https://sourceforge.net/p/openocd/mailman/message/33274231/"&gt;&lt;SPAN style="color: #0066cc; text-decoration: underline; "&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;A href="https://sourceforge.net/p/openocd/mailman/message/33274231/" target="test_blank"&gt;https://sourceforge.net/p/openocd/mailman/message/33274231/&lt;/A&gt;&lt;/SPAN&gt;&amp;nbsp; ]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;Short of paring down my application to a tiny reproducible test case, is there any additional steps I can take to solve this problem?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2019 13:33:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/FreeRTOS-maximum-used-priority-is-unreasonably-big-not/m-p/905593#M3965</guid>
      <dc:creator>Keith4DSmith</dc:creator>
      <dc:date>2019-05-09T13:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: FreeRTOS maximum used priority is unreasonably big, not proceeding</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/FreeRTOS-maximum-used-priority-is-unreasonably-big-not/m-p/905594#M3966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your report, we'll consult SEGGER.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;MCUXpresso IDE Support&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2019 19:11:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/FreeRTOS-maximum-used-priority-is-unreasonably-big-not/m-p/905594#M3966</guid>
      <dc:creator>lpcxpresso_supp</dc:creator>
      <dc:date>2019-05-09T19:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: FreeRTOS maximum used priority is unreasonably big, not proceeding</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/FreeRTOS-maximum-used-priority-is-unreasonably-big-not/m-p/905595#M3967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Keith (and Richard),&lt;/P&gt;&lt;P&gt;there are multiple problems here in my view:&lt;/P&gt;&lt;P&gt;a) it is possible that newer compilers can optimize variables, thus breaking ability to debug with Kernel Awareness. -Lto (Link Time Optimizer) is just such a thing&lt;/P&gt;&lt;P&gt;b)&amp;nbsp;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;Received symbol: uxTopUsedPriority (0x00000000)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; indiacates that this variable has been optimized out by the linker (dead-stripping), so probably the SEGGER Plugin should check that case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have solved this (and other similar problems) with dedicated code preventing the linker to optimize things if they are needed for debugging. For example in the following way:&lt;/P&gt;&lt;PRE class="language-cpp line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;vPortStartFirstTask&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#if configUSE_TOP_USED_PRIORITY || configLTO_HELPER&lt;/SPAN&gt;
  &lt;SPAN class="comment token"&gt;/* only needed for openOCD or Segger FreeRTOS thread awareness. It needs the symbol uxTopUsedPriority present after linking */&lt;/SPAN&gt;
  &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;extern&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;volatile&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;const&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;int&lt;/SPAN&gt; uxTopUsedPriority&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="token function"&gt;__attribute__&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;__unused__&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;volatile&lt;/SPAN&gt; uint8_t dummy_value_for_openocd&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    dummy_value_for_openocd &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; uxTopUsedPriority&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
  &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#endif&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can search for configUSE_TOP_USED_PRIORITY or configLTO_HELPER the FreeRTOS port available on &lt;A class="link-titled" href="https://github.com/ErichStyger/McuOnEclipseLibrary/tree/master/lib/FreeRTOS" rel="nofollow noopener noreferrer" title="https://github.com/ErichStyger/McuOnEclipseLibrary/tree/master/lib/FreeRTOS" target="_blank"&gt;McuOnEclipseLibrary/lib/FreeRTOS at master · ErichStyger/McuOnEclipseLibrary · GitHub&lt;/A&gt;&amp;nbsp; to get an idea. The good news is that I saw recent commits in the FreeRTOS kernel to deal with compiler and linker optimization for post 10.2.0 release. Until then, the above workarounds should do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 May 2019 13:06:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/FreeRTOS-maximum-used-priority-is-unreasonably-big-not/m-p/905595#M3967</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2019-05-10T13:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: FreeRTOS maximum used priority is unreasonably big, not proceeding</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/FreeRTOS-maximum-used-priority-is-unreasonably-big-not/m-p/905596#M3968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Erich.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ah. The&amp;nbsp;variable &lt;SPAN style="font-family: courier new,courier,monospace; font-size: 13px;"&gt;uxTopUsedPriority&lt;/SPAN&gt;&amp;nbsp;and &lt;SPAN style="font-family: Courier New;"&gt;FreeRTOSDebugConfig&lt;/SPAN&gt; do&amp;nbsp;not exist in&amp;nbsp;FreeRTOS 10.0.1, thus the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will look at your 10.2.0 of FreeRTOS and keep alert for a post 10.2.0 version from NXP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It&amp;nbsp;looks like FreeRTOS should expose a version number variable in the list of mandatory variables&amp;nbsp;so the debugging tools can either warn 'version not supported' or adapt to the discovered version.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Keith Smith&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 May 2019 14:56:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/FreeRTOS-maximum-used-priority-is-unreasonably-big-not/m-p/905596#M3968</guid>
      <dc:creator>Keith4DSmith</dc:creator>
      <dc:date>2019-05-10T14:56:30Z</dc:date>
    </item>
    <item>
      <title>Re: FreeRTOS maximum used priority is unreasonably big, not proceeding</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/FreeRTOS-maximum-used-priority-is-unreasonably-big-not/m-p/905597#M3969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Keith,&lt;/P&gt;&lt;P&gt;FreeRTOS includes version number information in task.h:&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="property macro token"&gt;#define tskKERNEL_VERSION_NUMBER "V10.1.1"&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define tskKERNEL_VERSION_MAJOR 10&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define tskKERNEL_VERSION_MINOR 1&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define tskKERNEL_VERSION_BUILD 1&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But these are defines and usually do not end up in the binary, so the debugger has no chance to read that information.&lt;/P&gt;&lt;P&gt;That's why you will find the freertos_tasks_c_addition.h present in the FreeRTOS FreeRTOS:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://github.com/ErichStyger/McuOnEclipseLibrary/blob/master/lib/FreeRTOS/Source/include/freertos_tasks_c_additions.h" rel="nofollow noopener noreferrer" title="https://github.com/ErichStyger/McuOnEclipseLibrary/blob/master/lib/FreeRTOS/Source/include/freertos_tasks_c_additions.h" target="_blank"&gt;McuOnEclipseLibrary/freertos_tasks_c_additions.h at master · ErichStyger/McuOnEclipseLibrary · GitHub&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It contains a struct with all the information needed, including the kernel version. The NXP LPC-Link2/LinkServer does in fact read that information, but the SEGGER J-Link stub does not (at least not from what I can tell, so it would be able to have all the information). The FreeRTOS kernel provides all the mechanisms to provide that information to the debuggers, but it seems only the NXP port (MCUXpresso SDK) takes advantage of that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 May 2019 17:59:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/FreeRTOS-maximum-used-priority-is-unreasonably-big-not/m-p/905597#M3969</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2019-05-10T17:59:25Z</dc:date>
    </item>
  </channel>
</rss>

