mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-02-18 18:42:06 +00:00
RNG: Delay after an RCC peripheral clock enabling
This commit is contained in:
parent
c5dfa37f3e
commit
7103404b90
@ -2,7 +2,10 @@
|
|||||||
|
|
||||||
int rng_init(void)
|
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
|
RNG->CR = RNG_CR_RNGEN; // enable TRNG
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user