Skip to main content
Graduate II
January 3, 2024
Solved

Uart DMA IDLE vs FreeRtos tasks

  • January 3, 2024
  • 1 reply
  • 1090 views

Hi! If I have a running FreeRtos task that for example is sending data with SPI, will ILDE event (callback) from uart dma affect the SPI? If so how to prevent this and at the same time dont lose data from uart?

    This topic has been closed for replies.
    Best answer by FBL

    Hello @oeliks 

    If both peripherals are not using the same resources (DMA channel or interrept ..) and both executing in the same task, this will depend on the speed of the SPI bus and the size of the data being transferred. For example, for small data transfers, such as 4 bytes, using DMA may be excessive overhead. In this case a spin wait may be reasonable. For faster SPI bus, this approach may not be feasible.

    1 reply

    FBLAnswer
    Technical Moderator
    January 3, 2024

    Hello @oeliks 

    If both peripherals are not using the same resources (DMA channel or interrept ..) and both executing in the same task, this will depend on the speed of the SPI bus and the size of the data being transferred. For example, for small data transfers, such as 4 bytes, using DMA may be excessive overhead. In this case a spin wait may be reasonable. For faster SPI bus, this approach may not be feasible.

    oeliksAuthor
    Graduate II
    January 4, 2024

    Thanks for answer.

     

    SPI is running in task. UART is not running in any task. When it detects idle it triggers callback function that is executed. I don't know how to compare priority of this idle callback function to task (task that is running SPI has known priority).