From 575ae8ba46c977beab54b6106195a53776c9633a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20J=C3=A4ger?= Date: Sat, 2 May 2026 12:46:50 +0200 Subject: [PATCH] boards: fix clock setup for proper RNG and CAN operation CAN requires the use of the external oscillator instead of LSI. The RNG did not start with the default settings. See also Zephyr upstream commit 768fe29f904463a34138acc1b62e73b04492d2c6. --- boards/libresolar/mppt_2420_hc/mppt_2420_hc.dts | 15 ++++++++++++--- boards/libresolar/mppt_2420_rc/mppt_2420_rc.dts | 15 ++++++++++++--- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/boards/libresolar/mppt_2420_hc/mppt_2420_hc.dts b/boards/libresolar/mppt_2420_hc/mppt_2420_hc.dts index 48879a5..73cc448 100644 --- a/boards/libresolar/mppt_2420_hc/mppt_2420_hc.dts +++ b/boards/libresolar/mppt_2420_hc/mppt_2420_hc.dts @@ -122,17 +122,22 @@ }; }; -&clk_hsi { +&clk_hse { + clock-frequency = ; + status = "okay"; +}; + +&clk_hsi48 { status = "okay"; }; &pll { - div-m = <4>; + div-m = <2>; mul-n = <75>; div-p = <7>; div-q = <2>; div-r = <2>; - clocks = <&clk_hsi>; + clocks = <&clk_hse>; status = "okay"; }; @@ -145,6 +150,8 @@ }; &rng { + clocks = <&rcc STM32_CLOCK(AHB2, 26)>, + <&rcc STM32_SRC_HSI48 CLK48_SEL(0)>; status = "okay"; }; @@ -219,6 +226,8 @@ }; &fdcan1 { + clocks = <&rcc STM32_CLOCK(APB1, 25)>, + <&rcc STM32_SRC_PLL_Q FDCAN_SEL(1)>; pinctrl-0 = <&fdcan1_rx_pa11 &fdcan1_tx_pa12>; pinctrl-names = "default"; bitrate = <500000>; diff --git a/boards/libresolar/mppt_2420_rc/mppt_2420_rc.dts b/boards/libresolar/mppt_2420_rc/mppt_2420_rc.dts index 2dc778d..83a6c97 100644 --- a/boards/libresolar/mppt_2420_rc/mppt_2420_rc.dts +++ b/boards/libresolar/mppt_2420_rc/mppt_2420_rc.dts @@ -115,17 +115,22 @@ }; }; -&clk_hsi{ +&clk_hse { + clock-frequency = ; + status = "okay"; +}; + +&clk_hsi48 { status = "okay"; }; &pll { - div-m = <4>; + div-m = <2>; mul-n = <75>; div-p = <7>; div-q = <2>; div-r = <2>; - clocks = <&clk_hsi>; + clocks = <&clk_hse>; status = "okay"; }; @@ -138,6 +143,8 @@ }; &rng { + clocks = <&rcc STM32_CLOCK(AHB2, 26)>, + <&rcc STM32_SRC_HSI48 CLK48_SEL(0)>; status = "okay"; }; @@ -226,6 +233,8 @@ }; &fdcan1 { + clocks = <&rcc STM32_CLOCK(APB1, 25)>, + <&rcc STM32_SRC_PLL_Q FDCAN_SEL(1)>; pinctrl-0 = <&fdcan1_rx_pa11 &fdcan1_tx_pa12>; pinctrl-names = "default"; bitrate = <500000>;