After closer inspection I found that this feature is wrongfully disabled in the stm32_registery in the hal.
According to the datasheet the HSI48 can be enabled
6.2.4 HSI48 clock (only valid for STM32L49x/L4Ax devices)
The HSI48 clock signal is generated from an internal 48 MHz RC oscillator and can be used
directly for USB and for random number generator (RNG) as well as SDMMC.
The line to fix
https://github.com/ChibiOS/ChibiOS/blob ... ry.h#L1416
the patch
Code: Select all
diff --git a/os/hal/ports/STM32/STM32L4xx/stm32_registry.h b/os/hal/ports/STM32/STM32L4xx/stm32_registry.h
index 5268ee033..565b56fda 100644
--- a/os/hal/ports/STM32/STM32L4xx/stm32_registry.h
+++ b/os/hal/ports/STM32/STM32L4xx/stm32_registry.h
@@ -1413,7 +1413,7 @@
/* RCC attributes.*/
#define STM32_RCC_HAS_HSI16 TRUE
-#define STM32_RCC_HAS_HSI48 FALSE
+#define STM32_RCC_HAS_HSI48 TRUE
#define STM32_RCC_HAS_MSI TRUE
#define STM32_RCC_HAS_LSI TRUE
#define STM32_RCC_HAS_LSI_PRESCALER FALSE
I have been able to get the USB driver working using the HSI48 after applying this patch.