Skip to content

EFR32xG25 Secure Element example - #627

Open
dgarske wants to merge 1 commit into
wolfSSL:masterfrom
dgarske:efr32xg25_cryptocb
Open

EFR32xG25 Secure Element example#627
dgarske wants to merge 1 commit into
wolfSSL:masterfrom
dgarske:efr32xg25_cryptocb

Conversation

@dgarske

@dgarske dgarske commented Sep 9, 2026

Copy link
Copy Markdown
Member

Add EFR32xG25 Secure Element example

Headless slc-cli project that runs the wolfCrypt test and benchmark, and an optional on-device TLS 1.3 test, on an EFR32xG25 with crypto routed to the Secure Element through the wolfSSL crypto callback port.

Needs the port from wolfSSL PR wolfSSL/wolfssl#11267

What it adds

embedded/efr32xg25/:

  • wolfcrypt_test.slcp, user_settings.h - project and shared configuration
  • app.c - entry point, prints the SE firmware version and Secure Vault level, then runs the test and benchmark
  • tls13_test.c - optional TLS 1.3 client and server, both on the device
  • build.sh, flash.sh - slc generate plus make, and commander flash
  • README.md - toolchain install, build, and the measured hardware-versus-software table

Design notes

  • Builds from a wolfSSL source checkout, no prebuilt library. It expects one beside wolfssl-examples; WOLFSSL_ROOT overrides that. slc resolves every path: entry relative to the .slcp file, so a non-default root is rewritten to a path relative to the example directory and the rewritten copy has to stay there.
  • The toolchain installs headlessly with Silicon Labs Tool. As of SLC-CLI v6 the CLI is no longer a direct download, so build.sh and flash.sh read ~/.silabs/sdks.json and ~/.silabs/tools.json rather than hardcoding paths.
  • WOLFSSL_SILABS_CRYPTOCB points WC_USE_DEVID at the SE, so the stock benchmark measures every algorithm twice and labels the rows HW and SW. Each comparison therefore comes from one run on one part.
  • The kit has no RTC, so app.c supplies a _gettimeofday() seeded from the build date, overriding newlib's weak stub. Without it every certificate reads as not yet valid. That is adequate for a self-contained demo and nothing more.

Hardware and test status

Validated on an EFR32FG25B222F1920IM56 (BRD4270B, Secure Vault High, SE firmware 2.2.0):

  • wolfcrypt_test full PASS, benchmark clean.
  • TLS 1.3 handshake and application data for TLS13-AES128-GCM-SHA256, TLS13-AES256-GCM-SHA384 and TLS13-CHACHA20-POLY1305-SHA256, all pass.

Scope

The TLS 1.3 test and the Thumb2 assembly software path are both opt-in blocks at the top of user_settings.h; their sources are already in the project and compile to nothing while off.

@dgarske dgarske self-assigned this Sep 9, 2026
Copilot AI lite review requested due to automatic review settings September 9, 2026 22:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pull request overview

Adds a headless Simplicity Studio (slc-cli) example project for EFR32xG25 that runs wolfcrypt_test + benchmark, with optional on-device TLS 1.3 mem-IO testing, all routed through the Silicon Labs Secure Element via wolfSSL crypto callbacks.

Changes:

  • Adds an slc project (.slcp) that builds wolfSSL sources from a neighboring checkout and configures required Silicon Labs components.
  • Introduces shared user_settings.h for Secure Element offload + optional TLS 1.3 and Thumb2 asm toggles.
  • Adds headless build.sh / flash.sh scripts and documentation for toolchain setup, build/flash, and measured results.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
embedded/efr32xg25/wolfcrypt_test.slcp New SLC project definition, sources, components, and build configuration for the example.
embedded/efr32xg25/user_settings.h Shared wolfSSL/wolfCrypt configuration for SE crypto-callback routing and optional TLS/asm features.
embedded/efr32xg25/app.c Main entry point: prints SE info, runs tests/bench, optional TLS 1.3, and provides _gettimeofday() when needed.
embedded/efr32xg25/tls13_test.c Optional TLS 1.3 on-device handshake + record-layer test over an in-memory transport.
embedded/efr32xg25/build.sh Headless generation/build script that locates SDK/tools via ~/.silabs/*.json registries.
embedded/efr32xg25/flash.sh Flash/reset script using Silicon Labs Commander located via tools.json.
embedded/efr32xg25/README.md Setup and usage docs plus performance measurements and notes.
embedded/efr32xg25/.gitignore Ignores generated build output and local rewritten .slcp.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread embedded/efr32xg25/build.sh Outdated
Comment thread embedded/efr32xg25/flash.sh Outdated
Comment thread embedded/efr32xg25/flash.sh Outdated
Comment thread embedded/efr32xg25/tls13_test.c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants