MCUXpresso SDK Documentation

trng_random

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#

EVKB-IMXRT1050
Hardware requirements
  • Mini/micro USB cable

  • EVKB-IMXRT1050 board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

When the example runs successfully, the following message is displayed in the terminal:

RNGA Peripheral Driver Example Generate 10 random numbers: Random[0] = 0xE1554295 Random[1] = 0x827AD456 Random[2] = 0x9A1CBE1E Random[3] = 0x4354CB53 Random[4] = 0xFE3B2494 Random[5] = 0xEDAB3F7D Random[6] = 0x9AB91722 Random[7] = 0x4F54D999 Random[8] = 0x492414D1 Random[9] = 0x84611992

Press any key to continue…

MIMXRT1060-EVKB
Hardware requirements
  • Mini/micro USB cable

  • MIMXRT1060-EVKB board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

When the example runs successfully, the following message is displayed in the terminal:

RNGA Peripheral Driver Example Generate 10 random numbers: Random[0] = 0xE1554295 Random[1] = 0x827AD456 Random[2] = 0x9A1CBE1E Random[3] = 0x4354CB53 Random[4] = 0xFE3B2494 Random[5] = 0xEDAB3F7D Random[6] = 0x9AB91722 Random[7] = 0x4F54D999 Random[8] = 0x492414D1 Random[9] = 0x84611992

Press any key to continue…

MIMXRT1060-EVKC
Hardware requirements
  • Mini/micro USB cable

  • MIMXRT1060-EVKC board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

When the example runs successfully, the following message is displayed in the terminal:

RNGA Peripheral Driver Example Generate 10 random numbers: Random[0] = 0xE1554295 Random[1] = 0x827AD456 Random[2] = 0x9A1CBE1E Random[3] = 0x4354CB53 Random[4] = 0xFE3B2494 Random[5] = 0xEDAB3F7D Random[6] = 0x9AB91722 Random[7] = 0x4F54D999 Random[8] = 0x492414D1 Random[9] = 0x84611992

Press any key to continue…

EVK-MCIMX7ULP
Hardware requirements
  • Micro USB cable

  • MCIMX7ULP-EVK board

  • 5V power supply

  • Personal Computer

Board settings

No special settings are required.

Please note this application can’t support running with Linux BSP!

Prepare the Demo
  1. Connect 5V power supply and J-Link Debug Probe to the board, switch SW1 to power on the board.

  2. Connect a micro USB cable between the host PC and the J6 USB port on the target board.

  3. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  4. Download the program to the target board.

  5. Either press the reset button on your board or launch the debugger in your IDE to begin running the example.

Running the demo

When the example runs successfully, the following message is displayed in the terminal:

TRNG Peripheral Driver Example
Generate 10 random numbers:
Random[0] = 0xE4C973F5
Random[1] = 0x25BEBC2B
Random[2] = 0x1A889794
Random[3] = 0xF723958
Random[4] = 0xD9818CFE
Random[5] = 0x409950E7
Random[6] = 0xA9315CA1
Random[7] = 0x5060CAC3
Random[8] = 0x93870888
Random[9] = 0x32DAB69B

 Press any key to continue...
EVK-MIMXRT1010
Hardware requirements
  • Mini/micro USB cable

  • EVK-MIMXRT1010 board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

When the example runs successfully, the following message is displayed in the terminal:

RNGA Peripheral Driver Example Generate 10 random numbers: Random[0] = 0xE1554295 Random[1] = 0x827AD456 Random[2] = 0x9A1CBE1E Random[3] = 0x4354CB53 Random[4] = 0xFE3B2494 Random[5] = 0xEDAB3F7D Random[6] = 0x9AB91722 Random[7] = 0x4F54D999 Random[8] = 0x492414D1 Random[9] = 0x84611992

Press any key to continue…

Note: To debug in qspiflash, following steps are needed:

  1. Select the flash target and compile.

  2. Set the SW8: 1 off 2 off 3 on 4 off, then power on the board and connect USB cable to J41.

  3. Start debugging in IDE.

    • Keil: Click “Download (F8)” to program the image to qspiflash first then clicking “Start/Stop Debug Session (Ctrl+F5)” to start debugging.

EVK-MIMXRT1015
Hardware requirements
  • Mini/micro USB cable

  • EVK-MIMXRT1015 board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

When the example runs successfully, the following message is displayed in the terminal:

RNGA Peripheral Driver Example Generate 10 random numbers: Random[0] = 0xE1554295 Random[1] = 0x827AD456 Random[2] = 0x9A1CBE1E Random[3] = 0x4354CB53 Random[4] = 0xFE3B2494 Random[5] = 0xEDAB3F7D Random[6] = 0x9AB91722 Random[7] = 0x4F54D999 Random[8] = 0x492414D1 Random[9] = 0x84611992

Press any key to continue…

Note: To debug in qspiflash, following steps are needed:

  1. Select the flash target and compile.

  2. Set the SW8: 1 off 2 off 3 on 4 off, then power on the board and connect USB cable to J41.

  3. Start debugging in IDE.

    • Keil: Click “Download (F8)” to program the image to qspiflash first then clicking “Start/Stop Debug Session (Ctrl+F5)” to start debugging.

EVK-MIMXRT1020
Hardware requirements
  • Mini/micro USB cable

  • EVK-MIMXRT1020 board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

When the example runs successfully, the following message is displayed in the terminal:

RNGA Peripheral Driver Example Generate 10 random numbers: Random[0] = 0xE1554295 Random[1] = 0x827AD456 Random[2] = 0x9A1CBE1E Random[3] = 0x4354CB53 Random[4] = 0xFE3B2494 Random[5] = 0xEDAB3F7D Random[6] = 0x9AB91722 Random[7] = 0x4F54D999 Random[8] = 0x492414D1 Random[9] = 0x84611992

Press any key to continue…

Note: To debug in qspiflash, following steps are needed:

  1. Select the flash target and compile.

  2. Set the SW8: 1 off 2 off 3 on 4 off, then power on the board and connect USB cable to J23.

  3. Start debugging in IDE.

    • Keil: Click “Download (F8)” to program the image to qspiflash first then clicking “Start/Stop Debug Session (Ctrl+F5)” to start debugging.

MIMXRT1024-EVK
Hardware requirements
  • Mini/micro USB cable

  • MIMXRT1024-EVK board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

When the example runs successfully, the following message is displayed in the terminal:

RNGA Peripheral Driver Example Generate 10 random numbers: Random[0] = 0xE1554295 Random[1] = 0x827AD456 Random[2] = 0x9A1CBE1E Random[3] = 0x4354CB53 Random[4] = 0xFE3B2494 Random[5] = 0xEDAB3F7D Random[6] = 0x9AB91722 Random[7] = 0x4F54D999 Random[8] = 0x492414D1 Random[9] = 0x84611992

Press any key to continue…

Note: To debug in qspiflash, following steps are needed:

  1. Select the flash target and compile.

  2. Set the SW8: 1 off 2 off 3 on 4 off, then power on the board and connect USB cable to J23.

  3. Start debugging in IDE.

    • Keil: Click “Download (F8)” to program the image to qspiflash first then clicking “Start/Stop Debug Session (Ctrl+F5)” to start debugging.

MIMXRT1040-EVK
Hardware requirements
  • Mini/micro USB cable

  • MIMXRT1040-EVK board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

When the example runs successfully, the following message is displayed in the terminal:

RNGA Peripheral Driver Example Generate 10 random numbers: Random[0] = 0xE1554295 Random[1] = 0x827AD456 Random[2] = 0x9A1CBE1E Random[3] = 0x4354CB53 Random[4] = 0xFE3B2494 Random[5] = 0xEDAB3F7D Random[6] = 0x9AB91722 Random[7] = 0x4F54D999 Random[8] = 0x492414D1 Random[9] = 0x84611992

Press any key to continue…

EVK-MIMXRT1064
Hardware requirements
  • Mini/micro USB cable

  • EVK-MIMXRT1064 board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

When the example runs successfully, the following message is displayed in the terminal:

RNGA Peripheral Driver Example Generate 10 random numbers: Random[0] = 0xE1554295 Random[1] = 0x827AD456 Random[2] = 0x9A1CBE1E Random[3] = 0x4354CB53 Random[4] = 0xFE3B2494 Random[5] = 0xEDAB3F7D Random[6] = 0x9AB91722 Random[7] = 0x4F54D999 Random[8] = 0x492414D1 Random[9] = 0x84611992

Press any key to continue…

EVK-MIMXRT595
Hardware requirements
  • Micro USB cable

  • EVK-MIMXRT595 board

  • Personal Computer

Board settings
Prepare the Demo
  1. Connect a micro USB cable between the PC host and the CMSIS DAP USB port (J40) on the board

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Launch the debugger in your IDE to begin running the demo.

Running the demo

The log below shows the output of the hello world demo in the terminal window:

TRNG Peripheral Driver Example
Generate 10 random numbers: 
Random[0] = 0x201FEB53
Random[1] = 0x85A32C28
Random[2] = 0xDC66342C
Random[3] = 0xFD43ACFF
Random[4] = 0x1CD53C0
Random[5] = 0xB27EDBEB
Random[6] = 0x32AB81D5
Random[7] = 0x6AA5B70F
Random[8] = 0x81C41286
Random[9] = 0xC9620BD8

 Press any key to continue... 
EVK-MIMXRT685
Hardware requirements
  • Micro USB cable

  • EVK-MIMXRT685 board

  • Personal Computer

Board settings
Prepare the Demo
  1. Connect a micro USB cable between the PC host and the CMSIS DAP USB port (J5) on the board

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Launch the debugger in your IDE to begin running the demo.

Running the demo

The log below shows the output of the trng example in the terminal window:

TRNG Peripheral Driver Example
Generate 10 random numbers: 
Random[0] = 0x201FEB53
Random[1] = 0x85A32C28
Random[2] = 0xDC66342C
Random[3] = 0xFD43ACFF
Random[4] = 0x1CD53C0
Random[5] = 0xB27EDBEB
Random[6] = 0x32AB81D5
Random[7] = 0x6AA5B70F
Random[8] = 0x81C41286
Random[9] = 0xC9620BD8

 Press any key to continue... 
FRDM-K32L2A4S
Hardware requirements
  • Mini USB cable

  • FRDM-K32L2A4S board

  • Personal Computer

Board settings

This example project does not call for any special hardware configurations. Although not required, the recommendation is to leave the development board’s jumper settings and configurations in default state when running this example.

Prepare the Demo
  1. Connect a USB cable between the PC host and the OpenSDA USB port on the board.

  2. Open a serial terminal with these settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the example.

Running the demo

When the example runs successfully, you can see the similar information from the terminal as below.

TRNG Peripheral Driver Example
Generate 10 random numbers:
Random[0] = 0xF84D63F2
Random[1] = 0xC480F1AC
Random[2] = 0x554277AE
Random[3] = 0x13EAFA4E
Random[4] = 0x3FDF87B0
Random[5] = 0x502E3E7A
Random[6] = 0x6B692AAE
Random[7] = 0x8906DB6C
Random[8] = 0x8BC1AC01
Random[9] = 0xD9C74853

 Press any key to continue...
FRDM-K32L3A6
Hardware requirements
  • Mini USB cable

  • FRDM-K32L3A6 board

  • Personal Computer

Board settings

This example project does not call for any special hardware configurations. Although not required, the recommendation is to leave the development board’s jumper settings and configurations in default state when running this example.

Prepare the Demo
  1. Connect a USB cable between the PC host and the OpenSDA USB port on the board.

  2. Open a serial terminal with these settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the example.

Running the demo

When the example runs successfully, you can see the similar information from the terminal as below.

TRNG Peripheral Driver Example
Generate 10 random numbers:
Random[0] = 0xF84D63F2
Random[1] = 0xC480F1AC
Random[2] = 0x554277AE
Random[3] = 0x13EAFA4E
Random[4] = 0x3FDF87B0
Random[5] = 0x502E3E7A
Random[6] = 0x6B692AAE
Random[7] = 0x8906DB6C
Random[8] = 0x8BC1AC01
Random[9] = 0xD9C74853

 Press any key to continue...
FRDM-MCXW23
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXW23 Board

  • Personal Computer

Board settings
Prepare the Demo
  1. Connect a USB cable between the host PC and the FRDM board J10.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

When the example runs successfully, the following message is displayed in the terminal:

TRNG Peripheral Driver Example
Generate 10 random numbers: 
Random[0] = 0x306C5FEC
Random[1] = 0xCB70E82
Random[2] = 0x9427CDBF
Random[3] = 0xC9A727DA
Random[4] = 0x48ABB85B
Random[5] = 0xF55F0CDE
Random[6] = 0xA064B90C
Random[7] = 0xB2D1D7ED
Random[8] = 0xA8720A46
Random[9] = 0x5D9ADC60

 Press any key to continue... 
FRDM-RW612
Hardware requirements
  • Two micro USB cables

  • FRDM-RW612 board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo

Note: MCUXpresso IDE project default debug console is semihost

  1. Connect a micro USB cable between the PC host and the MCU-Link USB port (J10) on the board

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

The log below shows example output of the random number generator demo in the terminal window:

Generate 10 random numbers:
Random[0] = 0xED89EEA6
Random[1] = 0xE6BFE1AD
Random[2] = 0x8F7B8048
Random[3] = 0x28E7548F
Random[4] = 0x93CC02B7
Random[5] = 0xCF178D2F
Random[6] = 0xD5947CDD
Random[7] = 0x255E1955
Random[8] = 0xFBA3BF91
Random[9] = 0xC26C7ACE

 Press any key to continue...
MIMXRT685-AUD-EVK
Hardware requirements
  • Micro USB cable

  • MIMXRT685-AUD-EVK board

  • Personal Computer

Board settings
Prepare the Demo
  1. Connect a micro USB cable between the PC host and the CMSIS DAP USB port (J5) on the board

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Launch the debugger in your IDE to begin running the demo.

Running the demo

The log below shows the output of the trng example in the terminal window:

TRNG Peripheral Driver Example
Generate 10 random numbers: 
Random[0] = 0x201FEB53
Random[1] = 0x85A32C28
Random[2] = 0xDC66342C
Random[3] = 0xFD43ACFF
Random[4] = 0x1CD53C0
Random[5] = 0xB27EDBEB
Random[6] = 0x32AB81D5
Random[7] = 0x6AA5B70F
Random[8] = 0x81C41286
Random[9] = 0xC9620BD8

 Press any key to continue... 
MIMXRT700-EVK
Hardware requirements
  • Micro USB cable

  • MIMXRT700-EVK board

  • Personal Computer

Board settings
Prepare the Demo
  1. Connect a micro USB cable between the PC host and the MCU-LINK on the board

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Launch the debugger in your IDE to begin running the demo.

Running the demo

The log below shows the output of the hello world demo in the terminal window:

TRNG Peripheral Driver Example
Generate 10 random numbers: 
Random[0] = 0x201FEB53
Random[1] = 0x85A32C28
Random[2] = 0xDC66342C
Random[3] = 0xFD43ACFF
Random[4] = 0x1CD53C0
Random[5] = 0xB27EDBEB
Random[6] = 0x32AB81D5
Random[7] = 0x6AA5B70F
Random[8] = 0x81C41286
Random[9] = 0xC9620BD8

 Press any key to continue... 
RD-RW612-BGA
Hardware requirements
  • Two micro USB cables

  • RD-RW612-BGA board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo

Note: MCUXpresso IDE project default debug console is semihost

  1. Connect a micro USB cable between the host PC and the +5V Power only USB port on the target board (J1).

  2. Connect a micro USB cable between the host PC and the Debug Link USB port on the target board (J8).

  3. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  4. Download the program to the target board.

  5. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

The log below shows example output of the random number generator demo in the terminal window:

Generate 10 random numbers:
Random[0] = 0xED89EEA6
Random[1] = 0xE6BFE1AD
Random[2] = 0x8F7B8048
Random[3] = 0x28E7548F
Random[4] = 0x93CC02B7
Random[5] = 0xCF178D2F
Random[6] = 0xD5947CDD
Random[7] = 0x255E1955
Random[8] = 0xFBA3BF91
Random[9] = 0xC26C7ACE

 Press any key to continue...
MCXW23-EVK
Hardware requirements
  • Mini/micro USB cable

  • MCXW23-EVK Board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect a USB cable between the host PC and the EVK board J33.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

When the example runs successfully, the following message is displayed in the terminal:

TRNG Peripheral Driver Example
Generate 10 random numbers: 
Random[0] = 0x306C5FEC
Random[1] = 0xCB70E82
Random[2] = 0x9427CDBF
Random[3] = 0xC9A727DA
Random[4] = 0x48ABB85B
Random[5] = 0xF55F0CDE
Random[6] = 0xA064B90C
Random[7] = 0xB2D1D7ED
Random[8] = 0xA8720A46
Random[9] = 0x5D9ADC60

 Press any key to continue... 
FRDM-MCXL255
Hardware requirements
  • USB-C cable

  • FRDM-MCXL255 board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect a USB Type-C cable between the host PC and the MCU-Link USB port (J16) on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

The following lines are printed to the serial terminal when the demo program is executed.

Generate 10 random numbers:
Random[0] = 0xED89EEA6
Random[1] = 0xE6BFE1AD
Random[2] = 0x8F7B8048
Random[3] = 0x28E7548F
Random[4] = 0x93CC02B7
Random[5] = 0xCF178D2F
Random[6] = 0xD5947CDD
Random[7] = 0x255E1955
Random[8] = 0xFBA3BF91
Random[9] = 0xC26C7ACE

 Press any key to continue...
FRDM-MCXA266
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXA266 board

  • Personal Computer

Board settings
Prepare the Demo
  1. Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

The log below shows the output of the trng example in the terminal window:

TRNG Peripheral Driver Example
Generate 10 random numbers: 
Random[0] = 0x201FEB53
Random[1] = 0x85A32C28
Random[2] = 0xDC66342C
Random[3] = 0xFD43ACFF
Random[4] = 0x1CD53C0
Random[5] = 0xB27EDBEB
Random[6] = 0x32AB81D5
Random[7] = 0x6AA5B70F
Random[8] = 0x81C41286
Random[9] = 0xC9620BD8

 Press any key to continue... 
FRDM-MCXA366
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXA366 board

  • Personal Computer

Board settings
Prepare the Demo
  1. Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

The log below shows the output of the trng example in the terminal window:

TRNG Peripheral Driver Example
Generate 10 random numbers: 
Random[0] = 0x201FEB53
Random[1] = 0x85A32C28
Random[2] = 0xDC66342C
Random[3] = 0xFD43ACFF
Random[4] = 0x1CD53C0
Random[5] = 0xB27EDBEB
Random[6] = 0x32AB81D5
Random[7] = 0x6AA5B70F
Random[8] = 0x81C41286
Random[9] = 0xC9620BD8

 Press any key to continue... 
FRDM-MCXA577
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXA577 board

  • Personal Computer

Board settings
Prepare the Demo
  1. Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

The log below shows the output of the trng example in the terminal window:

TRNG Peripheral Driver Example
Generate 10 random numbers: 
Random[0] = 0x201FEB53
Random[1] = 0x85A32C28
Random[2] = 0xDC66342C
Random[3] = 0xFD43ACFF
Random[4] = 0x1CD53C0
Random[5] = 0xB27EDBEB
Random[6] = 0x32AB81D5
Random[7] = 0x6AA5B70F
Random[8] = 0x81C41286
Random[9] = 0xC9620BD8

 Press any key to continue... 
FRDM-MCXC162
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXC162 board

  • Personal Computer

Board settings
Prepare the Demo
  1. Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

The log below shows the output of the trng example in the terminal window:

TRNG Peripheral Driver Example
Generate 10 random numbers: 
Random[0] = 0x201FEB53
Random[1] = 0x85A32C28
Random[2] = 0xDC66342C
Random[3] = 0xFD43ACFF
Random[4] = 0x1CD53C0
Random[5] = 0xB27EDBEB
Random[6] = 0x32AB81D5
Random[7] = 0x6AA5B70F
Random[8] = 0x81C41286
Random[9] = 0xC9620BD8

 Press any key to continue... 
FRDM-KW43
Hardware requirements
  • Type-C USB cable

  • FRDM-KW43 Board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect a USB cable between the host PC and the FRDM board J28.

  2. Open a serial terminal on PC for the serial device with these settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

The following lines are printed to the serial terminal when the demo program is executed. The three values printed each time may be different.

START DEMO SYSPM
eventcounter = 7
eventcounter = 122034
eventcounter = 279104
END DEMO SYSPM
FRDM-MCXW70
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXW70 Board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect a USB cable between the host PC and the FRDM board J28.

  2. Open a serial terminal on PC for the serial device with these settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

The following lines are printed to the serial terminal when the demo program is executed. The three values printed each time may be different.

START DEMO SYSPM
eventcounter = 7
eventcounter = 122034
eventcounter = 279104
END DEMO SYSPM
FRDM-MCXA287
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXA287 board

  • Personal Computer

Board settings
Prepare the Demo
  1. Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

The log below shows the output of the trng example in the terminal window:

TRNG Peripheral Driver Example
Generate 10 random numbers: 
Random[0] = 0x201FEB53
Random[1] = 0x85A32C28
Random[2] = 0xDC66342C
Random[3] = 0xFD43ACFF
Random[4] = 0x1CD53C0
Random[5] = 0xB27EDBEB
Random[6] = 0x32AB81D5
Random[7] = 0x6AA5B70F
Random[8] = 0x81C41286
Random[9] = 0xC9620BD8

 Press any key to continue...