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.

AM2434: Running UART with DMA in non-blocking mode without and ISR

Part Number: AM2434


Tool/software:

Hi,

I'm trying to get the UART running with the DMA in non-blocking mode.
I already found the example of the Low-Level Driver in the SDK, and it was really helpful.

The question is that I don't want to use Interrupts as I already handle the buffers internally.
I want the UART and DMA requests to just run whenever they are called without calling a completion interrupt.

Is there any way to do this?
I already tried to put the Callback as NULL in the parameters.
But it's not the correct way to do it as it gets the code to fail in the runtime.

Thank you in advance.

  • Hello ,

    I am just trying to understand if you don't need the UART DMA interrupt callback.

    Then how did you confirm the DMA operation is completed? Again when do start the DMA .

    I really don't understand your requirement to go to the DMA without a callback.

    If you are going into blocking mode, then the control is still be in the semaphore pending till completion of the DMA. Is that not helpful to your requirement ?

    Regards,

    Anil.

  • Hi, Anil,

    Sorry for the lack of details. Actually, the requirement says that I shouldn't have an interrupt, but I also need to check if the DMA has completed before calling the next send request (in the transmission), and I need to check that the DMA Receive buffer is empty before sending a request to receive more. So, my question can be split into two parts:

    1. How to get the UART with DMA working without a callback?
    2. How to check that the DMA has completed the transmission?

    P.S.: I have an idea that I can disable the interrupt itself using HwiP_DisableInt();, but I didn't try that yet actually.

    Thank you for your response.
    Waiting for another Slight smile

  • Hello Hatem Salah,

    For the above question, we need to custom implement the UART + DMA driver.

    There is an Udma_eventRegister API which does enable an interrupt. So, comment on this function, the DMA works in polling mode only.

    After this change, compile the drivers.

    Next, every time you need to poll udma_dequeraw function, it either completes the transaction or not. Once this is done, you can start the new transaction.

    Please look at the uart_DMA_ISR routine. In this code we perform these functionality  only.

    Please let me know if you face any issues.

    Regards,

    Anil.

  • That was really helpful. Thank you so much.