In a low power app where I chase for minimizing consumption, when I disable entirely STM32_HSI48 , compilation fail.
If STM32_HSI48_ENABLED is set to FALSE, it's impossible to define STM32_CLK48SEL to either value (NOCLOCK par exemple), so
STM32_CLK48SEL take the default value which is STM32_CLK48SEL_PLL. Then the test of clock validity fail.
Here is my proposal patch :
Code: Select all
diff --git a/os/hal/ports/STM32/STM32L4xx/hal_lld.h b/os/hal/ports/STM32/STM32L4xx/hal_lld.h
index a40bc2b96..16b0ce0d1 100644
--- a/os/hal/ports/STM32/STM32L4xx/hal_lld.h
+++ b/os/hal/ports/STM32/STM32L4xx/hal_lld.h
@@ -1182,7 +1182,7 @@
/*
* PLL enable check.
*/
-#if (STM32_CLK48SEL == STM32_CLK48SEL_PLL) || \
+#if (STM32_HSI48_ENABLED && (STM32_CLK48SEL == STM32_CLK48SEL_PLL)) || \^M
(STM32_SW == STM32_SW_PLL) || \
(STM32_MCOSEL == STM32_MCOSEL_PLL) || \
(STM32_SAI1SEL == STM32_SAI1SEL_PLL) || \
It permit to compile, but nevertheless i have to comment STM32_CLK48SEL define in mcuconf.h, which is not orthogonal with other settings, it would be better to be able to set it to a NOCLK value.
Alexandre