cancel
Showing results for 
Search instead for 
Did you mean: 

FIFO Error on DMA with SPI_TX (STM32F411E-DISCO)

Devashish_Lahariya
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions
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".

View solution in original post

4 REPLIES 4
TDK
Guru

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

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?

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

Hey Man! Thanks It was probably because of me using 20cm Jumper Wires, Now I've switched to 10cm Jumpers and it works as expected.