<?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>i.MX ProcessorsのトピックRe: imx7d, UART data loss on M4</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/imx7d-UART-data-loss-on-M4/m-p/1023521#M151258</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi igorpadykov,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Thanks for your reply!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For your question:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 1. W&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;hy do you think that data losing is caused by i.MX7D M4?&amp;nbsp;&lt;SPAN&gt;Who receives uart data?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; In my experiment (1) &amp;amp; (2), the receive side are identical, a NxP K64 MCU keeps receiving the UART data sent by imx7D(M4) and check if that data is correct.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; The only difference is in (1), the A7 is working and in (2) the A7 does nothing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 2. T&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;ry to disable uart dma (if it used) and try to use polling option&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; In my current implementation, I am using polling to send out UART data on M4. And make sure every byte is put to the UART FIFO after the previous byte is sent out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the UART send function I am using, please check the code snippet below:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;static void UART_SendDataPolling(UART_Type *base, const uint8_t *tx_buff, uint32_t tx_size)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; while (tx_size--)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; while (!UART_GetStatusFlag(base, uartStatusTxComplete));&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; UART_Putchar(base, *tx_buff++);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; // Make sure all the data are sent out&lt;BR /&gt;&amp;nbsp; &amp;nbsp; while (!UART_GetStatusFlag(base, uartStatusTxComplete));&lt;BR /&gt;}&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks~&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Mar 2020 01:06:46 GMT</pubDate>
    <dc:creator>marcuscw_liang</dc:creator>
    <dc:date>2020-03-30T01:06:46Z</dc:date>
    <item>
      <title>imx7d, UART data loss on M4</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx7d-UART-data-loss-on-M4/m-p/1023519#M151256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; I am now working on the heterogeneous processors on the i.mx7D. In my system, Linux runs on the dual A7 core and a bare-metal OS runs on the M4 core.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;M4 bare-metal&amp;gt;&lt;/P&gt;&lt;P&gt;For the bare-metal OS, the task is very simple, use&amp;nbsp;UART4 to send out 64 bytes of data with 4000000 baudrate every 500us.&lt;/P&gt;&lt;P&gt;So on M4, I tried to set the RDC peripheral access permission to let only m4 can access it.&lt;/P&gt;&lt;P&gt;// on M4&lt;/P&gt;&lt;P&gt;#define BOARD_DOMAIN_ID&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;(1)&lt;/P&gt;&lt;P&gt;RDC_SetDomainID(RDC, rdcMdaM4, BOARD_DOMAIN_ID, false);&lt;/P&gt;&lt;P&gt;RDC_SetPdapAccess(RDC, rdcPdapUart4, (3 &amp;lt;&amp;lt; (BOARD_DOMAIN_ID * 2)), false, false);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;A7 Linux&amp;gt;&lt;/P&gt;&lt;P&gt;In the Linux, I also remove the UART4 driver from the dts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So now, it seems only the M4 can access the UART4. And I did some experiment:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(1) A7 Linux working, and M4 sends data periodically&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Some of the data sent by the m4 are losing.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;It takes only few seconds to find data are losing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(2) Shutdown Linux on A7, and then let M4 start sending data periodically&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Let the M4 sends data for couple of hours, and not a byte is lost.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could anyone give some advice on this issue, or did I miss some settings?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Mar 2020 02:30:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx7d-UART-data-loss-on-M4/m-p/1023519#M151256</guid>
      <dc:creator>marcuscw_liang</dc:creator>
      <dc:date>2020-03-27T02:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: imx7d, UART data loss on M4</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx7d-UART-data-loss-on-M4/m-p/1023520#M151257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi 昶煒 梁&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;why do you think that data losing is caused by i.MX7D M4,&lt;/P&gt;&lt;P&gt;for example it may be lost on receiving side. Who receives uart data.&lt;/P&gt;&lt;P&gt;One can try to disable uart dma (if it used) and try to use polling option.&lt;/P&gt;&lt;P&gt;In case when A7 Linux working ddr bandwidth may be consuming by A7,&lt;/P&gt;&lt;P&gt;not leaving M4 sufficient speeds when accessing ddr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;BR /&gt;igor&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Mar 2020 00:22:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx7d-UART-data-loss-on-M4/m-p/1023520#M151257</guid>
      <dc:creator>igorpadykov</dc:creator>
      <dc:date>2020-03-28T00:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: imx7d, UART data loss on M4</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx7d-UART-data-loss-on-M4/m-p/1023521#M151258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi igorpadykov,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Thanks for your reply!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For your question:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 1. W&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;hy do you think that data losing is caused by i.MX7D M4?&amp;nbsp;&lt;SPAN&gt;Who receives uart data?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; In my experiment (1) &amp;amp; (2), the receive side are identical, a NxP K64 MCU keeps receiving the UART data sent by imx7D(M4) and check if that data is correct.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; The only difference is in (1), the A7 is working and in (2) the A7 does nothing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 2. T&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;ry to disable uart dma (if it used) and try to use polling option&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; In my current implementation, I am using polling to send out UART data on M4. And make sure every byte is put to the UART FIFO after the previous byte is sent out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the UART send function I am using, please check the code snippet below:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;static void UART_SendDataPolling(UART_Type *base, const uint8_t *tx_buff, uint32_t tx_size)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; while (tx_size--)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; while (!UART_GetStatusFlag(base, uartStatusTxComplete));&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; UART_Putchar(base, *tx_buff++);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; // Make sure all the data are sent out&lt;BR /&gt;&amp;nbsp; &amp;nbsp; while (!UART_GetStatusFlag(base, uartStatusTxComplete));&lt;BR /&gt;}&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks~&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2020 01:06:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx7d-UART-data-loss-on-M4/m-p/1023521#M151258</guid>
      <dc:creator>marcuscw_liang</dc:creator>
      <dc:date>2020-03-30T01:06:46Z</dc:date>
    </item>
  </channel>
</rss>

