This is an automated email from the ASF dual-hosted git repository.
kasjer pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
The following commit(s) were added to refs/heads/master by this push:
new 480025ff0 mcu/stm32u575zi-q: Fix TRNG clock source configuration
480025ff0 is described below
commit 480025ff0facf250df095fe07beff3b00a80b885
Author: Wiktor Kwiatkowski <[email protected]>
AuthorDate: Tue Apr 28 19:08:09 2026 +0200
mcu/stm32u575zi-q: Fix TRNG clock source configuration
Change TRNG clock source from PLL to HSI48. The PLL macro
(RCC_RNGCLKSOURCE_PLL) is not supported on this MCU
Also enable the HSI48 clock in BSP when TRNG is used
---
hw/bsp/nucleo-u575zi-q/syscfg.yml | 3 +++
hw/mcu/stm/stm32u5xx/src/clock_stm32u5xx.c | 5 +----
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/bsp/nucleo-u575zi-q/syscfg.yml
b/hw/bsp/nucleo-u575zi-q/syscfg.yml
index 513e779db..6e95215cb 100644
--- a/hw/bsp/nucleo-u575zi-q/syscfg.yml
+++ b/hw/bsp/nucleo-u575zi-q/syscfg.yml
@@ -65,3 +65,6 @@ syscfg.vals:
MYNEWT_DOWNLOADER: stm32_programmer_cli
MYNEWT_DOWNLOADER_MFG_IMAGE_FLASH_OFFSET: 0x0C000000
JLINK_TARGET: STM32U575ZI
+
+syscfg.vals.TRNG:
+ STM32_CLOCK_HSI48: 1
diff --git a/hw/mcu/stm/stm32u5xx/src/clock_stm32u5xx.c
b/hw/mcu/stm/stm32u5xx/src/clock_stm32u5xx.c
index e0ab416c6..57a72cb44 100644
--- a/hw/mcu/stm/stm32u5xx/src/clock_stm32u5xx.c
+++ b/hw/mcu/stm/stm32u5xx/src/clock_stm32u5xx.c
@@ -292,10 +292,7 @@ SystemClock_Config(void)
#if TRNG_ENABLED
pclk_init.PeriphClockSelection = RCC_PERIPHCLK_RNG;
- /* Other clock sources are possible, but since right now we always
- * configure the PLL, this should be ok
- */
- pclk_init.RngClockSelection = RCC_RNGCLKSOURCE_PLL;
+ pclk_init.RngClockSelection = RCC_RNGCLKSOURCE_HSI48;
status = HAL_RCCEx_PeriphCLKConfig(&pclk_init);
if (status != HAL_OK) {
assert(0);