cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L475 SPI Behaviour

dtarrago
Senior
Posted on September 01, 2017 at 11:26

Hello,

In the new design I'm working with, the STM32L475 device uses SPI interface in order to communicate with a transceiver. This transceiver is used in other designs without problems and it must act as SPI-master, so STM32L4 SPI must work in slave mode.

Most of the times, SPI interface is working fine, but sometimes we get communication errors. We have checked the SPI frames and we have noticed some bits displacements when a failure occurs. This is quite strange, because SPI bus is working a very slow rate: 250Kbit/s.

In what regards SPI tracks on PCB: SPI lines are quite short and they are very close to STM32. They go from the STM32 to H1-AgroBee connector (look below): the place where the transceiver is connected. SPI lines have not any shunt capacitors: they only have serial resistors (now they are 0 Ohm) in order to filter spikes. We have been doing some testing by adding some shunt capacitors, but behaviour is the same.

Please, find here below top and bottom layers of this PCB where the SPI area is rounded.

0690X00000603mDQAQ.jpg0690X0000060446QAA.jpg

Do you have any idea why we are getting this behaviour with SPI?

Best regards,

Dani. 

#spi #smt32l475
1 REPLY 1
Posted on September 01, 2017 at 11:40

we have noticed some bits displacements when a failure occurs.

Please be more specific.

This is quite strange, because SPI bus is working a very slow rate: 250Kbit/s.

The major gotcha with SPI and other clocked data transmission schemes is, that problems are usually not related to the transmission speed but to the slew rate of signals' edges.

Try increasing or decreasing the SCK's 'speed' in GPIO_OSPEEDR.

JW