SWCU185G January 2018 – June 2024 CC1312PSIP , CC1312R , CC1352P , CC1352R , CC2642R , CC2642R-Q1 , CC2652P , CC2652PSIP , CC2652R , CC2652RB , CC2652RSIP , CC2662R-Q1
The TRNG can be shutdown in many ways, but not all of them result in storing of entropy. The different modes are discussed here.
The best way is to not read the last generated random number. After the MAX_REFILL time (maximum of 224 cycles) defined in the TRNG:CFG0 register, the TRNG enters idle mode where all FROs are turned off. When the generated value is read, the TRNG starts up again and generates a new random seed, which is ready after the time TRNG:CFG0.MIN_REFILL_CYCLES register. When the TRNG is in idle mode, the module clock can be turned off. Entropy is kept in between random number creations, so no reset (SW) of module is needed.
Another approach to shut down the TRNG is to just stop the module clock. By shutting down the TRNG by stopping the module clock, the entropy is also kept (that is, does not affect randomness), but the FROs might still be running. The clock can be enabled at any time, and the generation of a random seed is continued. There is no need for a soft reset of the module.
If the clock is stopped, the TRNG cannot be accessed and a bus fault is generated (within the Interconnect).
If an application that no longer needs the TRNG must go into deep sleep mode without waiting, the application can write 0 in the TRNG:CTL.TRNG_EN register bit, and the input system clock can be switched off. After such a shutdown, a soft reset of the TRNG module (see the register description in Section 19.7.1) should be performed before generating a new random number because randomness cannot be ensured. The penalty of this shutdown method is that entropy accumulation time is required before the next random number is ready.