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.

AM5716: UART RX idle and DMA transfer

Part Number: AM5716


Hello everybody ,

I would like to have   a  DMA transfer on UART RX event alongside with RX IDLE condition interrupt.

However, the Sitara reference manual says that the time-out interrupt (related to RX IDLE) the counter counts only when there is some data in RX FIFO.

but  the DMA is always fetching data from the RX FIFO, so I understand that I ll never get the RX IDLE interrupt .

am I right ?

any workaround available ?

thank you

regards

Carlo


  • Hi Carlo,

    What software is this? Which version?
  • Hi Biser ,
    I'm in TIRTOS , but it is a custom code ., a custom idea
    my goal is how can I handle this ?, in my understanding from datasheet it is not feasible no interrupt will be there .
    please am I right ?
    regards
    carlo
  • Thanks. I have notified the RTOS team. They will comment here.
  • Carlo,

    Colombo Carlo said:

    However, the Sitara reference manual says that the time-out interrupt (related to RX IDLE) the counter counts only when there is some data in RX FIFO.

    but  the DMA is always fetching data from the RX FIFO, so I understand that I ll never get the RX IDLE interrupt .


    I have looped in a spec expert to help with this question. Let me share my thoughts based on the my read of the spec and the expert can provide additional feedback. If you check the RX FIFO interrupt request generation mechanism (Fig 24-60) and the Receive FIFO DMA request generation Fig (24-62) then it seems that DMA is triggered for fetching data from RX FIFO only when the programmable threshold is reached.

    The TX and RX FIFO threshold defined in UART_TLR register is used to trigger the DMA transfers from FIFO. If you can have a situation where there is data in FIFO which has not hit the threshold then the timeout RX IDLE will be triggered when there is a line break.

    Regards,
    Rahul

  • Hi Rahul
    please could you elaborate a little more your suggestion ? I do not understand it .
    I would like a DMA transfer and as far as I understand I can only get a RX IDEL interrupt , but no DMA transfer : how to get it ?
    thank you very much
    regards
    Carlo
  • Carlo,

    In your first E2E post, you indicated that RX IDLE interrupt will never occur when DMA is transferring from RX FIFO. My response was clarification for your interpretation of the TRM and to indicate that RX IDLE interrupt even if DMA is transferring data from RX FIFO. Could you elaborate why the customer usecase requires DMA to transfer data when timeout or line break error occurs?

    I am checking internally if there is any way by which RX_IDLE can be used to trigger DMA transfer directly.

    Regards,
    Rahul

  • HI Rahul ,
    I got more details on the topics , I did not formulate the question properly .
    about RX_Idle interrupt : it looks from TRM section 24.3.4.8.1.3.7.1 "Timer Out counter" that the time-out interrupt will work properly ONLY if there are DATA in FIFO .
    so in case I need DMA to transfer every single byte ( watermark to 1 for FIFO ) , FIFO will be always empty so no RX_idle ever : am I right ?
    I need RX_idle interrupt to launch a task to check data sequence receveid is correct .
    please how can I solve this ? any suggestion ?
    thank you very much
    regards
    carlo
  • Carlo,

    From my read of the spec, RX idle will not be generated when every byte is transferred by the DMA but I have looped in the HW/design spec expert to confirm this interpretation.

    Other than the RX Idle interrupt, the customer also has a timeout configuration in the UART LLD that can be used for the read APIs. This is used in polling mode or blocking mode to prevent the UART LLD pending on semaphore forever and to exit the transaction with an error if data is not received in a given time interval. There is an implementation of time out functionality in the UART LLD Test in the function UART_test_timeout. If the UART_read2 transaction return an error due to timeout then you can go and read the data sequence to see if the sequence was received correctly.

    Please review the UART LLD timeout implementation if this can work for your customer to handle this error condition.

    Regards,
    Rahul
  • Hi Carlo,

    As Rahul already indicated, RX idle will not be generated when every byte is transferred by the DMA.

    Regards,
    Melissa
  • HI Rahul , Melissa ,
    OK so let me cross chek if LLD timeout can be ok in my app
    thank you
    regards
    Carlo
  • Hi Rahul ,
    please coudl you point me to the example you gave me ?
    i went to C:\ti\pdk_am57xx_1_0_9\packages\ti\drv\uart\test\src but not able to find the function you are mentioning
    please coudl you point also in TRM where to see this ?
    thank you veyr much
    regards
    Carlo
  • Carlo,

    The test to checkout timeout implementation with UART LLD driver is provided in the source file in the location that you care looking at :

    pdk_am57xx_1_0_10\packages\ti\drv\uart\test\src\main_uart_test

    Look for the function UART_test_timeout in that file. the time out configured by adding the following to the transaction:

    transaction.timeout = UART_TEST_TIMEOUT;

    This timeout implementation is software implementation of timeout for a UART transaction so there is no reference to this in the AM572x TRM.  In the UART LLD API and configuration you can refer to the transaction structure here:

    pdk_am57xx_1_0_10/packages/ti/drv/uart/docs/doxygen/html/struct_u_a_r_t___transaction__s.html

    Regards,

    Rahul