cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F303 SPI1 slave

chris239955_stm1
Associate
Posted on March 11, 2014 at 19:18

Hello,

I am using the STM32F303 with SPI1 in slave mode and no data packing.  I am seeing an issue where I will get an interrupt when a byte is received, but the status register says that there is nothing in the receive FIFO.  My interrupt loops over and reads from the receive FIFO as long as it is not empty.  The byte is never recovered from the FIFO in future interrupts. 

A little bit about my test setup - I have a GPIO line which goes high when entering the interrupt handler and low when leaving the interrupt handler.  I have another GPIO line which toggles every time a byte is read from the receive FIFO.  Most of the time the lines toggle as I would expect them to - as the interrupt GPIO is high, other other GPIO toggles.  Once in a while though the GPIO for reading from the FIFO does not toggle after getting the interrupt.  I tried switching from SPI1 to SPI2 and have not seen the issue in this setup.

Has anyone had an issue similar to this using SPI1 in slave mode?

Chris
2 REPLIES 2
Posted on March 12, 2014 at 10:38

Are you sure you don't experience overruns? Check  SPIx_SR.OVR.

JW
Amel NASRI
ST Employee
Posted on March 12, 2014 at 10:59

Chris,

You can share your code for check also.

-Mayla-

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.