Texas Instruments CC2650DK Benutzerhandbuch

Seite von 1570
TRNG Low-level Programing Guide
16.6 TRNG Low-level Programing Guide
This section covers the low-level hardware programming sequences for configuration and usage of the
module.
16.6.1 Initialization
16.6.1.1 Interfacing Modules
This section identifies the requirements of initializing the interfacing modules when the TRNG is to be
used for the first time after a device reset.
lists the Initialization of Interfacing Modules.
Table 16-2. Initialization of Surrounding Modules
Interfacing Module
Comment
PRCM
The power domain the TRNG is part of as well as the TRNG module interface clock must be enabled.
See PRCM register [PRCM:PDCTL0: PERIPH_ON] and [PRCM:SECDMACLKGR:CRYPTO_CLK_EN].
Cortex M3
NVIC configuration must be done to enable the interrupt from the TRNG. Only needed for interrupt
based communication.
Interconnect
Interconnect must be enabled for communication with TRNG, which is handled in the PRCM as a
consequence of many settings, like CPU in run, sleep or deep-sleep mode, usage of DMA, I2S,
RFCORE and Crypto engine.
16.6.1.2 TRNG Main Sequence
This procedure initializes the TRNG after a power-on reset (POR).
lists the TRNG main
initialization sequence.
Table 16-3. TRNG Initialization Sequence
Step
Register or Bit Field
Execute a SW reset
[TRNG:SWRESET:RESET]
Wait for SW completion by polling
[TRNG:SWRESET:RESET]
Select the number of clock input cycles of the FRO’s between
[TRNG:CFG0:SMPL_DIV]
two samples
Select the number of samples taken to gather enough entropy in
[TRNG:CTL:STARTUP_CYCLES]
the FROs of the module and to generate the first random value
Select the minimum number of samples taken regenerate
entropy in the FROs of the module and to generate subsequent
[TRNG:CFG0:MIN_REFILL_CYCLES]
random values
Select the maximum number of samples taken regenerate
entropy in the FROs of the module and to generate subsequent
random values
[TRNG:CFG0:MAX_REFILL_CYCLES]
Also defines timeout period for shutting down the FROs after
inactivity
Configure the desired FROs to run 5% faster
[TRNG:FRODETUNE:FRO_MASK]
Enable all FROs
[TRNG:FROEN:FRO_MASK]
Select the maximum number of samples after which a detected
[TRNG:ALARMCNT:ALARM_THR]
repeated pattern an alarm event is generated
Set the shutdown threshold to the number of FROs allowed to
be shut down
[TRNG:ALARMCNT:SHUTDOWN_THR]
Note: This step is only required if unmonitored mode is used.
Enable and start
[TRNG:CTL:TRNG_EN]
1160
Random Number Generator
SWCU117A – February 2015 – Revised March 2015
Copyright © 2015, Texas Instruments Incorporated