1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-26 17:38:39 +00:00

RNG: Delay after an RCC peripheral clock enabling

This commit is contained in:
mcudev 2017-10-12 15:29:38 -04:00 committed by Pavol Rusnak
parent c5dfa37f3e
commit 7103404b90

View File

@ -2,7 +2,10 @@
int rng_init(void)
{
RCC->AHB2ENR |= RCC_AHB2ENR_RNGEN; // enable TRNG peripheral clock
// enable TRNG peripheral clock
// use the HAL version due to section 2.1.6 of STM32F42xx Errata sheet
// "Delay after an RCC peripheral clock enabling"
__HAL_RCC_RNG_CLK_ENABLE();
RNG->CR = RNG_CR_RNGEN; // enable TRNG
return 0;
}