AM2434: am243x-lp

Part Number: AM2434
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Subject: UART RS485 Data Corruption at 230400 Baud on AM243X-LP

Hello all,

While working with the AM243X-LP, I encountered an issue with UART data reception over RS485 when handling long messages (more than 1000 characters). In certain cases, some received bytes are altered — for example, bit 7 appears stuck at 1.

Yesterday, the same issue occurred with a much shorter message (around 50 bytes) at a baud rate of 230400. This was also on an RS485 communication line. This time, the error was clearly on the receiver side.

I verified the data using an external monitor:

  • The monitor received the message without errors.

  • The AM243X-LP received data with checksum errors.

This suggests that the data corruption is happening inside the MCU's receive process.

Questions:

  1. What could cause this kind of UART data corruption on the AM243X-LP?

  2. Could adding an additional wait state to the FIFO read access help mitigate the problem?

Any insights or recommendations would be greatly appreciated.

Thank you,

  • Hi,

    • What could cause this kind of UART data corruption on the AM243X-LP?

    • Could adding an additional wait state to the FIFO read access help mitigate the problem?

    Have you tested out for Interrupt, Polling and DMA as well?

    I am also considering you are on the latest SDK while you are testing this out.

    Thanks,

    Vaibhav

  • hi Vaibhavi

    i am working with pooling for all uarts. i have 150us timer interrupt. and i read and write fifo after fifo.

    during the interrupt service routine i disable all interrupt. the timing is good and i still as receive error.

    thanks baruch

  • Hi Vaibhav 

    i am working with pooling mode only. i have 150us interrupt hand i handle the uarts receive and transmite fifo by the interrupt handler. 

    about the SDL i am starting with mcu_plus_sdk_am243x_10_01_00_32

    thanks

    baruch

  • Greetings Baruch,

    about the SDL i am starting with mcu_plus_sdk_am243x_10_01_00_32

    I do not see any driver difference between this SDK and the current latest SDK, so the possibility of any bug fix is ruled out in this scenario.

    Also, I understand your flow is to simply read from the RS485.

    Can you make sure the baud rate of RS485 is <+- 1.5% of the UART's baudrate?

    Also, the UART Write operation is ruled out, hence lets focus on the UART read call.

    Can you set the rx trigger level in the SysConfig GUI to a lower value like 1 or 8 and test this out?

    Can you share the MPU ARMv7 configurations as well?

    Looking forward to your response.

    Thanks,

    Vaibhav

  • Dear Vaibhav,

    My working method is to interface directly with the UART registers. Every 150 µs, I read the contents of each UART FIFO and handle both the TX and RX FIFOs for each UART. As mentioned earlier, the error occurs in the external loop.

    The programming process starts with SysConfig, which I have reviewed and found to be correct. However, regarding the baud rate of 230,400 bps — I cannot adjust it while maintaining an acceptable tolerance. This is because we generate the baud rate clock with a factor of 16, and any change results in a baud rate error. With a 48 MHz UART clock, the error exceeds 7%, which is too high. Even with a 192 MHz UART clock, the error remains around 2%.

    I have not found any clear reason for these issues. The program is not functioning correctly, and I am unsure what else to try. no timing problems and no error messages

    I can send you an example so you can reproduce the error and review it alongside my code.

    Thank you,
    Baruch

  • Dear Vaibhav,

    During my last attempt to debug the issue, I changed the baud rate from 3,000,000 to 115,200. At that point, I noticed a single error at the last character. Using the oscilloscope, I observed that the expected character was 0x9F, but the transmitted character was 0xAF. This indicates the problem is related to a TX error.

    In my state machine, I made a modification: I removed the last state and reduced the size of the final sub-message written to the RX FIFO. To my surprise, this resolved the error—though I don’t fully understand why.

    The following code works correctly:

    if (tx_fifo_place > output_message_length[uart_id])
         tx_fifo_place = output_message_length[uart_id];
    for (send_index = 0; send_index < tx_fifo_place; send_index++)
    { tx_save_tx_buff[uart_id][tx_save_tx_buff_index[uart_id]++] = *uart_data_to_send[uart_id]; UART_hwregs[uart_id]->RBR_THR_DLL = (uint32_t)*uart_data_to_send[uart_id]++; }
    output_message_length[uart_id] -= tx_fifo_place;

    However, the following version causes the error:

    if (tx_fifo_place < output_message_length[uart_id])
    {
    for (send_index = 0; send_index < tx_fifo_place; send_index++)
    {
      tx_save_tx_buff[uart_id][tx_save_tx_buff_index[uart_id]++] = *uart_data_to_send[uart_id];
      UART_hwregs[uart_id]->RBR_THR_DLL = (uint32_t)*uart_data_to_send[uart_id]++;
    }
      output_message_length[uart_id] -= tx_fifo_place;
    }
    else
    {
    for (send_index = 0; send_index < output_message_length[uart_id]; send_index++)
    {
      tx_save_tx_buff[uart_id][tx_save_tx_buff_index[uart_id]++] = *uart_data_to_send[uart_id];
      UART_hwregs[uart_id]->RBR_THR_DLL = (uint32_t)*uart_data_to_send[uart_id]++;
    }
      output_message_length[uart_id] = 0;
    }

    In both implementations, I save a copy of the message just before writing each byte into the TX FIFO, and no errors appear there.

    I don’t yet understand why the first modification resolves the issue.

    Thank you,
    Baruch