Skip to main content
Devashish_Lahariya
Associate
February 26, 2022
Solved

FIFO Error on DMA with SPI_TX (STM32F411E-DISCO)

0693W00000KadWDQAZ.pngHello Everyone, I am trying to transmit data using DMA with SPI1 but each time I end up with a FIFO Error.. I 'm using Direct mode, MINC = 1, PINC = 0, DMA2, STREAM3, CHANNEL 3 For SPI_TX. I'm trying to send "Hello, World!!" But each time the FEIF3 is set. Each Time the FEIF3 Flag in the DMA2->LISR is set and the data gets corrupted & Garbage data is sent.

 #STM32F4​ #DMA​ #SPI​ #FIFO #FIFO_ERROR

This topic has been closed for replies.
TDK
TDKBest answer
February 26, 2022
Probably noise due to long leads, cross talk, or other external interference. You can apply a glitch filter on your logic analyzer to get rid of them. See if they line up with an edge on MOSI.
"If you feel a post has answered your question, please click ""Accept as Solution""."

4 replies

TDK
February 26, 2022

Why is your ENABLE pin toggling? Looks like the data is otherwise fine. You should treat the CS pin as a GPIO and toggle it manually before/after the transfer. I don't think the FIFO ERROR flag is relevant if you're using direct mode, but not sure why it's getting set either. Perhaps show the code.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Devashish_Lahariya
Associate
February 26, 2022

I am using Software Slave Management. Even I don't know why the CS Pin is toggling like that. I Pull it LOW before the Transmission & Pull it HIGH Again in the DMA2_Stream3_IRQHandler() after checking the the TCIF3 Flag in the DMA2 -> LISR Register. As you said I have checked and the Data seems to be correct but due to the CS Pin being toggled randomly the Logic Analyzer Displays wrong data values. What could be the reason for the GPIO CS Toggle?

TDK
TDKBest answer
February 26, 2022
Probably noise due to long leads, cross talk, or other external interference. You can apply a glitch filter on your logic analyzer to get rid of them. See if they line up with an edge on MOSI.
"If you feel a post has answered your question, please click ""Accept as Solution""."