Skip to main content
Andrei Chichak
Lead
March 26, 2017
Question

SPI documentation mismatch with CubeMX

  • March 26, 2017
  • 3 replies
  • 1875 views
Posted on March 26, 2017 at 23:53

I'm using CubeMX 4.19.0 for STM32F407G-DISC1 and firmware for STM32F4 version 1.14.0. (yes I realize there is an update).

When setting up an SPI port, one of the parameters is CPHA, the clock phasing. You have to declare whether the slave will have stable data on the rising or falling phase of the clock edge.

RM0090 has this parameter as CPHA=0|1. Cube has the Clock Phase parameter being 1 edge or 2 edge. Umm, one edge or two, that doesn't make any sense.

If I dig deeper into RM0090, the explanation of CPHA says:

0: The first clock transition is the first data capture edge

1: The second clock transition is the first data capture edge

Cube needs an explanation in the description area saying which is which. I expect that Cube means first edge and second edge, which almost matches RM0090.

In it's current form, Cube is making me write this request rather than guiding me to the proper setting.

Andrei

    This topic has been closed for replies.

    3 replies

    Technical Moderator
    March 28, 2017
    Posted on March 28, 2017 at 13:41

    Hi Andrei,

    Thank you for your feedback, I will raise your request internally.

    Regards

    Imen

    In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
    Jeanne Joly
    Associate
    April 28, 2017
    Posted on April 28, 2017 at 15:21

    Hi

    Chichak.Andrei

    ,

    Thanks for reporting this point.

    The fix I did for this post will be available in the next CubeMX release (4.21). It will be available soon.

    BR. Eric

    omer Korech
    Visitor II
    August 16, 2017
    Posted on August 16, 2017 at 09:41

    CubeMX

     V1.0 

    Version 4.22.0 still has the same problem
    Visitor II
    November 8, 2023

    Sorry for replying a thread posted 6 years ago. This reply is for new readers brought over by Google.

    I tried SPI transfer using both Edge 1 and Edge 2 options while putting the SCK and MOSI signals on an oscilloscope, the results are:

    The Edge 1 option corresponds to CPHA=0;

    The Edge 2 option corresponds to CPHA=1.

    Hope it helps.