<?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>Kinetis MicrocontrollersのトピックRe: K60F120M 3 Mbps Uart RX / DMA user watchout if using KSDK LDD</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60F120M-3-Mbps-Uart-RX-DMA-user-watchout-if-using-KSDK-LDD/m-p/616490#M36748</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Henry,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for pointing out the PE bug.&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;XiangJun Rong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Feb 2017 03:26:24 GMT</pubDate>
    <dc:creator>xiangjun_rong</dc:creator>
    <dc:date>2017-02-13T03:26:24Z</dc:date>
    <item>
      <title>K60F120M 3 Mbps Uart RX / DMA user watchout if using KSDK LDD</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60F120M-3-Mbps-Uart-RX-DMA-user-watchout-if-using-KSDK-LDD/m-p/616489#M36747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am doing an evaluation of the data path: CPU =&amp;gt; uart_0_tx =&amp;gt; external loopback through RS485 =&amp;gt; uart_0_rx =&amp;gt; DMA =&amp;gt; memory where the Uart is transferring at 3 mbps as required by application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used LDD from Kinetis and instantiated DMA channel_ldd, uart_ldd. &amp;nbsp;They worked fine at lower baud rate but start failing at higher baud rate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking carefully, i came to noticed that the uart0 Tx RX is combined in an ISR (KSDK implementation).&lt;/P&gt;&lt;P&gt;When there is a slight changes in ISR service latency timing such that RX is ready and TX is ready at the same time when ISR is executed, the codes &lt;SPAN&gt;accidentally read the RX FIFO&amp;nbsp;&lt;/SPAN&gt;and thus causing the DMA request to be out of sync. &amp;nbsp;the received data is missed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This happens regardless if C2[RIE] and C5[RDMAS] are both set. &amp;nbsp;The interrupt is triggered only by TX fifo condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have to comment out that section of codes and the program works ok.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i would like to give this feedback to NXP so that this can be improved on next revision and&amp;nbsp;&lt;SPAN&gt;may potentially save debugging times for other user.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;uart.c file:&lt;/P&gt;&lt;P&gt;========&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PE_ISR(HSB_Interrupt)&lt;BR /&gt;{&lt;BR /&gt; /* {Default RTOS Adapter} ISR parameter is passed through the global variable */&lt;BR /&gt; HSB_TDeviceDataPtr DeviceDataPrv = INT_UART0_RX_TX__DEFAULT_RTOS_ISRPARAM;&lt;BR /&gt; register uint32_t StatReg = UART_PDD_ReadInterruptStatusReg(UART0_BASE_PTR); /* Read status register */&lt;/P&gt;&lt;P&gt;if (StatReg &amp;amp; (UART_S1_NF_MASK | UART_S1_OR_MASK | UART_S1_FE_MASK | UART_S1_PF_MASK)) { /* Is any error flag set? */&lt;BR /&gt; (void)UART_PDD_GetChar8(UART0_BASE_PTR); /* Dummy read 8-bit character from receiver */&lt;BR /&gt; StatReg &amp;amp;= (uint32_t)(~(uint32_t)UART_S1_RDRF_MASK); /* Clear the receive data flag to discard the errorneous data */&lt;BR /&gt; }&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Buggy part:&lt;BR /&gt; // comment out the RDRF check. This is done by KSDK because it shares the same TX and RX ISR.&lt;BR /&gt; // in this ISR, if the timing of the ISR service latency in such that the RX flag and TX flag active at the same time when&lt;/P&gt;&lt;P&gt;// ISR is branched to, then, this ISR wrongly read the RX Data and cause DMA request to be dropped and out of sync.&lt;/P&gt;&lt;P&gt;// this happens regardless if C2[RIE] and C5[RDMAS] are both set. &amp;nbsp;The interrupt is triggered only by TX fifo condition,&lt;/P&gt;&lt;P&gt;// but accidentally read the RX FIFO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;EM&gt;&lt;STRONG&gt;// &amp;nbsp; if (StatReg &amp;amp; UART_S1_RDRF_MASK) { /* Is the receiver's interrupt flag set? */&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;EM&gt;&lt;STRONG&gt; // &amp;nbsp; &amp;nbsp; &amp;nbsp;InterruptRx(DeviceDataPrv); /* If yes, then invoke the internal service routine. This routine is inlined. */&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;EM&gt;&lt;STRONG&gt; // &amp;nbsp;}&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; if (DeviceDataPrv-&amp;gt;SerFlag &amp;amp; ENABLED_TX_INT) { /* Is the transmitter interrupt enabled? */&lt;BR /&gt; if (StatReg &amp;amp; UART_S1_TDRE_MASK) { /* Is the transmitter empty? */&lt;BR /&gt; InterruptTx(DeviceDataPrv); /* If yes, then invoke the internal service routine. This routine is inlined. */&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vector.c file:&lt;/P&gt;&lt;P&gt;=========&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(tIsrFunc)&amp;amp;Cpu_Interrupt, /* 0x3C 0x000000F0 - ivINT_UART0_LON unused by PE */&lt;BR /&gt; (tIsrFunc)&lt;SPAN style="text-decoration: underline;"&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;amp;HSB_Interrupt,&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt; /* 0x3D 0x000000F4 8 ivINT_UART0_RX_TX used by PE */&lt;BR /&gt; (tIsrFunc)&lt;SPAN style="text-decoration: underline;"&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;amp;HSB_Interrupt&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;, /* 0x3E 0x000000F8 12 ivINT_UART0_ERR used by PE */&lt;BR /&gt; (tIsrFunc)&amp;amp;Cpu_Interrupt, /* 0x3F 0x000000FC - ivINT_UART1_RX_TX unused by PE */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Henry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2017 04:46:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60F120M-3-Mbps-Uart-RX-DMA-user-watchout-if-using-KSDK-LDD/m-p/616489#M36747</guid>
      <dc:creator>henrynguyen</dc:creator>
      <dc:date>2017-02-09T04:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: K60F120M 3 Mbps Uart RX / DMA user watchout if using KSDK LDD</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60F120M-3-Mbps-Uart-RX-DMA-user-watchout-if-using-KSDK-LDD/m-p/616490#M36748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Henry,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for pointing out the PE bug.&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;XiangJun Rong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Feb 2017 03:26:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60F120M-3-Mbps-Uart-RX-DMA-user-watchout-if-using-KSDK-LDD/m-p/616490#M36748</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2017-02-13T03:26:24Z</dc:date>
    </item>
  </channel>
</rss>

