No Clock When Using SPI2 on STM32MP157 #48437
Replies: 1 comment 1 reply
-
@georgenyarangi-eaton Indeed alternate clock support (#45053) didn't consider MP1. This would be great if you attempt to solve this. This being said you have some little work ahead. Before describing what has to be done, here are the differences to be considered on MP1 vs other plaftorms
The essence of supporting alternate clocks is to be able to:
Implementing
With zephyr/include/zephyr/dt-bindings/clock/stm32h7_clock.h Lines 13 to 17 in 0456ddc and SPI123_SEL macros defined as zephyr/include/zephyr/dt-bindings/clock/stm32h7_clock.h Lines 95 to 99 in 0456ddc This part will be a bit tedious bit not complex. For the second part, ideally thanks to use of LL APIs such as
This is a little bit crappy. So I'm open to any alternative. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am seeing an issue where when using SPI2 on the STM32MP157 (actually using the OSD32MP157C SiP), there's no SPI clock signal (verified using logic analyzer), and the SPI driver hangs when calling ll_func_tx_is_empty() which ultimately calls into the STM32MP1 SPI driver.
I first observed this issuing using Zephyr release version 3.0.0 and it is present in v3.1. In v3.0.0, putting
LL_RCC_SetSPIClockSource(LL_RCC_SPI23_CLKSOURCE_PER);
inspi_stm32_init()
seems to fix the issue as a workaround.In my investigation, I came across PR #40998 which was a first attempt at fixing the the same issue but for the STM32H7.
What I noticed is that SPI works fine on the STM32MP157C-DK2 discovery kit; however, only SPI4 and SPI5 are pinned out to the connectors, and I used SPI4. Looking at the reference manual for the STM32MP157, the default clock source for SPI4 and 5 is
pclk2
(peripheral clock) in the RCC_SPI45CKSELR (bits 2:0). However, for SPI2 and 3 the default clock source in the RCC_SPI2S23CKSELR (bits 2:0) ispll4_p_ck
.It looks like this issue #41650 which was addressed by PR #45053 added support for configuring alternate clocks; however, it doesn't seem like the STM32MP1 is supported but I could be wrong.
Any insights on how to best fix this issue would be appreciated.
FYI @erwango, @FRASTM, @scottbronkhorst-eaton
Beta Was this translation helpful? Give feedback.
All reactions