cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP151C SPI5 clock much slower

vsaakian
Associate III

I am trying to configure SPI5 on STM32MP151C where MPU is a master and ESP32C6 is a slave. The clock used in the device tree is HSI 64MHz. SPI driver is running with 2MHz configured and divisor in the SPI_CFG1 register is correctly set to 32. In the dmesg logs I could see that speed is set to 2MHz. 

What is actually measured with oscilloscope on a clk out is approximately a 1/1000 of configured frequency, around 1.8 kHz. Furthermore duty cycle is clearly not a 50%. 

Would appreciate any ideas what might be wrong. Could it be some other function configured on that same pin used for clock? Problem in the device tree?

1 ACCEPTED SOLUTION

Accepted Solutions
PatrickF
ST Employee

HI @vsaakian 

 

First exclude measurement issue (too low sampling rate on oscilloscope).

 

Did you really look at CLK ? Is your pinmux ok ? Is your board OK ? The signal you are seen might be not the right one (e.g. SPI NSS or else)

Maybe have a look to this page (for UART, but most should apply to SPI)
https://wiki.st.com/stm32mpu/wiki/Trace_and_debug_scenario_-_UART_issue#Checking_the_clocks

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

View solution in original post

2 REPLIES 2
PatrickF
ST Employee

HI @vsaakian 

 

First exclude measurement issue (too low sampling rate on oscilloscope).

 

Did you really look at CLK ? Is your pinmux ok ? Is your board OK ? The signal you are seen might be not the right one (e.g. SPI NSS or else)

Maybe have a look to this page (for UART, but most should apply to SPI)
https://wiki.st.com/stm32mpu/wiki/Trace_and_debug_scenario_-_UART_issue#Checking_the_clocks

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

Thanks for the answer! Adjusting oscilloscope sampling rate did the trick - it was way to low for 2MHz frequency