Skip to main content
Visitor II
May 19, 2025
Solved

Differences between F411RE and F767ZI SPI interfaces?

  • May 19, 2025
  • 3 replies
  • 632 views

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?

 

    This topic has been closed for replies.
    Best answer by RH38

    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...

     

    3 replies

    Super User
    May 19, 2025

    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?

    RH38Author
    Visitor II
    May 19, 2025

    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!

     

    Super User
    May 19, 2025

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

    RH38Author
    Visitor II
    May 19, 2025

    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

     

    RH38AuthorAnswer
    Visitor II
    May 22, 2025

    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...

     

    Super User
    May 22, 2025

    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