From 8582a7fe7a4d1d4e8dbcdbdbe7fd7e3032d5bcc4 Mon Sep 17 00:00:00 2001 From: Martin Kojtal Date: Mon, 10 Dec 2018 12:16:10 +0000 Subject: [PATCH] Revert "STM32L4: fix trng clock setting" --- targets/TARGET_STM/trng_api.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/targets/TARGET_STM/trng_api.c b/targets/TARGET_STM/trng_api.c index cffe7a61770..f85dae2bd72 100644 --- a/targets/TARGET_STM/trng_api.c +++ b/targets/TARGET_STM/trng_api.c @@ -37,6 +37,15 @@ void trng_init(trng_t *obj) error("Only 1 RNG instance supported\r\n"); } +#if defined(TARGET_STM32L4) + RCC_PeriphCLKInitTypeDef PeriphClkInitStruct; + + /*Select PLLQ output as RNG clock source */ + PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_RNG; + PeriphClkInitStruct.RngClockSelection = RCC_RNGCLKSOURCE_PLL; + HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); +#endif + /* RNG Peripheral clock enable */ __HAL_RCC_RNG_CLK_ENABLE();