diff --git a/boards/nucleo-l476/Makefile.features b/boards/nucleo-l476/Makefile.features index 7ab9ac6290..20a7f47e1d 100644 --- a/boards/nucleo-l476/Makefile.features +++ b/boards/nucleo-l476/Makefile.features @@ -1,6 +1,7 @@ # Put defined MCU peripherals here (in alphabetical order) FEATURES_PROVIDED += periph_cpuid FEATURES_PROVIDED += periph_gpio +FEATURES_PROVIDED += periph_hwrng FEATURES_PROVIDED += periph_pwm FEATURES_PROVIDED += periph_spi FEATURES_PROVIDED += periph_timer diff --git a/cpu/stm32l4/cpu.c b/cpu/stm32l4/cpu.c index a270a4b4d0..ab818a34f2 100644 --- a/cpu/stm32l4/cpu.c +++ b/cpu/stm32l4/cpu.c @@ -143,6 +143,9 @@ static void cpu_clock_init(void) while (!(RCC->CSR & RCC_CSR_LSIRDY)) {} #endif + /* select the MSI clock for the 48MHz clock tree (USB, RNG) */ + RCC->CCIPR = (RCC_CCIPR_CLK48SEL_0 | RCC_CCIPR_CLK48SEL_1); + /* if configured: enable the HSE clock */ #if CLOCK_HSE RCC->CR |= RCC_CR_HSEON; diff --git a/tests/periph_hwrng/main.c b/tests/periph_hwrng/main.c index 364f63f2bf..c81b60be50 100644 --- a/tests/periph_hwrng/main.c +++ b/tests/periph_hwrng/main.c @@ -31,7 +31,7 @@ int main(void) uint8_t buf[LIMIT]; puts("\nHWRNG peripheral driver test\n"); - printf("This test will print from 1 to %i random bytes about every" + printf("This test will print from 1 to %i random bytes about every " "second\n\n", LIMIT); puts("Initializing the HWRNG driver.\n");