Why am I getting an RNG failure on the STM32L4P5?
I have just updated a board design, replacing the STM32L433CC with an STM32L4P5RE. I have no problems using the RNG on the L433. However, with the L4P5, I get only one result from the RNG before it give a seed error.
RNG: CR = 00800004, DR = 9a4c8249, SR = 00000001
...
RNG: CR = 00800004, DR = 00000000, SR = 00000044
One thing I find odd is that I would expect the RNG to be able to provide 4 32-bit random values from DR if it worked once given that the RNG produces 128 bits of entropy at a time.
The clocking of the RNG is slightly different in the two boards. Both are clocked from PLLSAI1Q at 48MHz. The PLL is fed by the MSI on the 433 and from a HSE (TXCO) on the new board. The AHB is clocked at 80MHz on the L433 and 120MHz on the L4P5.
PeriphClkInit.UsbClockSelection = RCC_USBCLKSOURCE_PLLSAI1;
PeriphClkInit.RngClockSelection = RCC_RNGCLKSOURCE_PLLSAI1;
PeriphClkInit.PLLSAI1.PLLSAI1Source = RCC_PLLSOURCE_HSE;I tried changing the RNG clock source to the HSI48 and experienced the same problem,
I am only asking for 9600 bits of entropy per second.
I have routed SysClock out of MCO (/8) and verified that it is OK.
I am using STM32CubeIDE to generate the project, including the initialization code. I am not changing the configuration of the RNG from what the HAL has configured after calling MX_RNG_Init().
It should be noted that USB works perfectly fine and is clocked from the same source.
I have the same problem on two different boards, so this does not appear to be a random problem with a defective device.
Any suggestions on where to look?

