cancel
Showing results for 
Search instead for 
Did you mean: 

Differences between F411RE and F767ZI SPI interfaces?

RH38
Associate II

Hi,
I am accessing a DRV8873s motor driver (SPI version) on two different NUCLEO boards. My usage is limited to reading data from 2 registries.
I got it to work on a NUCLEO-STM32F411RE using SPI2, with the following settings:
Motorola format, 8 bits, MSB first, prescaler 32 to get a 1.5625 Mbits/s rate, CPOL = low and CPHA = 2Edge.Now I try to do the same with a NUCLEO-STM32F767ZI and the same code and configuration (apart from the baud rate, set to 1.6875 MHz) don't work anymore.
I have tried SPI4 and SPI5 on this board with the same result: the data read by HAL_SPI_TransmitReceive is not correct.
Is there a difference in the way STM32F4 and STM32F7 perform SPI communication, or in the electronics?

 

1 ACCEPTED SOLUTION

Accepted Solutions
RH38
Associate II

Hi,

I rebuilt my circuit from scratch using a NUCLEO-F411RE and a NUCLEO-F767ZI with the same symptoms until... I discovered that one of the Dupont connectors I was using with the latter was faulty!
Shame on me!
So both NUCLEO boards DO work identically when I use the HAL layer.
False alarm, sorry about that...

 

View solution in original post

6 REPLIES 6
Andrew Neil
Super User

Welcome to the forum.

Please see How to write your question to maximize your chances to find a solution for best results.

 


@RH38 wrote:

I got it to work on a NUCLEO-STM32F411RE using SPI2 ... with a NUCLEO-STM32F767ZI and the same code and configuration (apart from the baud rate, set to 1.6875 MHz) don't work anymore.


Have you used an oscilloscope and/or logic analyser to see what (if anything) is happening on the wires?

Have you tried a basic SPI example for the F7 board?

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
TDK
Super User

The peripherals are different but the abstracted HAL_SPI_TransmitReceive call is the same for both. Show your code. Probably something else going on.

If you feel a post has answered your question, please click "Accept as Solution".

Thanks for the reply

first point: I have no instrument to see if the signals are correct or not. If the default persists I'll have to spy these signals with another card (I have several)

second point: I am currently studying the F7 example for SPI in polling mode, and I can't find any difference with what I (think I) do. I am going to try a basic communication between two cards for a start.

I keep on trying!

 

RH38
Associate II

Thanks for the reply

Yes, this is why I prefer using HAL functions; btw the same code runs on a G474RE board as well. As my project is rather complex, it is probably a good idea that I restart from scratch with just this SPI comm to eliminate side effects

 

RH38
Associate II

Hi,

I rebuilt my circuit from scratch using a NUCLEO-F411RE and a NUCLEO-F767ZI with the same symptoms until... I discovered that one of the Dupont connectors I was using with the latter was faulty!
Shame on me!
So both NUCLEO boards DO work identically when I use the HAL layer.
False alarm, sorry about that...

 

Great - so please mark your post as the solution;

Instructions here: https://community.st.com/t5/community-guidelines/help-others-to-solve-their-issues/ta-p/575256

 


@RH38 wrote:

I discovered that one of the Dupont connectors I was using with the latter was faulty!


This is why it's so important to look at the hardware as well as the software!

And, thus, why it's so important to have hardware testgear - an oscilloscope would quickly have spotted this.

 

#NeedAScope #HarwareMatters

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.