How to use RNG on STM32H743ZI2?
I would like to use the RNG of the H743ZI2. The provided example works, but on a new project I can't get it work, The CPU clock is configured to 400MHz just like in the example.
/* RNG Initialization */
if (HAL_RNG_DeInit(&hrng) != HAL_OK)
{
/* DeInitialization Error */
Error_Handler();
}
/* Initialize the RNG peripheral */
if (HAL_RNG_Init(&hrng) != HAL_OK)
{
/* Initialization Error */
Error_Handler();
}uint32_t rnd_number;
void main()
{
while (1)
{
status = HAL_RNG_GenerateRandomNumber(&hrng, &rnd_number);
if (status != HAL_OK)
{
Error_Handler();
}
}
}
