Skip to content

Nordic nrf54l port (with and without TrustZone)#724

Open
mattia-moffa wants to merge 13 commits intowolfSSL:masterfrom
mattia-moffa:20260302-nrf54l15
Open

Nordic nrf54l port (with and without TrustZone)#724
mattia-moffa wants to merge 13 commits intowolfSSL:masterfrom
mattia-moffa:20260302-nrf54l15

Conversation

@mattia-moffa
Copy link
Contributor

This is partially based on #666, with changes to adapt it to the nrf54l and TrustZone support. It should also work on nrf54l05 and nrf54l10 by adjusting the config file to fit their RAM and RRAM sizes.

@mattia-moffa mattia-moffa self-assigned this Mar 13, 2026
Copilot AI review requested due to automatic review settings March 13, 2026 14:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new Nordic nRF54L (nRF54L15-focused) target port, including optional TrustZone support, and wires it into the build system and documentation.

Changes:

  • Introduces nRF54L HAL (RRAM flash ops, UART, TrustZone setup, TRNG in wolfCrypt secure mode) plus linker scripts for TZ/non-TZ builds.
  • Adds an nRF54L SPI backend and integrates it into the generic SPI driver selection.
  • Adds nRF54L test-app support (linker script + make target selection) and documents the target + provides example configs.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
test-app/app_nrf54l.c New smoke-test app for nRF54L15 (LED + UART output).
test-app/Makefile Selects appropriate test-app linker script for TARGET=nrf54l with/without TZ.
test-app/ARM-nrf54l-ns.ld Non-secure test-app linker script for TZ builds.
include/spi_drv.h Adds nrf54l SPI driver header selection.
hal/spi/spi_drv_nrf54l.h New SPI pin defaults for nRF54L DK.
hal/spi/spi_drv_nrf54l.c New SPI backend implementation for nRF54L SPIM.
hal/nrf54l.ld Secure/TZ bootloader linker script (keyvault + NSC regions, NS RAM).
hal/nrf54l-ns.ld Non-TZ bootloader linker script.
hal/nrf54l.h nRF54L register/bit definitions and address mapping for secure vs non-secure builds.
hal/nrf54l.c nRF54L HAL implementation (UART, RRAM flash, TZ init, TRNG, stubs for ext flash).
docs/Targets.md Adds nRF54L15 target documentation, memory layout, build/flash instructions.
config/examples/nrf54l15.config Example non-TZ config for nRF54L15.
config/examples/nrf54l15-wolfcrypt-tz.config Example TZ + wolfCrypt config for nRF54L15.
arch.mk Adds nrf54l linker-script selection behavior.
CMakeLists.txt Adds nrf54l to ARM target list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings March 13, 2026 16:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new Nordic nRF54L (nRF54L15) target port with optional TrustZone support, including a test application, linker scripts, HAL implementation, and SPI backend plumbing.

Changes:

  • Introduces nRF54L HAL (clocking, UART, RRAM “flash” ops, TrustZone/SAU+MPC+SPU setup, TRNG for secure mode).
  • Adds nRF54L SPI backend integration and a basic smoke-test app + linker script for NS test-app builds.
  • Documents the new target and adds example configs + build-system target registration.

Reviewed changes

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

Show a summary per file
File Description
test-app/app_nrf54l.c Adds a simple LED+UART “smoke test” for nRF54L15.
test-app/Makefile Selects an nRF54L-specific NS linker script when TZEN=1.
test-app/ARM-nrf54l-ns.ld Provides a non-secure test-app linker script for TrustZone builds.
include/spi_drv.h Wires in the nRF54L SPI driver header under TARGET_nrf54l.
hal/spi/spi_drv_nrf54l.h Defines default DK pin mux and CS macros for SPI flash usage.
hal/spi/spi_drv_nrf54l.c Implements an nRF54L SPIM EasyDMA-based SPI backend.
hal/nrf54l.ld Adds the secure (TZ) wolfBoot linker script incl. NSC region.
hal/nrf54l.h Adds register definitions and macros for nRF54L peripherals + TZ helpers.
hal/nrf54l.c Implements nRF54L HAL (UART, clocks, RRAM ops, TrustZone init, TRNG).
hal/nrf54l-ns.ld Adds a non-TZ wolfBoot linker script variant.
docs/Targets.md Documents nRF54L15 (layouts, UARTs, build/flash/update steps).
config/examples/nrf54l15.config Adds a non-TZ example configuration for nRF54L15.
config/examples/nrf54l15-wolfcrypt-tz.config Adds a TZ + wolfCrypt example configuration with keyvault+NSC.
arch.mk Selects the nRF54L “-ns” linker script when TZEN != 1.
CMakeLists.txt Registers nrf54l in the ARM targets list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings March 13, 2026 20:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds initial support for Nordic nRF54L (nRF54L15 DK) including optional TrustZone configuration, along with a basic test application and CI build coverage.

Changes:

  • Introduces nRF54L HAL implementation, headers, and linker scripts (secure + TrustZone/non-secure variants).
  • Adds nRF54L SPI flash backend and test-app target support (including non-secure test-app linker script).
  • Documents the nRF54L15 target and adds CI workflows for the new example configs.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
test-app/app_nrf54l.c Adds a minimal smoke-test app (UART + LED + version byte output) for nRF54L.
test-app/Makefile Adds TARGET=nrf54l linker script selection for test-app (TZ vs non-TZ).
test-app/ARM-nrf54l-ns.ld Adds non-secure test-app linker script for TrustZone builds.
include/spi_drv.h Wires in the nrf54l SPI backend include.
hal/spi/spi_drv_nrf54l.h Defines default SPI pinmux for nRF54L DK.
hal/spi/spi_drv_nrf54l.c Implements SPI flash backend using SPIM + EasyDMA.
hal/nrf54l.ld Adds nRF54L secure (TZ) linker script (keyvault + NSC regions).
hal/nrf54l.h Adds nRF54L register definitions and HAL constants (GPIO/UART/SPIM/TZ).
hal/nrf54l.c Adds nRF54L HAL implementation (clocks, UART, RRAM, TZ setup, TRNG).
hal/nrf54l-ns.ld Adds nRF54L non-TZ linker script variant.
docs/Targets.md Documents nRF54L15 target, memory layouts, build/flash/update steps.
config/examples/nrf54l15.config Adds non-TrustZone example configuration for nRF54L15.
config/examples/nrf54l15-wolfcrypt-tz.config Adds TrustZone + wolfCrypt example configuration for nRF54L15.
arch.mk Adds nrf54l linker script selection logic.
CMakeLists.txt Adds nrf54l to the list of ARM targets.
.github/workflows/test-configs.yml Adds CI build jobs for the two new nRF54L15 example configs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings March 14, 2026 01:47
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new Nordic nRF54L15 target port with optional TrustZone support, including build system integration, HAL + SPI backend, example configs, and documentation/CI updates.

Changes:

  • Introduces nRF54L HAL (flash, clocks, UART, TrustZone setup) plus linker scripts for TZ and non-TZ builds.
  • Adds an nRF54L SPI driver backend and wires it into the generic SPI driver include.
  • Adds two example configs + docs and enables CI build checks for the new target.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
test-app/app_nrf54l.c Adds a minimal smoke-test app for nRF54L15 (LED + UART output).
test-app/Makefile Selects appropriate linker script template for nrf54l test-app, including TZ NS build.
test-app/ARM-nrf54l-ns.ld Adds non-secure test-app linker script for TrustZone build.
include/spi_drv.h Wires in the nRF54L SPI driver header when targeting nrf54l.
hal/spi/spi_drv_nrf54l.h Defines default SPI pinmux for nRF54L15-DK.
hal/spi/spi_drv_nrf54l.c Implements SPIM EasyDMA-based SPI backend for SPI_FLASH on nRF54L.
hal/nrf54l.ld Adds Secure/TZ linker script with Keyvault + NSC regions.
hal/nrf54l.h Adds nRF54L register definitions (GPIO/UART/SPIM/RRAMC/SPU/MPC/TRNG).
hal/nrf54l.c Adds nRF54L HAL implementation including TrustZone partitioning and UART.
hal/nrf54l-ns.ld Adds non-TZ linker script variant used by build system for nrf54l.
docs/Targets.md Documents nRF54L15 target, memory layouts, build/flash/update steps.
config/examples/nrf54l15.config Adds baseline (no TrustZone) nRF54L15 example config.
config/examples/nrf54l15-wolfcrypt-tz.config Adds TrustZone + wolfCrypt/PKCS11 example config with NSC/keyvault.
arch.mk Hooks nrf54l into linker script selection logic.
CMakeLists.txt Adds nrf54l to ARM target list.
.github/workflows/test-configs.yml Adds CI build jobs for both new example configs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings March 14, 2026 02:25
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds initial support for the Nordic nRF54L15 (with optional TrustZone) including HAL, linker scripts, configs, and a smoke-test app.

Changes:

  • Introduces nRF54L HAL implementation (clocking, RRAM flash writes, TrustZone setup, UART, TRNG).
  • Adds nRF54L SPI flash backend and associated target wiring.
  • Adds build/CI/docs/config updates to support nrf54l15 (TZ and non-TZ variants) and a test app.

Reviewed changes

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

Show a summary per file
File Description
test-app/app_nrf54l.c Adds a minimal nRF54L15 smoke test app with UART + LED toggle.
test-app/Makefile Selects linker script template for the nrf54l test-app, including TZ non-secure variant.
test-app/ARM-nrf54l-ns.ld Adds a non-secure test-app linker script for TZ builds (NS RAM base).
include/spi_drv.h Wires in the nrf54l SPI backend header based on target define.
hal/spi/spi_drv_nrf54l.c Implements SPIM-based SPI backend for SPI_FLASH on nrf54l.
hal/spi/spi_drv_nrf54l.h Provides default nRF54L15-DK pin mux defines for SPI backend.
hal/nrf54l.c Implements core nrf54l HAL: clocks, UART, RRAM flash operations, TrustZone init, TRNG.
hal/nrf54l.h Adds nrf54l register/memory map and helper macros for HAL and drivers.
hal/nrf54l.ld Adds secure (TZ) linker script including NSC + keyvault regions.
hal/nrf54l-ns.ld Adds non-TZ linker script variant (single-image RAM/flash layout).
docs/Targets.md Documents nRF54L15 target, flash layout, build/flash/update steps.
config/examples/nrf54l15.config Adds example config for nrf54l15 without TrustZone.
config/examples/nrf54l15-wolfcrypt-tz.config Adds example TrustZone + wolfCrypt/keyvault/NSC config for nrf54l15.
arch.mk Selects appropriate linker script input for nrf54l non-TZ builds.
CMakeLists.txt Registers nrf54l in ARM targets list.
.github/workflows/test-configs.yml Adds CI build jobs for the two new nrf54l15 example configs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings March 16, 2026 19:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds initial support for the Nordic nRF54L15 target, including a TrustZone-enabled configuration, and wires it into the build system, test-app, CI, and documentation.

Changes:

  • Introduce nRF54L HAL (flash, UART, clocks, TrustZone setup, TRNG) and linker scripts for secure/non-secure builds.
  • Add nRF54L SPI backend and integrate it into the common SPI driver include path.
  • Add example configs + CI build jobs and document nRF54L15 usage and memory layout.

Reviewed changes

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

Show a summary per file
File Description
test-app/app_nrf54l.c Adds a basic smoke test app for nRF54L (UART + LED toggle).
test-app/Makefile Selects the correct test-app linker script for nrf54l (+ TrustZone NS variant).
test-app/ARM-nrf54l-ns.ld Adds non-secure test-app linker script for TZ builds.
include/spi_drv.h Hooks nRF54L SPI driver into the generic SPI driver selection.
hal/spi/spi_drv_nrf54l.h Defines default pin muxing for SPI on nRF54L15-DK.
hal/spi/spi_drv_nrf54l.c Implements SPIM-based SPI FLASH backend for nRF54L.
hal/nrf54l.ld Adds secure wolfBoot linker script with keyvault + NSC regions.
hal/nrf54l.h Adds nRF54L register definitions and HAL interface.
hal/nrf54l.c Implements nRF54L HAL (RRAM, UART, clocks, TrustZone, TRNG).
hal/nrf54l-ns.ld Adds non-TZ wolfBoot linker script for nRF54L.
docs/Targets.md Documents nRF54L15 target, build steps, layouts, and update testing.
config/examples/nrf54l15.config Adds non-TrustZone example config for nRF54L15.
config/examples/nrf54l15-wolfcrypt-tz.config Adds TrustZone + wolfCrypt + keyvault example config.
arch.mk Selects alternate linker script for nRF54L when TZ is disabled.
CMakeLists.txt Registers nrf54l as an ARM target.
.github/workflows/test-configs.yml Adds CI build coverage for both new nRF54L example configs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mattia-moffa
Copy link
Contributor Author

mattia-moffa commented Mar 16, 2026

About the last Copilot review:

  • spi_init polarity-phase issue: this is how all other targets do it, no need to over-complicate things. spi_init is never called multiple times.
  • spi_read issue: it's okay for the firmware to get stuck if there is an error, there would be no way to recover from it anyway.
  • The linker script problems apply to all wolfBoot ports (or all TrustZone ones). Fixing those might be worth it, but in a separate PR.
  • The RNG FIFO thing is really a small nitpick and I don't think using timeouts to handle locks caused by misconfigurations/hardware faults is worth it. If that were to happen we should just fix the cause.

Comment on lines +1 to +4
/* app_nrf54l.c
*
* Basic smoke test for the nRF54L15 target.
*/
Copy link
Member

Choose a reason for hiding this comment

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

Unify comment header: Other apps have full copyright statement.

*
* Pinout: see spi_drv_nrf54l.h
*
* Copyright (C) 2025 wolfSSL Inc.
Copy link
Member

Choose a reason for hiding this comment

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

nit: copyright year in all new files (same in hal, include, test-app)

Copilot AI review requested due to automatic review settings March 17, 2026 12:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new Nordic nRF54L (nRF54L15-DK) target port, including both non-TrustZone and TrustZone-enabled builds, and wires it into the build system, docs, and CI so it can be built/tested like existing ARM targets.

Changes:

  • Introduces the nRF54L HAL (clocking, RRAM flash ops, TrustZone setup, TRNG) plus linker scripts for secure/non-secure layouts.
  • Adds an nRF54L SPI backend header/driver hook-up and a minimal nRF54L test application + non-secure test-app linker script.
  • Adds example configs, documentation, CMake target listing, and CI build jobs for the new target/configs.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test-app/app_nrf54l.c New nRF54L test app (UART print + LED toggle).
test-app/Makefile Selects nRF54L non-secure test-app linker script when TZEN=1; minor formatting.
test-app/ARM-nrf54l-ns.ld New non-secure test-app linker script for TZ builds (NS RAM region).
include/spi_drv.h Adds nRF54L SPI driver header selection.
hal/spi/spi_drv_nrf54l.h New nRF54L SPI pin defaults/macros.
hal/spi/spi_drv_nrf54l.c New nRF54L SPIM EasyDMA-based SPI backend implementation.
hal/nrf54l.ld New secure/TZ bootloader linker script (secure RAM + heap + NSC region).
hal/nrf54l-ns.ld New non-TZ bootloader linker script for nRF54L.
hal/nrf54l.h New nRF54L register definitions/macros (GPIO/UART/SPIM/SPU/MPC/TRNG, etc.).
hal/nrf54l.c New nRF54L HAL implementation (UART, clocks, RRAM flash, TrustZone setup, TRNG).
docs/Targets.md Documents nRF54L15 target, memory maps, build/flash/update instructions.
config/examples/nrf54l15.config Example config for non-TZ nRF54L15.
config/examples/nrf54l15-wolfcrypt-tz.config Example config for TZ + wolfCrypt/NSC/keyvault variant.
arch.mk Selects nRF54L non-TZ linker script when TZEN != 1.
CMakeLists.txt Adds nrf54l to ARM targets list.
.github/workflows/test-configs.yml Adds CI build jobs for the two new nRF54L example configs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +40 to +46
#ifdef DEBUG_UART

#define UART_WRITE_BUF_SIZE 128


static void uart_init_device(int device, uint32_t bitrate, uint8_t data, char parity, uint8_t stop)
{
#define SPI_CS_TPM SPI_CS_PIN
#endif

#define SPI_CS_FLASH SPI_CS_PIN
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.

5 participants