<?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: KSDK + MQX + UART recommended way? in Kinetis Software Development Kit</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KSDK-MQX-UART-recommended-way/m-p/447915#M3040</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did get the fsl_uart_drivers to work.&amp;nbsp; I didn't have a cpu.c as the MQX Acting weird article suggested. However, when I initialize by UART, I added the following line:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NVIC_SetPriority(UART4_RX_TX_IRQn, 2);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(there was debate whether it should be 2 or 0x80), but after putting that in place things worked as expected.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Aug 2015 01:21:03 GMT</pubDate>
    <dc:creator>rajbatra</dc:creator>
    <dc:date>2015-08-20T01:21:03Z</dc:date>
    <item>
      <title>KSDK + MQX + UART recommended way?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KSDK-MQX-UART-recommended-way/m-p/447913#M3038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've spent the day trying to figure out the best way to implement UART code on my KDS leveraging MQX on my K64F and am more confused than ever.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Should I be using the NIO drivers which according to this link: &lt;A _jive_internal="true" data-containerid="11234" data-containertype="14" data-objectid="351714" data-objecttype="1" href="https://community.nxp.com/thread/351714"&gt;Is there a document detailing the use of the KSDK “I/O subsystem (NIO)” device drivers?&lt;/A&gt;&amp;nbsp; are not documented for KSDK (and comment made to abandon the KSDK approach) or should I use the fsl_uart_driver methods as provided in the KSDK examples folder? There's been discussion that the uart drivers in KSDK isn't so smooth with MQX (&lt;A _jive_internal="true" data-containerid="2023" data-containertype="14" data-objectid="352874" data-objecttype="1" href="https://community.nxp.com/thread/352874"&gt;UART Rx (callback) Makes MQX Weird)) &lt;/A&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate any advice on the matter,&lt;/P&gt;&lt;P&gt;-Raj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 00:55:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KSDK-MQX-UART-recommended-way/m-p/447913#M3038</guid>
      <dc:creator>rajbatra</dc:creator>
      <dc:date>2015-08-19T00:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: KSDK + MQX + UART recommended way?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KSDK-MQX-UART-recommended-way/m-p/447914#M3039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Quick update - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Today, I tried using the fsl_uart_drivers (UART_DRV_SendData/ReceiveData (both blocking and non-blocking)). It would run for a very short time, and then I would see that the task utilizing the uart would go into the MQX_UNHANDLED_INTERRUPT (0x41) state.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It maybe a bug on my side but not sure. If anyone has successfully used the UART_DRV_SendData/ReceiveData with MQX/KSDK or could point me to an example that would help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will now try the NIO driver and see if it gives me better results.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 22:48:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KSDK-MQX-UART-recommended-way/m-p/447914#M3039</guid>
      <dc:creator>rajbatra</dc:creator>
      <dc:date>2015-08-19T22:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: KSDK + MQX + UART recommended way?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KSDK-MQX-UART-recommended-way/m-p/447915#M3040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did get the fsl_uart_drivers to work.&amp;nbsp; I didn't have a cpu.c as the MQX Acting weird article suggested. However, when I initialize by UART, I added the following line:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NVIC_SetPriority(UART4_RX_TX_IRQn, 2);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(there was debate whether it should be 2 or 0x80), but after putting that in place things worked as expected.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2015 01:21:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KSDK-MQX-UART-recommended-way/m-p/447915#M3040</guid>
      <dc:creator>rajbatra</dc:creator>
      <dc:date>2015-08-20T01:21:03Z</dc:date>
    </item>
    <item>
      <title>Re: KSDK + MQX + UART recommended way?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KSDK-MQX-UART-recommended-way/m-p/447916#M3041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After a day of stress testing, I found that MQX crashes intermittently where the task handling the UART goes into MQX_UNHANDLED_INTERRUPT state.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My uartInitialize() method which I can during the _create_task() is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error uartInitialize(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NVIC_SetPriority(UART4_RX_TX_IRQn, 1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //OSA_InstallIntHandler(UART4_RX_TX_IRQn, UART4_RX_TX_IRQHandler); (Wasn't sure if this was necessary - didn't help!)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Initialize the uart module with base address and config structure&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (kStatus_UART_Success !=&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UART_DRV_Init(UART4_IDX, &amp;amp;uartState, &amp;amp;uartConfig))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SEGGER_RTT_printf(0, "UART Failed to initialize! Exiting.\r\n");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return(ERROR);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SEGGER_RTT_printf(0, "UART initialized.\r\n");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return(NO_ERROR);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I'm new to KSDK and MQX, this has been challenging. Does anyone have a working example of talking to UART4 with KSDK and MQX that they can share?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Aug 2015 00:44:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KSDK-MQX-UART-recommended-way/m-p/447916#M3041</guid>
      <dc:creator>rajbatra</dc:creator>
      <dc:date>2015-08-21T00:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: KSDK + MQX + UART recommended way?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KSDK-MQX-UART-recommended-way/m-p/447917#M3042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I found the issue as my stress testing for over an hour has not produced one MQX_UNHANDLED_INTERRUPT error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notice above that I had named my interrupt handler UART4_RX_TX_IRQHandler, well reading more carefully the app note from Jorge Gonzalez 'Interrupt_handling_KSDK.pdf' it states:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #000000; font-family: Helvetica; font-size: 12px;"&gt;&lt;SPAN style="font-size: 11pt; font-family: 'Calibri,Bold';"&gt;1- &lt;/SPAN&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri;"&gt;Due to the MQX RTOS interrupt handling mechanism, the names of the ISR entry functions &lt;SPAN style="color: #e32400;"&gt;must be different than those in the CMSIS startup code file (&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #e32400;"&gt;&lt;SPAN style="font-size: 11pt; font-family: 'Calibri,Bold';"&gt;startup_&amp;lt;device&amp;gt;.S&lt;/SPAN&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri;"&gt;), otherwise the kernel ISR is not called when the corresponding interrupt triggers.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #000000; font-family: Helvetica; font-size: 12px;"&gt;&lt;SPAN style="font-size: 11pt; font-family: 'Calibri,Bold';"&gt;2- &lt;/SPAN&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri;"&gt;A valid approach is to copy the corresponding &lt;/SPAN&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri;"&gt;“&lt;/SPAN&gt;&lt;SPAN style="font-size: 11pt; font-family: 'Calibri,Bold';"&gt;fsl_&amp;lt;peripheral&amp;gt;_irq.c&lt;/SPAN&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri;"&gt;” &lt;/SPAN&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri;"&gt;file to the application and renaming the ISR entry functions by adding &lt;/SPAN&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri;"&gt;“MQX” at the beginning (e.g. MQX_&lt;/SPAN&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri;"&gt;I2C0_IRQHandler).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri;"&gt;So, I renamed the handler to MQX_UART4_RX_TX_IRQHandler and things seem to be OK.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri;"&gt;I'll mark this as correct unless I find something different. &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Aug 2015 00:30:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KSDK-MQX-UART-recommended-way/m-p/447917#M3042</guid>
      <dc:creator>rajbatra</dc:creator>
      <dc:date>2015-08-22T00:30:05Z</dc:date>
    </item>
  </channel>
</rss>

