This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3354: Interrupt cycle for completing DMA reception of RS-485

Part Number: AM3354


Hi,

Is it possible to change the interrupt cycle for completing DMA reception to less than 1ms?
Or can this be achieved by not using DMA?

The purpose is to send the response data within 1ms to the data received from RS-485.
But, at present, this cannot be achieved because the interrupt function for completing DMA reception (Linux UART driver: __dma_rx_do_complete()) is called at a cycle of about 6 ms.
Below, as described in "19.3.6.1.2 Receive FIFO Trigger" of the "Technical Reference Manual",
although it has been changed to 1 character, the interrupt function for completing DMA reception is called at a cycle of about 6ms.

Also, when DMA is disabled ("CONFIG_SERIAL_8250_DMA" is disabled in menu config), the interrupt function for completing DMA reception (serial8250_handle_irq()) is called at a cycle of about 4.7ms.

---
[Processor]: AM3354BZCZA60
[target boad]: Custom board created by us
[SDK Version]: Processor SDK Linux(06_01_00_08)
※URL: software-dl.ti.com/.../Overview_Building_the_SDK.html

[uart baudrate]: 187500 bps
[uart driver]: 8250_omap
[Interrupt function for DMA reception completion]: __dma_rx_do_complete()、serial8250_handle_irq()
[RS-485 comunication]: switch half duplex and full duplex on boot

[Technical Reference Manual]:
※URL: www.ti.com/.../spruh73q.pdf
19.3.6.1.2 Receive FIFO Trigger
※1 character (UART_SCR[7]=1、UART_TLR[7:4]=0、RX FIFO Trigger Level=1)
19.3.6.2 FIFO Interrupt Mode
19.4.1.1.2 FIFOs and DMA Settings
19.5.1.11 FCR Register
19.5.1.24 TLR Register
19.5.1.39 SCR Register
---

  • Hi, 

    You have done a very good analysis. I will provide some suggestions that you will have to decide if they will be beneficial for your application. Low latency RS-485 is a challenge for Linux.

    - While you mentioned Linux are you using the RT kernel version? This will increase the determinism of thread processing but may not improve your response time. It will provide a means to raise thread priorities. 

    - What does you DTS file look like? Are you enabling the RS-485 feature of the UART driver?

    Best Regards,

    Schuyler

  • Hi Schuyler,

    Thank you for your replying.

    - While you mentioned Linux are you using the RT kernel version? This will increase the determinism of thread processing but may not improve your response time. It will provide a means to raise thread priorities. 

    We don't use RT kernel now.
    - What does you DTS file look like? Are you enabling the RS-485 feature of the UART driver?


    We are enabling the RS-485 feature of the UART driver.
    ====
    &uart2 {
    pinctrl-names = "default";
    pinctrl-0 = <&uart2_pins>;
    status = "okay";
    uart-ctrl-rs485;
    };
    ====

    --
    Best regards,
    Jun

  • Hi, 

    Would you be able to try using the RT kernel and drivers?  Are you working with a custom board or a TI EVM? Are you using an SD card or eMMC?

    Best Regards,

    Schuyler

  • Hi,

    We are working with a custom board. We are using a SD card.

    We will try using the RT kernel, drivers and eMMC.

    Best Regards,

    Jun

  • Hi,

    We think the interrupt cycle of the case 2 shorter than the case 1.
    But the interrupt cycle at about 6ms in both cases, why?

    case 1) Default value of RX_TRIGGER in 8250_omap.c is 48.
    RX_TRIGGER = 48

    Registers set to below.
    SCR[7]:1
    FCR[7-6]:00 (RX_FIFO_TRIG)
    TLR[7-4]:1100 (RX_FIFO_TRIG_DMA)

    DMA interrupts when FIFO receive 48 characters.

    case 2) Change value of RX_TRIGGER in 8250_omap.c to 4.
    RX_TRIGGER = 4;

    Registers set to below.
    SCR[7]:1
    FCR[7-6]:00 (RX_FIFO_TRIG)
    TLR[7-4]:0001 (RX_FIFO_TRIG_DMA)

    DMA interrupts when FIFO receive 4 characters.

    ex) 32 characters and 16 characters.


    We think that the interrupt cycle is like the above image.
    But, the both interrupt cycles are almost same time. 

    Best Regards,

    Jun

  • Hi,

    What is the baud rate that you are using? There are a couple of things we are going to work and will get back to you over the next day or two.

    Best Regards,

    Schuyler

  • Hi, 

    We are using baud rate 187500 bps.

    Best Regards,

    Jun

  • Hi,

    We resolved this issue. Thanks.

    Jun