cancel
Showing results for 
Search instead for 
Did you mean: 

Uart DMA IDLE vs FreeRtos tasks

oeliks
Senior

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?

1 ACCEPTED SOLUTION

Accepted Solutions
FBL
ST Employee

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.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.


I'm out of offce with limited access to my emails.
Happy New Year!

View solution in original post

2 REPLIES 2
FBL
ST Employee

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.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.


I'm out of offce with limited access to my emails.
Happy New Year!

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).