nRF5340: nRF RPC Entropy¶
The nRF RPC Entropy sample demonstrates how to use the entropy driver in a dual core device such as nRF5340 DK.
The sample makes use of the entropy driver on the network core of an nRF5340 DK that generates random data, and the Remote procedure call library (nRF RPC) that sends the generated data to the application core using Remote Procedure Calls (RPC).
The entropy data is generated on the network core using the Random Number Generator (RNG) peripheral. The Remote procedure call library (nRF RPC) uses the TinyCBOR data format and transmits the data using the default RPMsg Messaging Protocol (part of OpenAMP) in the transport layer.
The application core uses serialized function calls such as
entropy_remote_get() to control the entropy driver on the network core.
entropy_remote_init() function is used for initializing the entropy, and the
entropy_remote_get() function is used for obtaining the entropy data.
When the sample starts, it displays the generated entropy data in the terminal at an interval of two seconds.
The network core runs the entropy drivers, which use the RNG peripheral.
When the network core receives the
entropy_remote_get() remote function call, the following actions are performed:
The network core searches for function decoders in the decoders table and calls them.
The network core encodes the response data for the function call and sends the data back to the application core.
The sample supports the following development kit:
This sample can be found under
samples/nrf_rpc/entropy_nrf53 in the nRF Connect SDK folder structure.
See Building and programming an application for information about how to build and program the application.
This sample consists of the following sample applications, one each for the application core and the network core:
Application core sample:
Network core sample:
Both of these sample applications must be built and programmed to the dual core device before testing. For details on building samples for a dual core device, see Building and programming a sample.
After programming the sample to your development kit, test it by performing the following steps:
Connect the dual core development kit to the computer using a USB cable. The development kit is assigned a COM port (Windows) or ttyACM device (Linux), which is visible in the Device Manager.
Connect to the kit with a terminal emulator (for example, PuTTY). See How to connect with PuTTY for the required settings.
Reset the development kit.
Observe that the entropy data is displayed periodically in the terminal.