<?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: Enabling FreeMASTER to work with FreeRTOS in FreeMASTER</title>
    <link>https://community.nxp.com/t5/FreeMASTER/Enabling-FreeMASTER-to-work-with-FreeRTOS/m-p/1534907#M1179</link>
    <description>&lt;P&gt;Thanks for the help&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/34487"&gt;@MichalH&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;I tested using a counter to check if the FMSTR_Poll is called, and watched the fmstr_rxQueue/Buff variables. The counter was not incremented and the variables did not change when I tried to connect to FreeMASTER.&lt;BR /&gt;After some testing, it seems that the ADC interrupt is starving the RTOS tasks. To give more context:&lt;BR /&gt;The ADC interrupt is executed each 100us and is responsible for the execution of the state machine fast loop which should not be interrupted even by other interrupt routines.&amp;nbsp;&lt;BR /&gt;A quad timer is used with a period of 1ms, when its interrupt is executed it defers to a task to execute the state machine slow loop routine.&lt;BR /&gt;- freeRTOS Clock rate:&amp;nbsp;528000000UL (system default)&lt;BR /&gt;- freerTOS Tick rate: tried 1k-10k-100k&lt;/P&gt;&lt;P&gt;What should I do in this case?&lt;/P&gt;</description>
    <pubDate>Mon, 10 Oct 2022 13:39:54 GMT</pubDate>
    <dc:creator>Haitham_Ismail</dc:creator>
    <dc:date>2022-10-10T13:39:54Z</dc:date>
    <item>
      <title>Enabling FreeMASTER to work with FreeRTOS</title>
      <link>https://community.nxp.com/t5/FreeMASTER/Enabling-FreeMASTER-to-work-with-FreeRTOS/m-p/1534741#M1176</link>
      <description>&lt;P&gt;I am trying to port the PMSM motor control example application to freeRTOS on the imxrt1050. After implementing the main routines in freeRTOS tasks, I cannot establish a connection to the FreeMASTER desktop client. Following the communication driver user guide and this question (&lt;A href="https://community.nxp.com/t5/FreeMASTER/Freemaster-FreeRtos/m-p/1283261" target="_blank" rel="noopener"&gt;https://community.nxp.com/t5/FreeMASTER/Freemaster-FreeRtos/m-p/1283261&lt;/A&gt;), I did these steps:&lt;BR /&gt;1. Switched to FMSTR_SHORT_INTR&lt;BR /&gt;2. Set FMSTR_COMM_RQUEUEM_SIZE to 32&lt;BR /&gt;3. Created a low-priority RTOS task that calls FMSTR_Poll() in its loop, the task runs only when other tasks are in blocked state (it has priority = tskIDLE_PRIORITY+1).&lt;BR /&gt;&lt;BR /&gt;What am I missing?&lt;BR /&gt;Thanks in advance for any help&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 09:50:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/FreeMASTER/Enabling-FreeMASTER-to-work-with-FreeRTOS/m-p/1534741#M1176</guid>
      <dc:creator>Haitham_Ismail</dc:creator>
      <dc:date>2022-10-10T09:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: Enabling FreeMASTER to work with FreeRTOS</title>
      <link>https://community.nxp.com/t5/FreeMASTER/Enabling-FreeMASTER-to-work-with-FreeRTOS/m-p/1534814#M1177</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/203832"&gt;@Haitham_Ismail&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;your modifications look correct to me except a minor typo: the correct name of the macro is FMSTR_COMM_RQUEUE_SIZE.&amp;nbsp;&amp;nbsp;Can you add some counter variable or some other mechanism to make sure the FMSTR_Poll is indeed called in the low-priority task at least once a while? Also, check if you call the FMSTR_Init at the beginning of the task.&lt;/P&gt;
&lt;P&gt;After trying to connect with FreeMASTER tool, you could also check the fmstr_rxQueue and fmstr_rxBuff variables (static in freemaster_serial.c) to see if there are any data bytes received.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Michal&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 11:29:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/FreeMASTER/Enabling-FreeMASTER-to-work-with-FreeRTOS/m-p/1534814#M1177</guid>
      <dc:creator>MichalH</dc:creator>
      <dc:date>2022-10-10T11:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: Enabling FreeMASTER to work with FreeRTOS</title>
      <link>https://community.nxp.com/t5/FreeMASTER/Enabling-FreeMASTER-to-work-with-FreeRTOS/m-p/1534907#M1179</link>
      <description>&lt;P&gt;Thanks for the help&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/34487"&gt;@MichalH&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;I tested using a counter to check if the FMSTR_Poll is called, and watched the fmstr_rxQueue/Buff variables. The counter was not incremented and the variables did not change when I tried to connect to FreeMASTER.&lt;BR /&gt;After some testing, it seems that the ADC interrupt is starving the RTOS tasks. To give more context:&lt;BR /&gt;The ADC interrupt is executed each 100us and is responsible for the execution of the state machine fast loop which should not be interrupted even by other interrupt routines.&amp;nbsp;&lt;BR /&gt;A quad timer is used with a period of 1ms, when its interrupt is executed it defers to a task to execute the state machine slow loop routine.&lt;BR /&gt;- freeRTOS Clock rate:&amp;nbsp;528000000UL (system default)&lt;BR /&gt;- freerTOS Tick rate: tried 1k-10k-100k&lt;/P&gt;&lt;P&gt;What should I do in this case?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 13:39:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/FreeMASTER/Enabling-FreeMASTER-to-work-with-FreeRTOS/m-p/1534907#M1179</guid>
      <dc:creator>Haitham_Ismail</dc:creator>
      <dc:date>2022-10-10T13:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: Enabling FreeMASTER to work with FreeRTOS</title>
      <link>https://community.nxp.com/t5/FreeMASTER/Enabling-FreeMASTER-to-work-with-FreeRTOS/m-p/1534922#M1180</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;So it means there is some other (higher priority) task still running without ever going to sleep - probably the slow-loop task.&lt;/P&gt;&lt;P&gt;You might try to examine the slow-loop task if it ever executes any wait-for-event code. If I understand it well, the quad timer ISR sets an event to wakeup the slow-loop task. The task should process the interrupt and go back to wait state, otherwise it will never give a runtime to anything else.&lt;/P&gt;&lt;P&gt;Alternatively, you could switch the freemaster driver to use FMSTR_LONG_INTR mode. In this mode, all communication is taking place in the UART interrupt, so you would not need to solve the task prioritization issue. But this is more a workaround. I think that what you describe indicates that there is some problem in your task scheme and you should investigate whether your tasks run as you planned.&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Michal&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 13:52:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/FreeMASTER/Enabling-FreeMASTER-to-work-with-FreeRTOS/m-p/1534922#M1180</guid>
      <dc:creator>MichalH</dc:creator>
      <dc:date>2022-10-10T13:52:54Z</dc:date>
    </item>
  </channel>
</rss>

