[riot-notifications] [RIOT-OS/RIOT] boards/stm32l4/wb: add Kconfig for clock configuration (#14968)

Leandro Lanzieri notifications at github.com
Mon Nov 9 08:46:27 CET 2020


By introducing a switch (`CUSTOM_PLL_PARAMS`) we can allow the user to tweak the PLL parameters, if not they just get the defaults:
```diff
diff --git a/cpu/stm32/kconfigs/Kconfig.clk b/cpu/stm32/kconfigs/Kconfig.clk
index c7bba5f322..b65d40a351 100644
--- a/cpu/stm32/kconfigs/Kconfig.clk
+++ b/cpu/stm32/kconfigs/Kconfig.clk
@@ -48,8 +48,13 @@ endchoice
 endif  # CPU_FAM_L4 || CPU_FAM_L5 || CPU_FAM_WB
 
 if CPU_FAM_G0 || CPU_FAM_G4 || CPU_FAM_L4 || CPU_FAM_L5 || CPU_FAM_WB
+
+config CUSTOM_PLL_PARAMS
+    bool "Configure PLL parameters"
+    depends on USE_CLOCK_PLL
+
 config CLOCK_PLL_M
-    int "M: PLLIN division factor" if USE_CLOCK_PLL
+    int "M: PLLIN division factor" if USE_CLOCK_PLL && CUSTOM_PLL_PARAMS
     default 1 if CPU_FAM_G0
     default 6 if CPU_FAM_G4 && BOARD_HAS_HSE
     default 4 if CPU_FAM_G4
@@ -61,7 +66,7 @@ config CLOCK_PLL_M
     range 1 16 if CPU_FAM_G4
 
 config CLOCK_PLL_N
-    int "N: PLLIN multiply factor" if USE_CLOCK_PLL
+    int "N: PLLIN multiply factor" if USE_CLOCK_PLL && CUSTOM_PLL_PARAMS
     default 16 if CPU_FAM_WB && CLOCK_PLL_SRC_HSE
     default 32 if CPU_FAM_WB && CLOCK_PLL_SRC_HSI
     default 20 if CPU_FAM_WB && CLOCK_PLL_SRC_MSI
@@ -73,7 +78,7 @@ config CLOCK_PLL_N
 
 if CPU_FAM_G0 || CPU_FAM_WB
 config CLOCK_PLL_R
-    int "Q: VCO division factor" if USE_CLOCK_PLL
+    int "Q: VCO division factor" if USE_CLOCK_PLL && CUSTOM_PLL_PARAMS
     default 2 if CPU_FAM_WB
     default 6 if BOARD_HAS_HSE
     default 5
```
Is that the behaviour you expect?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/14968#issuecomment-723830548
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20201108/e39e6db1/attachment-0001.htm>


More information about the notifications mailing list