cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 SPI Communication - Last MISO Bit not received

thomas239955_st
Associate
Posted on October 15, 2014 at 10:33

Hello,

I use a STM32F4-DISCOVERY Board in master mode, which should communicate with a slave via SPI. Basically, the communication is working, but the last bit on the MISO line is always lost. For example, if I receive 0x2E1F (as you can see in the attached picture, purple is MISO, blue is CLK), which would be correct, the STM32F4 recognizes it as 0x2E1E, the last bit is wrong. I tried this with multiple requests, same result. The LSB is always seen as 0.

MOSI data is correct. Clock polarity is also correct.

Has anybody of you already experienced similar problems or has an idea of how to fix this?

Greetings

Thomas

P.S.: The rather complex code is because i tried to split the data word into 2 Bytes for transmission, hoping it would fix my problem, but the result stays the same.

#stm32f4-spi-miso
5 REPLIES 5
thomas239955_st
Associate
Posted on October 15, 2014 at 15:13

Thank you very much!

Haven't figured out what it was yet, but after reading your first link, I also tried to use SPI2 port instead instead of SPI1 and now it works correctly!

Seems like there is a general problem with SPI1 in these cases...
alibabashack
Associate
Posted on September 01, 2016 at 12:36

I experienced the exact same behaviour. I am a bit disappointed that this hardware bug is not part of the STM32F42xx and STM32F43xx Errata Sheet. However, I just realized that the problem and possible solutions are given in the STM32F373xx Errata Sheet in section 2.4.5 ''Last data bit or CRC calculation may be corrupted for the data received in SPI/I2S master mode depending on the feedback communication clock timing with respect to the APB clock''.

PLEASE add this to the STM32F42xx and STM32F43xx Errata Sheet to spare your costumers gritting their teeth. Its not that bad to admit there is a bug.

Amel NASRI
ST Employee
Posted on September 27, 2016 at 12:17

Hi,

I agree that this SPI related limitation is missing in the F4 errata sheets. It will be added in new versions of this document.

Thank you for highlighting the issue, and Sorry for any inconvenience it may bring for you.

-STM32 Forums Moderator

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.