trng_random

Overview

The True Random Number Generator (TRNG) is a hardware accelerator module that generates a 512-bit entropy as needed by an entropy consuming module or by other post processing functions. The TRNG Example project is a demonstration program that uses the KSDK software to generate random numbers and prints them to the terminal.

NOTE:

On i.MXRT1020/1050/1060, the TRNG entropy register is initialized by the ROM boot process with 128 entropy bits (read from registers ENT12-ENT15, sampleSize = 128).

The TRNG driver version <= 2.0.2 has issue that TRNG_Init() function doesn’t flush these entropy bits, thus, the first TRNG_GetRandomData(base, data, 64) after TRNG_Init() only reads 384 non-random bits followed by 128 random bits. After the first call, next calls to TRNG_GetRandomData() return entropy bits collected with new TRNG settings.

The issue is fixed in TRNG driver version 2.0.3, by regenerating entropy bits with new TRNG settings already during TRNG_Init().

Supported Boards