Skip to content

drivers/crypto: add Microchip RNG90 support, esp32c3-devkit enablement and documentation#19056

Open
FelipeMdeO wants to merge 2 commits into
apache:masterfrom
FelipeMdeO:feature/rng90-driver
Open

drivers/crypto: add Microchip RNG90 support, esp32c3-devkit enablement and documentation#19056
FelipeMdeO wants to merge 2 commits into
apache:masterfrom
FelipeMdeO:feature/rng90-driver

Conversation

@FelipeMdeO

@FelipeMdeO FelipeMdeO commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds support for the Microchip RNG90 in NuttX and documents the example application.

The Microchip RNG90 is a low-cost standalone hardware RNG designed to provide cryptographic-grade random numbers for embedded systems. RNG90 targets FIPS 140-ready designs and is compliant with the NIST SP 800-90A/B/C framework, making it useful for secure key generation, nonces, challenges, and other entropy-dependent operations.

Changes included:

  • RNG90 driver integration in kernel/board flow (device registration and usage via /dev/rng0).
  • ESP32-C3 board configuration updates for RNG90 enablement.
  • New user documentation for the RNG90 example at Documentation/applications/examples/rng90/index.rst, including overview, configuration, usage, references, and hardware validation transcript.

Impact

  • New hardware feature support: RNG90 TRNG device.
  • New board configuration support for esp32c3-devkit.

Testing

Host:

  • macOS

Target:

  • esp32c3-devkit
  • RNG90 connected and enabled
  • Serial port: /dev/cu.wchusbserial140
  • Serial settings: 115200 8N1

You can use app example in apache/nuttx-apps#3529 to test this implementation and generate same result shown below.

Build/flash:

  • make -j4
  • make flash ESPTOOL_PORT=

Hardware validation transcript:

nsh> uname -a
NuttX 12.6.0-RC1 4130050287-dirty Jun  7 2026 22:11:21 risc-v esp32c3-devkit

nsh> ls /dev/rng0
 /dev/rng0

nsh> rng90
RNG90 example: device /dev/rng0
Read 32 random byte(s):
0d b2 71 d1 40 1f 3c 50 52 3d c6 2c a9 74 ec 60
44 ab 67 bb c4 34 1b ac 48 62 fe b9 fd 95 c9 cb

nsh> rng90 /dev/rng0 16
RNG90 example: device /dev/rng0
Read 16 random byte(s):
ef 82 5f b7 41 f1 48 13 5a 41 16 3a 67 1b 90 f2

nsh> rng90 /dev/rng0 64
Invalid count 64, clamping to 32
RNG90 example: device /dev/rng0
Read 32 random byte(s):
bb be 2f 20 7f c8 33 8d 18 90 c8 fb 94 db bc e6
84 41 17 6f 5a be 5a 06 c3 7b f1 30 ac f2 a6 f5

@github-actions github-actions Bot added Size: L The size of the change in this PR is large Area: Crypto Board: risc-v labels Jun 8, 2026
@FelipeMdeO FelipeMdeO force-pushed the feature/rng90-driver branch from 7ac3bbd to 24b3e2d Compare June 8, 2026 02:14
xiaoxiang781216
xiaoxiang781216 previously approved these changes Jun 8, 2026
Add Microchip RNG90 TRNG driver with board integration for esp32c3 and rng90 defconfig support.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
Document configuration, usage, Kconfig enable path, and hardware validation for the RNG90 example.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
@eren-terzioglu

Copy link
Copy Markdown
Contributor

Please run refresh.sh tool. This command should work fine:

./tools/refresh.sh --defaults --silent esp32c3-devkit:rng90

@FelipeMdeO

Copy link
Copy Markdown
Contributor Author

Hello @eren-terzioglu , I called refresh.sh but I can see any difference.
@simbit18 , sorry, the pipeline is crashing again. Can you help me, please?

@eren-terzioglu

eren-terzioglu commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Hello @eren-terzioglu , I called refresh.sh but I can see any difference. @simbit18 , sorry, the pipeline is crashing again. Can you help me, please?

Hi,

I run the command locally and here is the output:

~/nuttxspace/nuttx$ ./tools/refresh.sh --defaults --silent esp32c3-devkit:rng90
  [1/1] Normalize esp32c3-devkit:rng90
28d27
< CONFIG_EXAMPLES_RNG90=y
Saving the new configuration file

And diff:

~/nuttxspace/nuttx$ git diff
diff --git a/boards/risc-v/esp32c3/esp32c3-devkit/configs/rng90/defconfig b/boards/risc-v/esp32c3/esp32c3-devkit/configs/rng90/defconfig
index 170cbd0ecb..d14c9e9b47 100644
--- a/boards/risc-v/esp32c3/esp32c3-devkit/configs/rng90/defconfig
+++ b/boards/risc-v/esp32c3/esp32c3-devkit/configs/rng90/defconfig
@@ -25,7 +25,6 @@ CONFIG_BUILTIN=y
 CONFIG_CRYPTO=y
 CONFIG_DEV_RNG90=y
 CONFIG_ESPRESSIF_I2C0=y
-CONFIG_EXAMPLES_RNG90=y
 CONFIG_FS_PROCFS=y
 CONFIG_IDLETHREAD_STACKSIZE=2048
 CONFIG_INIT_ENTRYPOINT="nsh_main"

If you add some test to NuttX Apps (seems yes you did in apache/nuttx-apps#3529), please mention it on PR description. CI error is normal because of version mismatch between NuttX and NuttX Apps.

Thanks for adding new support.

@eren-terzioglu

Copy link
Copy Markdown
Contributor

Note: To run a CI with special parameters (e.g special version of nuttx-apps), please check https://github.com/NuttX/manual-nuttx-ci and #18568

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Crypto Board: risc-v Size: L The size of the change in this PR is large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants