Skip to main content
BAdam.2
Visitor II
January 16, 2022
Question

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

  • January 16, 2022
  • 1 reply
  • 1599 views

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.

This topic has been closed for replies.

1 reply

PatrickF
Technical Moderator
January 17, 2022

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.NEW ! Sidekick STM32 AI agent, see here