imx7d, UART data loss on M4

Showing results for 
Search instead for 
Did you mean: 

imx7d, UART data loss on M4

Contributor II

Hi all,

    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.

<M4 bare-metal>

For the bare-metal OS, the task is very simple, use UART4 to send out 64 bytes of data with 4000000 baudrate every 500us.

So on M4, I tried to set the RDC peripheral access permission to let only m4 can access it.

// on M4

#define BOARD_DOMAIN_ID                         (1)

RDC_SetDomainID(RDC, rdcMdaM4, BOARD_DOMAIN_ID, false);

RDC_SetPdapAccess(RDC, rdcPdapUart4, (3 << (BOARD_DOMAIN_ID * 2)), false, false);

<A7 Linux>

In the Linux, I also remove the UART4 driver from the dts.

So now, it seems only the M4 can access the UART4. And I did some experiment:

(1) A7 Linux working, and M4 sends data periodically

     Some of the data sent by the m4 are losing.

     It takes only few seconds to find data are losing.

(2) Shutdown Linux on A7, and then let M4 start sending data periodically

     Let the M4 sends data for couple of hours, and not a byte is lost.

Could anyone give some advice on this issue, or did I miss some settings?


Labels (2)
0 Kudos
2 Replies

NXP TechSupport
NXP TechSupport

Hi 昶煒 梁 

why do you think that data losing is caused by i.MX7D M4,

for example it may be lost on receiving side. Who receives uart data.

One can try to disable uart dma (if it used) and try to use polling option.

In case when A7 Linux working ddr bandwidth may be consuming by A7,

not leaving M4 sufficient speeds when accessing ddr.

Best regards
Note: If this post answers your question, please click the Correct Answer button. Thank you!

0 Kudos

Contributor II

Hi igorpadykov, 

      Thanks for your reply!


For your question:

      1. Why do you think that data losing is caused by i.MX7D M4? Who receives uart data?

      In my experiment (1) & (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.


      The only difference is in (1), the A7 is working and in (2) the A7 does nothing.

      2. Try to disable uart dma (if it used) and try to use polling option

      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.

For the UART send function I am using, please check the code snippet below: 

static void UART_SendDataPolling(UART_Type *base, const uint8_t *tx_buff, uint32_t tx_size)
    while (tx_size--)
        while (!UART_GetStatusFlag(base, uartStatusTxComplete));
        UART_Putchar(base, *tx_buff++);

    // Make sure all the data are sent out
    while (!UART_GetStatusFlag(base, uartStatusTxComplete));


0 Kudos