2024-01-02 04:27 AM
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?
Solved! Go to Solution.
2024-01-03 02:44 AM
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.
2024-01-03 02:44 AM
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.
2024-01-04 12:04 AM
Thanks for the answer! Adjusting oscilloscope sampling rate did the trick - it was way to low for 2MHz frequency