True random number generator (RNG) RM0444
464/1390 RM0444 Rev 5
The associated initialization time can be found in Section 19.5: RNG processing time.
Figure 74. RNG initialization overview
19.3.5 RNG operation
Normal operations
To run the RNG using interrupts the following steps are recommended:
1. Enable the interrupts by setting the IE bit in the RNG_CR register. At the same time
enable the RNG by setting the bit RNGEN=1.
2. An interrupt is now generated when a random number is ready or when an error
occurs. Therefore at each interrupt, check that:
– No error occurred. The SEIS and CEIS bits should be set to 0 in the RNG_SR
register.
– A random number is ready. The DRDY bit must be set to 1 in the RNG_SR
register.
– If above two conditions are true the content of the RNG_DR register can be read
up to four consecutive times. If valid data is available in the conditioning output
buffer, four additional words can be read by the application (in this case the DRDY
bit is still high). If one or both of above conditions are false, the RNG_DR register
must not be read. If an error occurred error recovery sequence described in
Section 19.3.7 must be used.
MSv44203V3
Noise source
enable
Conditioning
hardware init
Error state
Generate samples
RNGEN=0, then
RNGEN=1
1
2
3
Drop samples then
check again
Continuous test(s)
not OK
4