cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F401 Nucleo SPI Clock problem, using STM32CubeF4

ishmeetsinghis
Associate II
Posted on July 01, 2014 at 15:16

I am using SPI1 with HAL low level drivers, STM32CubeF4.

I have used the following SPI configuration:-

    

SPI_HandleTypeDef hspi;

hspi.Instance=SPI1;

hspi.Init.Mode=SPI_MODE_MASTER;

hspi.Init.Direction=SPI_DIRECTION_2LINES;

hspi.Init.DataSize=SPI_DATASIZE_8BIT;

hspi.Init.CLKPolarity=SPI_POLARITY_HIGH;

hspi.Init.CLKPhase=SPI_PHASE_1EDGE;

hspi.Init.NSS=SPI_NSS_SOFT;

hspi.Init.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_256;

hspi.Init.FirstBit=SPI_FIRSTBIT_MSB;

hspi.Init.TIMode=SPI_TIMODE_ENABLED;

hspi.Init.CRCCalculation=SPI_CRCCALCULATION_DISABLED;

hspi.Init.CRCPolynomial=0;

HAL_SPI_Init(&hspi);

After sending some bytes on MOSI. On logic analyzer, I see clock and MOSI data are mismatched. 

This is a very zoomed in pic, If required I can send the whole logic analyzer file.

0690X00000605NUQAY.png

Please help.

2 REPLIES 2
Amel NASRI
ST Employee
Posted on July 17, 2014 at 11:45

Please avoid submitting the same issue in 2 forums (

https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Java/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/STM32Java/STM32F401%20Nucleo%20SPI%20Clock%20problem%2c%20using%20STM32CubeF4

).

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

ishmeetsinghis
Associate II
Posted on July 18, 2014 at 06:37

Hi Mayla,

Thank you for pointing it, I will make sure I do not repost a question again.

Please, can you also look at the question and provide some direction or some insights. This would be very helpfull.

Thanks