Hi,
Could you post a code example where this behavior is triggered? repeated spiStart()?
If possible post also your SPI configuration structure.
You fix is clear, is the root cause that is not clear. Perhaps the driver should implement the whole (overly complicated) SPI disable procedure described in the reference manual.
Code: Select all
1. Wait until FTLVL[1:0] = 00 (no more data to transmit).
2. Wait until BSY=0 (the last data frame is processed).
3. Disable the SPI (SPE=0).
4. Read data until FRLVL[1:0] = 00 (read all the received data).
Even with your fix, only steps 2 and 3 are implemented. I think steps 1 and 4 are not necessary because DMA TX is over and DMA RX has already counted the expected number of RX frames.
Giovanni