cancel
Showing results for 
Search instead for 
Did you mean: 

SPI documentation mismatch with CubeMX

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

4 REPLIES 4
Imen.D
ST Employee
Posted on March 28, 2017 at 13:41

Hi Andrei,

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

Regards

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Jeanne Joly
Senior III
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

Posted on August 16, 2017 at 09:41

CubeMX

 V1.0 

Version 4.22.0 still has the same problem
BodGregg
Associate

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.