nRF5 SDK v15.0.0
RNG Example

The RNG Example shows how to initialize and use an RNG using RNG - Random Number Generator.

Note
This example can run in software or hardware, depending on the supported features of your SoC. It uses the default backend for the specific platform, but you can test it using different backends. For more details on how to change backends, see Configuring nrf_crypto frontend and backends.

You can find the source code and the project file of the example in the following folder: <InstallFolder>\examples\crypto\nrf_crypto\rng

Note
nrf_crypto examples are configured to support all nrf_crypto frontends and available backends, including backends that may not be required for the cryptographic operation in the given example.
To build the µECC library required for the nrf_crypto µECC backend support, see Installing micro-ecc.
Alternatively, remove the reference to the µECC library from the project if you do not intend to use µECC.

Testing

Test the RNG Example application by performing the following steps:

  1. Skip this step if you are using an RTT viewer.
    Start a terminal emulator like PuTTY and connect to the used COM port with the following UART settings:
    • Baud rate: 115.200
    • 8 data bits
    • 1 stop bit
    • No parity
    • HW flow control: None
  2. Compile and program the application.
  3. Observe the generated random numbers in the log using an RTT viewer or a terminal emulator.

Documentation feedback | Developer Zone | Subscribe | Updated