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
1 changed files with 4 additions and 1 deletions

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;
}