14. True random number generator (TRNG)
14.1 Overview
The true random number generator (TRNG) is a hardware module able to generate a random sequence of bits.
The TRNG is based on an analog source of entropy composed by free 9 running ring oscillators. The outputs of those oscillators are XORed and sampled for providing random bits which are then processed by a digital stage.
The digital stage implements an AES-CMC core and is compliant with NIST SP800-90B specifications.
14.2 Features
The TRNG has the following features:
- • Deliver 128-bit random number, produced by an analog generator
- • Generation of true random values based on a dedicated analog source of entropy
- • SP800-90B post processing based on 128-bit AES-CMAC
- • Programmable default key for AES
- • Continuous Health tests for controlling random source behavior
- • On-demand test of analog source and post-processing
- • Enabling/disabling of each analog oscillator for power saving
- • Hardware check of sampling clock
- • AHB slave peripheral. All IP registers must be accessed using 32-bit read or write access. An error response is provided if access size is not 32 bits.
- • Internal four 32-bit FIFO for storing random data
- • Internal clock enable divider for lowering sampling clock frequency.
- • 2 clock domains:
- – hclk_i clock for the AHB interface
- – rngclk_i clock for sampling and shifting bits; frequency must be between 2 to 255 times lower than hclk_i one and with a duty cycle of 50%.
- • 128*N cycles of rngclk_i clock plus 220 cycles of hclk_i between two consecutive random number generations where N is in range of 1 to 16.
14.3 TRNG block diagram
The TRNG design includes an AHB Bus interface implementing configuration and control registers, an output FIFO, the analog source of entropy and the digital stage of post processing.
Figure 24 describes the TRNG core embedded inside the TRNG Core Block.
Figure 24. TRNG core embedding in the TRNG Core Block

The diagram illustrates the internal architecture of the TRNG core, divided into two main clock domains: the SYSTEM CLOCK DOMAIN and the TRNG CLOCK DOMAIN.
SYSTEM CLOCK DOMAIN:
- AHB INTERFACE: Contains registers for configuration and control: DEFKEY(3:0), RNG_SCR, RNG_VAL, POSTP_SCR, OSCS_SCR, and HEALTH_CR. It connects to the external AHB bus.
- Random words Counter: Manages the generation of random words.
- SYNC FIFO: A FIFO buffer for 1x128 bits to 4x32 bits, handling 32 Random Errors.
- AES CMAC: A cryptographic block that takes a 128-bit DEKEY as input.
- FLAGS: A register for status flags.
- AND gate: Combines bp_bypass and tst_bypass_ana_i signals.
TRNG CLOCK DOMAIN:
- Sync To TRNG Domain: Manages synchronization between domains.
- clock divider: Adjusts the clock frequency.
- Power Up Counter: Manages the power-up sequence.
- Health monitor: Monitors the health of the TRNG components.
- Sampler: Samples the output from the oscillators.
- SHIFT_REG: A 128-bit shift register that holds the sampled data.
- Noise word Counter: Counts the noise words.
- Oscillators and Health Tests: Three oscillator blocks (OSC1_3, OSC2_3, OSC3_3) are shown, each with associated health tests. They output data to XOR gates.
- XOR outputs: The final outputs are XORed to produce the random data: xor_output_o[2], xor_output_o[1], and xor_output_o[0].
Additional signals shown include rng_sampled_osc_o, rng_osc_o, and rng_val_i.
MSv55591V1
14.4 TRNG functional description
The slave interface includes all the TRNG memory mapped registers.
The CPU enables the TRNG by resetting bit DISABLE of TRNG_CR unless already enabled (default is TRNG enabled after reset). TRNG startup always begins with health tests of the analog source and the digital post processing.
After the TRNG IP is disabled, by setting CR.DISABLED, in order to properly restart the TRNG IP, the AES_RESET bit must be set to 1 (that is, resetting the AES core and restarting all health tests).
If any error is detected during the health test step, TRNG stops and set errors flags in RNG_SR and RNG_POSTP_SR registers. If no error is found, then TRNG generates random that are used for initializing the AES-based post processing.
When initialization is completed, TRNG starts generating random numbers. TRNG is continuously running and valid Random values are stored in an internal four 32-bit FIFO. It is possible to force a new TRNG reinitialization after generation of a specific number of random numbers as defined in register RNG_POSTP_CR.
CPU must poll FIFO status bits FIFO_FULL and VAL_READY in TRNG_SR before reading random values.
TRNG includes an internal clock enable divider that can be set by bits CLKDIV0 to CLKDIV15 of TRNG_CR register. It is used for decreasing internal random source sampling. Before changing the clock divider, it is recommended to disable the TRNG bit setting bit DISABLE to 1. Due to resynchronization latency between system clock domain and TRNG core clock domain, the value of DISABLE bit reflects the written value when it has been seen by the TRNG core clock domain.
Note: To use the TRNG peripheral the system clock frequency must be at least 32 MHz
For the same reasons, a new divider value can be written provided that both clock domains have the same old value. While the new divider value is being resynchronized with the TRNG core clock domain, it is not possible to write another new value. Consequently, the user must read the RNG_CR register and check that the divider value is equal to the one it has just written. If not, it must redo the write and checking.
Error flags in TRNG_SR reflect the current status of the TRNG core and not the random values stored in the FIFO. No value is stored if TRNG core is in error.
Health tests of analog noise source run continuously but contrary to initialization step, an error detection does not stop random generation but only sets error flags. These error flags can be reset by writing bit RST_HEALTH_FLAGS of TRNG_CR register. When set, this bit remains at 1 until its value has been seen in TRNG core clock domain. Then it is automatically reset.
Heath test of digital post processing can be triggered on-demand by setting bit AES_RESET of RNG_POSTP_CR. When set, this bit remains at 1 until its value has been seen in TRNG core clock domain. Then it is automatically reset. This also triggers the restart of health tests of analog noise source.
As a general comment, any modification of control and configuration bits of TRNG Control registers that impact TRNG core applies in TRNG clock domain after some latency inherent to clock domain resynchronization.
Similarly, any flag or result generated in TRNG clock domain is seen with some latency in system clock delay. However, this latency is shorted as system clock frequency is much higher than TRNG one.
14.5 TRNG register access
The TRNG can only be accessed using 32-bit (word) accesses. References using a different size are invalid.
14.6 Memory map
The TRNG memory map is shown in the following table.
Table 77. TRNG memory map and address offsets
| Offset | Register description (register name) |
|---|---|
| 0x000 | Core Control Register (TRNG_CR) |
| 0x004 | Core Status Register (TRNG_SR) |
| 0x008 | 32-bit Random Value (TRNG_VAL) |
| 0x030 | Oscillator Control Register (TRNG_OSCS_CR) |
| 0x034 | Post Processing Control Register (TRNG_POSTP_CR) |
| 0x038 | Post Processing Status Register (TRNG_POSTP_SR) |
| 0x040 | Bits 31 to 0 of AES 128-bit Default Key (TRNG_DEFKEY0) |
| 0x044 | Bits 63 to 32 of AES 128-bit Default Key (TRNG_DEFKEY1) |
| 0x048 | Bits 95 to 64 of AES 128-bit Default Key (TRNG_DEFKEY2) |
| 0x04C | Bits 127 to 96 of AES 128-bit Default Key (TRNG_DEFKEY3) |
| 0x060 | Health Test Control Register (TRNG_HEALTH_CR) |
| 0x068 | OSC1 Health Tests Control Register (TRNG_HEALTH_OSC1_CR) |
| 0x06C | OSC2 Health Tests Control Register (TRNG_HEALTH_OSC2_CR) |
| 0x070 | OSC3 Health Tests Control Register (TRNG_HEALTH_OSC3_CR) |
| 0x074 | OSC1 Health Tests Status Register (TRNG_HEALTH_OSC1_SR) |
| 0x078 | OSC2 Health Tests Status Register (TRNG_HEALTH_OSC2_SR) |
| 0x07C | OSC3 Health Tests Status Register (TRNG_HEALTH_OSC3_SR) |
Table 77. TRNG memory map and address offsets
| Offset | Register description (register name) |
|---|---|
| 0x080 | TRNG Interrupt Control Register (TRNG_IRQ_CR) |
| 0x084 | Interrupt Status Register (TRNG_IRQ_SR) |
14.7 TRNG registers
The following sections detail the individual registers within the TRNG programming model.
14.7.1 Core Control Register (TRNG_CR)
Address: BaseAddress + 0x000
Type: R/W
Reset value: 0x0000_FF00
Description: Core Control Register
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | CLKDIV | |||||||
| r | r | r | r | r | r | r | r | rw | rw | rw | rw | rw | rw | rw | rw |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| CLKDIV | RST_HEALTH_FLAG_S | CLR_REVCLK_FLAG | Res. | Res. | Res. | Res. | Res. | DISABLE | |||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | r | r | r | r | r | rw |
Bits 31:24 Reserved, must be kept at reset value.
Bits 23:8 CLKDIV: Sampling Clock Enable Divider.
CLKDIV[15:0] control the sampling clock enable divider, dividing by a factor equal to CLKDIV[15:0] + 1, values being in the range of 1 to 65536.
NB: A new value can be set if current value is visible by both clock domains otherwise write fails.
Bit 7 RST_HEALTH_FLAGS: Reset Health error flags when writing a “1” without resetting the whole TRNG.
0: no reset
1: reset health flag
When writing a 1, the value remains until it is seen by RNG core clock domain after resynchronization. Then it is automatically reset.
Bit 6 CLR_REVCLK_FLAG: Clear reveal clock error flags when writing a “1” without resetting the whole TRNG. 0: no reset
1: Clear revclk flag
Bits 5:1 Reserved, must be kept at reset value.
Bit 0 DISABLE:
Bit DISABLE can be used for reading or setting the state of the TRNG core. The value read is always the one available at the rng core clock domain.
0: The RNG core is enabled 1: The RNG core is disabled
When changing the value, the change is effective when the value read is the same as the one written.
14.7.2 Core Status Register (TRNG_SR)
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | Res. | Res. | Res. | OSCS_ADAPT_ERROR | OSCS_REPET_ERROR | OSCS_HEALTH_DONE | ADAPT_ERROR | REPET_ERROR | SRC_HEALTH_DONE | Res. | Res. | Res. | Res. |
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
| 15 | 14 | 13 | 12 | 11 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | FIFO_FULL | VAL_READY | ENTROPY_ERR | REVEAL_CLK_ERR | ALL_OSCS_DOWN | TRNG_DISABLED |
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
Address: BaseAddress + 0x004
Type: R/W
Reset value: 0x0
Description: Core Status Register
Bits 31:26 Reserved, must be kept at reset value.
Bit 25 OSCS_ADAPT_ERROR :Logical OR of adaptive health test errors of individual oscillators composing the noise source.
Bit 24 OSCS_REPET_ERROR : Logical OR of repetition health test errors of individual oscillators composing the noise source.Bit 23 OSCS_HEALTH_DONE :First run of source health tests of individual oscillators composing the noise source are completed.
Bit 22 ADAPT_ERROR : Noise source Adaptive health test errorBit 21 REPET_ERROR : Noise source Repetition health test errorBit 20 SRC_HEALTH_DONE : First run of noise source health test is completedBits 19:6 Reserved, must be kept at reset value.
Bit 5 FIFO_FULL : Indicates whether random data FIFO is full. 0: FIFO is not full.1: The internal data FIFO is full and four 32:bit random values can be read.Bit 4 VAL_READY : TRNG Value ready
At least one 32-bit random value is available in the data FIFO. Note that application must ensure that a random is available in internal FIFO by reading the VAL_READY flag before starting a read, otherwise a null value is returned.
0: No value is ready in FIFO.
1: A 32-bit value is available in the internal FIFO
Bit 3 ENTROPY_ERR : The error reported refers to a fault in the bit sequence detected by the Entropy Monitor. Failed test is given by REPET_ERROR, ADAPT_ERROR, OSCS_REPET_ERROR and OSCS_ADAPT_ERROR status flags.0: No fault detected.
1: Embedded health monitor detects an error in bit stream quality
- Bit 2 REVEAL_CLK_ERR: The internal clock for the RNG core is not revealed. 0: Internal clock for RNG clock is present.
1: Internal RNG clock is not present. - ALL_OSCS_DOWN: All oscillators of the random source noise have been powered down. This can cause the rising of OEC3 flag.
Bit 1 1: All oscillators are down
0: At least one oscillator is ON - Bit 0 TRNG_DISABLED: TRNG is disabled.
0: Normal operation.
1: RNG is disabled.
14.7.3 32-bit Random Value (TRNG_VAL)
Address: BaseAddress + 0x008
Type: R
Reset value: 0x0
Description: 32-bit Random Value
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| RND_VAL | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| RND_VAL | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
Bits 31:0 RND_VAL: a 32-bit Random Value. This is the output of the internal four-word FIFO.
Note that application must ensure that a random value is available in the FIFO by reading the VAL_READY flag before starting a read, otherwise a null value is returned.
14.7.4 Oscillator Control Register (TRNG_OSCS_CR)
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| SYNC_OSCS | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
| rw | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res. | Res. | Res. | Res. | Res. | Res. | PWRD3 | PWRD2 | PWRD1 | Res. | ||||||
| r | r | r | r | r | r | rw | rw | rw | rw | rw | rw | rw | rw | rw | r |
Address: BaseAddress + 0x030
Type: R/W
Reset value: 0x8000_0000
Description: OscillatorControl Register
Bit 31 SYNC_OSCS: When set, selection of resynchronized output of oscillators.
NB: It is recommended to disable TRNG before changing this value.
Bits 30:10 Reserved, must be kept at reset value.
Bits 9:7 PWRD3: Power down of individual oscillators in triple-oscillator block number 3
Bits 6:4 PWRD2: Power down of individual oscillators in triple-oscillator block number 2
Bits 3:1 PWRD1: Power down of individual oscillators in triple-oscillator block number 1
Bit 0 Reserved, must be kept at reset value.
14.7.5 Post Processing Control Register (TRNG_POSTP_CR)
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| NB_RND_REINIT | |||||||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res. | Res. | Res. | Res. | NB_LOOP_AES | Res. | Res. | Res. | Res. | Res. | Res. | Res. | AES_RESET | |||
| r | r | r | r | rw | rw | rw | rw | r | r | r | r | r | r | r | w |
Address: BaseAddress + 0x034
Type: R/W
Reset value: 0x0000_0F00
Description: AES-based post-processing Control Register
Bits 31:16 NB_RND_REINIT: Number of 128-bit random words generated before AES automatically resets. This number is in the range of 1 to 65535 words. Value 0x0000 means that AES is never reinitialized.
NB: It is recommended to disable TRNG before changing this value.
Bits 15:12 Reserved, must be kept at reset value.
Bits 11:8 NB_LOOP_AES: the number of 128-bit words got from the noise source that have to be processed by AES for generating a single 128-bit random word.
By default, this value is set to 2 (128 bits generated before an AES processing). 0 value means 16 loops.
A new AES processing is started only when the previous one is completed. NB: It is recommended to disable TRNG before changing this value.
Bits 7:1 Reserved, must be kept at reset value.
Bit 0 AES_RESET: Reset AES post processing.
When writing a 1, the AES post processing is reinitialized, resulting in a new key and new state generation before 128-bit random words generation. The '1' written is frozen until it is seen by RNG core clock domain after resynchronization. Then it is automatically reset.
It also reruns analog source health tests.
0: No effect
1: Reset AES core
14.7.6 Post Processing Status Register (TRNG_POSTP_SR)
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | AES_D OUT_E RROR | AES_K 12_ER ROR | AES_H EALTH _DONE | AES_B USY | AES_K EY_LD | AES_I NIT | Res. |
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
Address:BaseAddress + 0x038
Type:R/W
Reset value:0x0000_0000
Description:AES-based Post Processing Status Register.
Bits 31:7 Reserved, must be kept at reset value.
Bit 6 AES_DOUT_ERROR: Health test error on AES-CMAC output generation
Bit 5 AES_K12_ERROR: Health test error on AES-CMAC sub-keys generation
Bit 4 AES_HEALTH_DONE: AES-CMAC health test is completed
Bit 3 AES_BUSY: AES core is busy, generating a random value. 0: AES core is idle
1: AES core is busy
Bit 2 AES_KEY_LD: AES random key has been generated and loaded in AES key register.
0: AES core is waiting for 128 random bits from the entropy sources for generating its key 1:
AES key register has been loaded with a random key
Bit 1 AES_INIT: AES Post processing has been fully initialized (key and state) and is ready for
generating 128- bit random words.
0: AES core is not initialized (no key or state set). 1: AES core is fully initialized.
Bit 0 Reserved, must be kept at reset value.
14.7.7 Bits 31 to 0 of AES 128-bit Default Key (TRNG_DEFKEY0)
Address: BaseAddress + 0x040
Type:R/W
Reset value:0xFFFF FFFF
Description:First part of 128-bit AES Default Key. This register is write-only as it can hold a device-specific key that masks the random key generated from the entropy source.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| RNG_DEFKEY0 | |||||||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| RNG_DEFKEY0 | |||||||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
Bits 31:0 RNG_DEFKEY0: Bits 31 to 0 of AES 128-bit Default Key
14.7.8 Bits 63 to 32 of AES 128-bit Default Key (TRNG_DEFKEY1)
Address:BaseAddress + 0x044
Type:R/W
Reset value: 0xFFFF FFFF
Description: Second part of 128-bit AES Default Key. This register is write-only as it can hold a device-specific key that masks the random key generated from the entropy source.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| RNG_DEFKEY1 | |||||||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| RNG_DEFKEY1 | |||||||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
Bits 31:0 RNG_DEFKEY1: Bits 63 to 32 of AES 128-bit Default Key
14.7.9 Bits 95 to 64 of AES 128-bit Default Key (TRNG_DEFKEY2)
Address: BaseAddress + 0x048
Type: R/W
Reset value: 0xFFFF FFFF
Description: Third part of 128-bit AES Default Key. This register is write-only as it can hold a device-specific key that masks the random key generated from the entropy source.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| RNG_DEFKEY2 | |||||||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| RNG_DEFKEY2 | |||||||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
Bits 31:0 RNG_DEFKEY2: Bits 95 to 64 of AES 128-bit Default Key
14.7.10 Bits 127 to 96 of AES 128-bit Default Key (TRNG_DEFKEY3)
Address: BaseAddress + 0x04C
Type: R/W
Reset value: 0xFFFF FFFF
Description: Fourth and last part of 128-bit AES Default Key. This register is write-only as it can hold a device-specific key that masks the random key generated from the entropy source.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| RNG_DEFKEY3 | |||||||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| RNG_DEFKEY3 | |||||||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
Bits 31:0 RNG_DEFKEY3: Bits 127 to 96 of AES 128-bit Default Key
14.7.11 Health Test Control Register (TRNG_HEALTH_CR)
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | ITER_ADAP | Res. | Res. | ADAP_CUTOFF | ||||||||||
| r | r | rw | rw | r | r | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | REPET_CUTOFF. | |||||||
| r | r | r | r | r | r | r | r | rw | rw | rw | rw | rw | rw | rw | rw |
Address: BaseAddress + 0x060
Type: R/W
Reset value: 0x02BB 0033
Description: The TRNG_HEALTH_CR register controls the health test parameters. It must be used with care as bad settings could prevent TRNG to work properly. The default values are valid for all ring oscillators enabled. When powering down some oscillators, the cutoff values must be increased as health tests could trigger an error. When all oscillators but one are powered down, the values should be the same as the ones defined in TRNG_HEALTH_OSCx_CR registers.
Bits 31:30 Reserved, must be kept at reset value.
Bits 29:28 ITER_ADAP: Number of iterations minus 1 of Adaptive test during initialization phase. Default value is set to 0 i.e. 1 iteration.
NB: It is recommended to disable TRNG before changing this value.
Bits 27:26 Reserved, must be kept at reset value.
Bits 25:16 ADAP_CUTOFF: Cutoff value of Adaptive Test. The default value is set to 699.
Caution: To be handled with care as any change can lead to misbehavior of TRNG. NB: It is recommended to disable TRNG before changing this value.
Bits 15:8 Reserved, must be kept at reset value.
Bits 7:0 REPET_CUTOFF: Cutoff value of Repetition Test. The default value is set to 51.
Caution: To be handled with care as any change can lead to misbehavior of TRNG. NB: It is recommended to disable TRNG before changing this value.
14.7.12 OSC1 Health Tests Control Register (TRNG_HEALTH_OSC1_CR)
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | Res. | Res. | Res. | ADAP_CUTOFF_OSC1 | |||||||||
| r | r | r | r | r | r | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | REPET_CUTOFF_OSC1 | |||||||
| r | r | r | r | r | r | r | r | rw | rw | rw | rw | rw | rw | rw | rw |
Address: BaseAddress + 0x068
Type: R/W
Reset value: 0x03E3 00FB
Description: The TRNG_HEALTH_CR register controls the health test parameters of first oscillator in triple-oscillator cells. It must be used with care as bad settings could prevent TRNG to work properly.
Bits 31:26 Reserved, must be kept at reset value.
Bits 25:16 ADAP_CUTOFF_OSC1: Cutoff value of Adaptive Test for first oscillator of triple-oscillator cells. The default value is set to 995.
Caution: To be handled with care as any change can lead to misbehavior of TRNG. NB: It is recommended to disable TRNG before changing this value.
Bits 15:8 Reserved, must be kept at reset value.
Bits 7:0 REPET_CUTOFF_OSC1: Cutoff value of Repetition Test for first oscillator of triple-oscillator cells. The default value is set to 251.
Caution: To be handled with care as any change can lead to misbehavior of TRNG. NB: It is recommended to disable TRNG before changing this value.
14.7.13 OSC2 Health Tests Control Register (TRNG_HEALTH_OSC2_CR)
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| Res. | Res. | Res. | Res. | Res. | Res. | ADAP_CUTOFF_OSC2 | |||||||||
| r | r | r | r | r | r | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | REPET_CUTOFF_OSC2 | |||||||
| r | r | r | r | r | r | r | r | rw | rw | rw | rw | rw | rw | rw | rw |
Address: BaseAddress + 0x06C
Type: R/W
Reset value: 0x03E3 00FB
Description: The TRNG_HEALTH_CR register controls the health test parameters of second oscillator in triple-oscillator cells. It must be used with care as bad settings could prevent TRNG to work properly.
- Bits 31:26 Reserved, must be kept at reset value.
- Bits 25:16 ADAP_CUTOFF_OSC2: Cutoff value of Adaptive Test for second oscillator of triple-oscillator cells. The default value is set to 995.Caution: To be handled with care as any change can lead to misbehavior of TRNG. NB: It is recommended to disable TRNG before changing this value.
- Bits 15:8 Reserved, must be kept at reset value.
- Bits 7:0 REPET_CUTOFF_OSC2: Cutoff value of Repetition Test for second oscillator of triple-oscillator cells. The default value is set to 251.Caution: To be handled with care as any change can lead to misbehavior of TRNG. NB: It is recommended to disable TRNG before changing this value.

14.7.14 OSC3 Health Tests Control Register (TRNG_HEALTH_OSC3_CR)
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | Res. | Res. | Res. | ADAP_CUTOFF_OSC3 | |||||||||
| r | r | r | r | r | r | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | REPET_CUTOFF_OSC3 | |||||||
| r | r | r | r | r | r | r | r | rw | rw | rw | rw | rw | rw | rw | rw |
Address: BaseAddress + 0x70
Type: R/W
Reset value: 0x03E3 00FB
Description: The TRNG_HEALTH_CR register controls the health test parameters of third oscillator in triple-oscillator cells. It must be used with care as bad settings could prevent TRNG to work properly.
Bits 31:26 Reserved, must be kept at reset value.
Bits 25:16 ADAP_CUTOFF_OSC3: Cutoff value of Adaptive Test for third oscillator of triple-oscillator cells. The default value is set to 995.
Caution: To be handled with care as any change can lead to misbehavior of TRNG. NB: It is recommended to disable TRNG before changing this value.
Bits 15:8 Reserved, must be kept at reset value.
Bits 7:0 REPET_CUTOFF_OSC3: Cutoff value of Repetition Test for third oscillator of triple-oscillator cells. The default value is set to 251.
Caution: To be handled with care as any change can lead to misbehavior of TRNG. NB: It is recommended to disable TRNG before changing this value.
14.7.15 OSC1 Health Tests Status Register (TRNG_HEALTH_OSC1_SR)
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | TO3_A DAPT_ ERRO R | TO3_R EPET_ ERRO R | TO2_A DAPT_ ERRO R | TO2_R EPET_ ERRO R | TO1_A DAPT_ ERRO R | TO1_R EPET_ ERRO R |
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
Address:BaseAddress + 0x074
Type: R/W
Reset value: 0x0
Description: OSC1 Health Tests Status Register
- Bits 31:6 Reserved, must be kept at reset value.
- Bit 5 TO3_ADAPT_ERROR: Adaptive error flag of first oscillator of third triple-oscillator cell.
- Bit 4 TO3_REPET_ERROR: Repetition error flag of first oscillator of third triple-oscillator cell.
- Bit 3 TO3_ADAPT_ERROR: Adaptive error flag of first oscillator of second triple-oscillator cell.
- Bit 2 TO2_REPET_ERROR: Repetition error flag of first oscillator of second triple-oscillator cell.
- Bit 1 TO1_ADAPT_ERROR: Adaptive error flag of first oscillator of first triple-oscillator cell
- Bit 0 TO1_REPET_ERROR: Repetition error flag of first oscillator of first triple-oscillator cell.

14.7.16 OSC2 Health Tests Status Register (TRNG_HEALTH_OSC2_SR)
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | TO3_A DAPT_ ERRO R | TO3_R EPET_ ERRO R | TO2_A DAPT_ ERRO R | TO2_R EPET_ ERRO R | TO1_A DAPT_ ERRO R | TO1_R EPET_ ERRO R |
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
Address: BaseAddress + 0x078
Type: R/W
Reset value: 0x0
Description: OSC1 Health Tests Status Register
Bits 31:6 Reserved, must be kept at reset value.
Bit 5 TO3_ADAPT_ERROR: Adaptive error flag of second oscillator of third triple-oscillator cell.
Bit 4 TO3_REPET_ERROR: Repetition error flag of second oscillator of third triple-oscillator cell.
Bit 3 TO3_ADAPT_ERROR: Adaptive error flag of second oscillator of second triple-oscillator cell.
Bit 2 TO2_REPET_ERROR: Repetition error flag of second oscillator of second triple-oscillator cell.
Bit 1 TO1_ADAPT_ERROR: Adaptive error flag of second oscillator of first triple-oscillator cell
Bit 0 TO1_REPET_ERROR: Repetition error flag of second oscillator of first triple-oscillator cell.
14.7.17 OSC3 Health Tests Status Register (TRNG_HEALTH_OSC3_SR)
Address: BaseAddress + 0x07C
Type: R/W
Reset value: 0x0
Description: OSC3 Health Tests Status Register
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | TO3_A DAPT_ ERRO R | TO3_R EPET_ ERRO R | TO2_A DAPT_ ERRO R | TO2_R EPET_ ERRO R | TO1_A DAPT_ ERRO R | TO1_R EPET_ ERRO R |
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
Bits 31:6 Reserved, must be kept at reset value.
Bit 5 TO3_ADAPT_ERROR : Adaptive error flag of third oscillator of third triple-oscillator cell.Bit 4 TO3_REPET_ERROR : Repetition error flag of third oscillator of third triple-oscillator cell.Bit 3 TO3_ADAPT_ERROR : Adaptive error flag of third oscillator of second triple-oscillator cell.Bit 2 TO2_REPET_ERROR : Repetition error flag of third oscillator of second triple-oscillator cell.Bit 1 TO1_ADAPT_ERROR : Adaptive error flag of third oscillator of first triple-oscillator cellBit 0 TO1_REPET_ERROR : Repetition error flag of third oscillator of first triple-oscillator cell.14.7.18 TRNG Interrupt Control Register (TRNG_IRQ_CR)
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | EN_ERROR_IRQ | Res. | Res. | Res. | Res. | Res. | Res. | Res. | EN_FF_FULL_IRQ |
| r | r | r | r | r | r | r | rw | r | r | r | r | r | r | r | rw |
Address: BaseAddress + 0x080
Type: R/W
Reset value: 0x0000 0000
Description: The TRNG_IRQ_CR register controls the enabling of interrupt sources.
Bits 31:9 Reserved, must be kept at reset value.
Bit 8 EN_ERROR_IRQ: Enable the interrupt when an error is reported.
Bits 7:1 Reserved, must be kept at reset value.
Bit 0 EN_FF_FULL_IRQ: Enable the interrupt when the output FIFO is full of new random.
14.7.19 Interrupt Status Register (TRNG_IRQ_SR)
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | ERRO R_IRQ | Res. | Res. | Res. | Res. | Res. | Res. | Res. | FF_FU LL_IRQ |
| r | r | r | r | r | r | r | rw | r | r | r | r | r | r | r | rw |
Address: Base Address+ 0x084
Type: R
Reset value: 0x0000 0000
Description: The TRNG_IRQ_SR register reports the status flags of the interrupt sources.
Bits 31:9 Reserved, must be kept at reset value.
Bit 8 ERROR_IRQ: Set to 1 when an error is reported. Flag is cleared by writing a 1.
This bit is set only if corresponding bit in TRNG_IRQ_CR is set.
Bits 7:1 Reserved, must be kept at reset value.
Bit 0 FF_FULL_IRQ: Set to 1 when the output FIFO is full of new random. It is software responsibility to clear the flag since it is not cleared by hardware when samples are read from the FIFO. The flag is cleared by writing a 1 to it.
This bit is set only if corresponding bit in TRNG_IRQ_CR is set.