cancel
Showing results for 
Search instead for 
Did you mean: 

Using the STM32CubeMX, How to enable kernel clock source for SPI1 ?

BAdam.2
Associate

I am enabling SPI1 controller and selecting PLL3Q as its kernel clock source on CubeMX. But automatic code is not generated for it.

It looks like #DEFINES for SPI1 do not exist in stm32mp1-clksrc.h, while they do exist for other SPI controllers.

1 REPLY 1
PatrickF
ST Employee

Hi @BAdam.2​ ,

in Cortex-M4 project, you should see SPI1 clock init in HAL_SPI_MspInit(), only used in Development Mode (i.e. without Linux).

In Linux DT, you should see CLK_SPI2S1_PLL3Q line in stm32mp157f-yourproject-mx-u-boot.dtsi

please check you have :

&m4_spi1{
 
 ...
 
   status = "okay";
 
}

in stm32mp157f-yourproject-mx.dts

but also that you don't have any &spi1 node status = "okay" (as SPI1 must not be enabled for Linux if assigned to M4)

Check also that pll3 is correctly defined in DT.

Usually, this work out of the box with CubeMx generated DT.

Regards.

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