<?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: Error in FreeRTOS UART Example Application? in MCUXpresso General</title>
    <link>https://community.nxp.com/t5/MCUXpresso-General/Error-in-FreeRTOS-UART-Example-Application/m-p/1024812#M3157</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp; &lt;A _jive_internal="true" class="" data-content-finding="Community" data-userid="32736" data-username="mykepredkomimetics" href="https://community.nxp.com/people/mykepredkomimetics"&gt;Myke&lt;/A&gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for your feedback. I will report this to the software team.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Mar 2020 11:38:35 GMT</pubDate>
    <dc:creator>danielchen</dc:creator>
    <dc:date>2020-03-30T11:38:35Z</dc:date>
    <item>
      <title>Error in FreeRTOS UART Example Application?</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/Error-in-FreeRTOS-UART-Example-Application/m-p/1024811#M3156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm following the TWRK21F "freertos_uart" example application and I just noticed that in the code, the setup/initial transmit APIs are written as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;if (0 &amp;gt; UART_RTOS_Init(&amp;amp;handle, &amp;amp;t_handle, &amp;amp;uart_config))&lt;BR /&gt; {&lt;BR /&gt; vTaskSuspend(NULL);&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;/* Send introduction message. */&lt;BR /&gt; if (0 &amp;gt; UART_RTOS_Send(&amp;amp;handle, (uint8_t *)to_send, strlen(to_send)))&lt;BR /&gt; {&lt;BR /&gt; vTaskSuspend(NULL);&lt;BR /&gt; }&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;In this code, the "vTaskSuspend(NULL); statements will only execute IFF the return value is less than zero (ie negative).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I look at the source code (in fsl_uart_freertos.c), the return values are defined (in fsl_common.h) as:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;enum _generic_status&lt;BR /&gt;{&lt;BR /&gt; kStatus_Success = MAKE_STATUS(kStatusGroup_Generic, 0),&lt;BR /&gt; kStatus_Fail = MAKE_STATUS(kStatusGroup_Generic, 1),&lt;BR /&gt; kStatus_ReadOnly = MAKE_STATUS(kStatusGroup_Generic, 2),&lt;BR /&gt; kStatus_OutOfRange = MAKE_STATUS(kStatusGroup_Generic, 3),&lt;BR /&gt; kStatus_InvalidArgument = MAKE_STATUS(kStatusGroup_Generic, 4),&lt;BR /&gt; kStatus_Timeout = MAKE_STATUS(kStatusGroup_Generic, 5),&lt;BR /&gt; kStatus_NoTransferInProgress = MAKE_STATUS(kStatusGroup_Generic, 6),&lt;BR /&gt;};&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;As the return values will never be less than zero, won't the return tests for the APIs never become active?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shouldn't the first block of code be something like one of the two checks below?&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (0 != UART_RTOS_Init(&amp;amp;handle, &amp;amp;t_handle, &amp;amp;uart_config))&amp;nbsp; //&amp;nbsp; Not Equal to Zero&lt;BR /&gt;{&lt;BR /&gt;vTaskSuspend(NULL);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/* Send introduction message. */&lt;BR /&gt;if (UART_RTOS_Send(&amp;amp;handle, (uint8_t *)to_send, strlen(to_send)))&amp;nbsp; //&amp;nbsp; More Efficient way of detecting != Zero&lt;BR /&gt;{&lt;BR /&gt;vTaskSuspend(NULL);&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2020 18:17:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/Error-in-FreeRTOS-UART-Example-Application/m-p/1024811#M3156</guid>
      <dc:creator>myke_predko</dc:creator>
      <dc:date>2020-03-26T18:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: Error in FreeRTOS UART Example Application?</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/Error-in-FreeRTOS-UART-Example-Application/m-p/1024812#M3157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp; &lt;A _jive_internal="true" class="" data-content-finding="Community" data-userid="32736" data-username="mykepredkomimetics" href="https://community.nxp.com/people/mykepredkomimetics"&gt;Myke&lt;/A&gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for your feedback. I will report this to the software team.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2020 11:38:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/Error-in-FreeRTOS-UART-Example-Application/m-p/1024812#M3157</guid>
      <dc:creator>danielchen</dc:creator>
      <dc:date>2020-03-30T11:38:35Z</dc:date>
    </item>
  </channel>
</rss>

