Skip to content

Nordic nrf54l port (with and without TrustZone) - #724

Merged
danielinux merged 14 commits into
wolfSSL:masterfrom
mattia-moffa:20260302-nrf54l15
Mar 18, 2026
Merged

Nordic nrf54l port (with and without TrustZone)#724
danielinux merged 14 commits into
wolfSSL:masterfrom
mattia-moffa:20260302-nrf54l15

Conversation

@mattia-moffa

Copy link
Copy Markdown
Member

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-moffamattia-moffa self-assigned this Mar 13, 2026
CopilotAI review requested due to automatic review settings March 13, 2026 14:46

CopilotAI 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.

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
FileDescription
test-app/app_nrf54l.cNew smoke-test app for nRF54L15 (LED + UART output).
test-app/MakefileSelects appropriate test-app linker script for TARGET=nrf54l with/without TZ.
test-app/ARM-nrf54l-ns.ldNon-secure test-app linker script for TZ builds.
include/spi_drv.hAdds nrf54l SPI driver header selection.
hal/spi/spi_drv_nrf54l.hNew SPI pin defaults for nRF54L DK.
hal/spi/spi_drv_nrf54l.cNew SPI backend implementation for nRF54L SPIM.
hal/nrf54l.ldSecure/TZ bootloader linker script (keyvault + NSC regions, NS RAM).
hal/nrf54l-ns.ldNon-TZ bootloader linker script.
hal/nrf54l.hnRF54L register/bit definitions and address mapping for secure vs non-secure builds.
hal/nrf54l.cnRF54L HAL implementation (UART, RRAM flash, TZ init, TRNG, stubs for ext flash).
docs/Targets.mdAdds nRF54L15 target documentation, memory layout, build/flash instructions.
config/examples/nrf54l15.configExample non-TZ config for nRF54L15.
config/examples/nrf54l15-wolfcrypt-tz.configExample TZ + wolfCrypt config for nRF54L15.
arch.mkAdds nrf54l linker-script selection behavior.
CMakeLists.txtAdds nrf54l to ARM target list.

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

Comment threadhal/nrf54l.c Outdated
Comment threadhal/spi/spi_drv_nrf54l.c Outdated
Comment threadhal/spi/spi_drv_nrf54l.h
Comment threadhal/nrf54l.c Outdated
Comment threadhal/nrf54l.c
Comment threadhal/nrf54l.c
Comment threadhal/nrf54l.c Outdated
CopilotAI review requested due to automatic review settings March 13, 2026 16:59

CopilotAI 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.

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
FileDescription
test-app/app_nrf54l.cAdds a simple LED+UART “smoke test” for nRF54L15.
test-app/MakefileSelects an nRF54L-specific NS linker script when TZEN=1.
test-app/ARM-nrf54l-ns.ldProvides a non-secure test-app linker script for TrustZone builds.
include/spi_drv.hWires in the nRF54L SPI driver header under TARGET_nrf54l.
hal/spi/spi_drv_nrf54l.hDefines default DK pin mux and CS macros for SPI flash usage.
hal/spi/spi_drv_nrf54l.cImplements an nRF54L SPIM EasyDMA-based SPI backend.
hal/nrf54l.ldAdds the secure (TZ) wolfBoot linker script incl. NSC region.
hal/nrf54l.hAdds register definitions and macros for nRF54L peripherals + TZ helpers.
hal/nrf54l.cImplements nRF54L HAL (UART, clocks, RRAM ops, TrustZone init, TRNG).
hal/nrf54l-ns.ldAdds a non-TZ wolfBoot linker script variant.
docs/Targets.mdDocuments nRF54L15 (layouts, UARTs, build/flash/update steps).
config/examples/nrf54l15.configAdds a non-TZ example configuration for nRF54L15.
config/examples/nrf54l15-wolfcrypt-tz.configAdds a TZ + wolfCrypt example configuration with keyvault+NSC.
arch.mkSelects the nRF54L “-ns” linker script when TZEN != 1.
CMakeLists.txtRegisters nrf54l in the ARM targets list.

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

Comment threadtest-app/app_nrf54l.c Outdated
Comment threadhal/nrf54l.c Outdated
Comment threadhal/nrf54l.c Outdated
Comment threaddocs/Targets.md Outdated
Comment threadhal/nrf54l.c Outdated
Comment threadhal/nrf54l.ld
Comment threadhal/spi/spi_drv_nrf54l.c
Comment threadhal/spi/spi_drv_nrf54l.c Outdated
CopilotAI review requested due to automatic review settings March 13, 2026 20:24

CopilotAI 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.

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
FileDescription
test-app/app_nrf54l.cAdds a minimal smoke-test app (UART + LED + version byte output) for nRF54L.
test-app/MakefileAdds TARGET=nrf54l linker script selection for test-app (TZ vs non-TZ).
test-app/ARM-nrf54l-ns.ldAdds non-secure test-app linker script for TrustZone builds.
include/spi_drv.hWires in the nrf54l SPI backend include.
hal/spi/spi_drv_nrf54l.hDefines default SPI pinmux for nRF54L DK.
hal/spi/spi_drv_nrf54l.cImplements SPI flash backend using SPIM + EasyDMA.
hal/nrf54l.ldAdds nRF54L secure (TZ) linker script (keyvault + NSC regions).
hal/nrf54l.hAdds nRF54L register definitions and HAL constants (GPIO/UART/SPIM/TZ).
hal/nrf54l.cAdds nRF54L HAL implementation (clocks, UART, RRAM, TZ setup, TRNG).
hal/nrf54l-ns.ldAdds nRF54L non-TZ linker script variant.
docs/Targets.mdDocuments nRF54L15 target, memory layouts, build/flash/update steps.
config/examples/nrf54l15.configAdds non-TrustZone example configuration for nRF54L15.
config/examples/nrf54l15-wolfcrypt-tz.configAdds TrustZone + wolfCrypt example configuration for nRF54L15.
arch.mkAdds nrf54l linker script selection logic.
CMakeLists.txtAdds nrf54l to the list of ARM targets.
.github/workflows/test-configs.ymlAdds CI build jobs for the two new nRF54L15 example configs.

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

Comment threadhal/spi/spi_drv_nrf54l.c Outdated
Comment threadhal/nrf54l.c Outdated
Comment threadhal/nrf54l.c
Comment threadhal/spi/spi_drv_nrf54l.c
Comment threadhal/nrf54l.h
Comment threadtest-app/app_nrf54l.c
CopilotAI review requested due to automatic review settings March 14, 2026 01:47

CopilotAI 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.

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
FileDescription
test-app/app_nrf54l.cAdds a minimal smoke-test app for nRF54L15 (LED + UART output).
test-app/MakefileSelects appropriate linker script template for nrf54l test-app, including TZ NS build.
test-app/ARM-nrf54l-ns.ldAdds non-secure test-app linker script for TrustZone build.
include/spi_drv.hWires in the nRF54L SPI driver header when targeting nrf54l.
hal/spi/spi_drv_nrf54l.hDefines default SPI pinmux for nRF54L15-DK.
hal/spi/spi_drv_nrf54l.cImplements SPIM EasyDMA-based SPI backend for SPI_FLASH on nRF54L.
hal/nrf54l.ldAdds Secure/TZ linker script with Keyvault + NSC regions.
hal/nrf54l.hAdds nRF54L register definitions (GPIO/UART/SPIM/RRAMC/SPU/MPC/TRNG).
hal/nrf54l.cAdds nRF54L HAL implementation including TrustZone partitioning and UART.
hal/nrf54l-ns.ldAdds non-TZ linker script variant used by build system for nrf54l.
docs/Targets.mdDocuments nRF54L15 target, memory layouts, build/flash/update steps.
config/examples/nrf54l15.configAdds baseline (no TrustZone) nRF54L15 example config.
config/examples/nrf54l15-wolfcrypt-tz.configAdds TrustZone + wolfCrypt/PKCS11 example config with NSC/keyvault.
arch.mkHooks nrf54l into linker script selection logic.
CMakeLists.txtAdds nrf54l to ARM target list.
.github/workflows/test-configs.ymlAdds CI build jobs for both new example configs.

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

Comment threadhal/nrf54l.h
Comment threadhal/spi/spi_drv_nrf54l.c
Comment threadhal/spi/spi_drv_nrf54l.c
Comment threadhal/spi/spi_drv_nrf54l.c
Comment threadhal/nrf54l.ld
Comment threadhal/nrf54l.ld
CopilotAI review requested due to automatic review settings March 14, 2026 02:25

CopilotAI 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.

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
FileDescription
test-app/app_nrf54l.cAdds a minimal nRF54L15 smoke test app with UART + LED toggle.
test-app/MakefileSelects linker script template for the nrf54l test-app, including TZ non-secure variant.
test-app/ARM-nrf54l-ns.ldAdds a non-secure test-app linker script for TZ builds (NS RAM base).
include/spi_drv.hWires in the nrf54l SPI backend header based on target define.
hal/spi/spi_drv_nrf54l.cImplements SPIM-based SPI backend for SPI_FLASH on nrf54l.
hal/spi/spi_drv_nrf54l.hProvides default nRF54L15-DK pin mux defines for SPI backend.
hal/nrf54l.cImplements core nrf54l HAL: clocks, UART, RRAM flash operations, TrustZone init, TRNG.
hal/nrf54l.hAdds nrf54l register/memory map and helper macros for HAL and drivers.
hal/nrf54l.ldAdds secure (TZ) linker script including NSC + keyvault regions.
hal/nrf54l-ns.ldAdds non-TZ linker script variant (single-image RAM/flash layout).
docs/Targets.mdDocuments nRF54L15 target, flash layout, build/flash/update steps.
config/examples/nrf54l15.configAdds example config for nrf54l15 without TrustZone.
config/examples/nrf54l15-wolfcrypt-tz.configAdds example TrustZone + wolfCrypt/keyvault/NSC config for nrf54l15.
arch.mkSelects appropriate linker script input for nrf54l non-TZ builds.
CMakeLists.txtRegisters nrf54l in ARM targets list.
.github/workflows/test-configs.ymlAdds CI build jobs for the two new nrf54l15 example configs.

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

Comment threadtest-app/Makefile
Comment threadhal/spi/spi_drv_nrf54l.c
Comment threadhal/spi/spi_drv_nrf54l.c
Comment threadhal/nrf54l.ld
Comment threadhal/spi/spi_drv_nrf54l.c
Comment threadhal/spi/spi_drv_nrf54l.c
Comment threadhal/spi/spi_drv_nrf54l.c
Comment threadtest-app/app_nrf54l.c Outdated
CopilotAI review requested due to automatic review settings March 16, 2026 19:59

CopilotAI 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.

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
FileDescription
test-app/app_nrf54l.cAdds a basic smoke test app for nRF54L (UART + LED toggle).
test-app/MakefileSelects the correct test-app linker script for nrf54l (+ TrustZone NS variant).
test-app/ARM-nrf54l-ns.ldAdds non-secure test-app linker script for TZ builds.
include/spi_drv.hHooks nRF54L SPI driver into the generic SPI driver selection.
hal/spi/spi_drv_nrf54l.hDefines default pin muxing for SPI on nRF54L15-DK.
hal/spi/spi_drv_nrf54l.cImplements SPIM-based SPI FLASH backend for nRF54L.
hal/nrf54l.ldAdds secure wolfBoot linker script with keyvault + NSC regions.
hal/nrf54l.hAdds nRF54L register definitions and HAL interface.
hal/nrf54l.cImplements nRF54L HAL (RRAM, UART, clocks, TrustZone, TRNG).
hal/nrf54l-ns.ldAdds non-TZ wolfBoot linker script for nRF54L.
docs/Targets.mdDocuments nRF54L15 target, build steps, layouts, and update testing.
config/examples/nrf54l15.configAdds non-TrustZone example config for nRF54L15.
config/examples/nrf54l15-wolfcrypt-tz.configAdds TrustZone + wolfCrypt + keyvault example config.
arch.mkSelects alternate linker script for nRF54L when TZ is disabled.
CMakeLists.txtRegisters nrf54l as an ARM target.
.github/workflows/test-configs.ymlAdds CI build coverage for both new nRF54L example configs.

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

Comment threadhal/spi/spi_drv_nrf54l.c
Comment threadhal/spi/spi_drv_nrf54l.c
Comment threadtest-app/ARM-nrf54l-ns.ld
Comment threadhal/nrf54l.ld
Comment threadhal/nrf54l-ns.ld
Comment threadhal/nrf54l.ld
Comment threadtest-app/app_nrf54l.c Outdated
Comment threadhal/nrf54l.c
@mattia-moffa

mattia-moffa commented Mar 16, 2026

Copy link
Copy Markdown
MemberAuthor

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 threadtest-app/app_nrf54l.c
Comment threadhal/spi/spi_drv_nrf54l.c Outdated
CopilotAI review requested due to automatic review settings March 17, 2026 12:51

CopilotAI 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.

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
FileDescription
test-app/app_nrf54l.cNew nRF54L test app (UART print + LED toggle).
test-app/MakefileSelects nRF54L non-secure test-app linker script when TZEN=1; minor formatting.
test-app/ARM-nrf54l-ns.ldNew non-secure test-app linker script for TZ builds (NS RAM region).
include/spi_drv.hAdds nRF54L SPI driver header selection.
hal/spi/spi_drv_nrf54l.hNew nRF54L SPI pin defaults/macros.
hal/spi/spi_drv_nrf54l.cNew nRF54L SPIM EasyDMA-based SPI backend implementation.
hal/nrf54l.ldNew secure/TZ bootloader linker script (secure RAM + heap + NSC region).
hal/nrf54l-ns.ldNew non-TZ bootloader linker script for nRF54L.
hal/nrf54l.hNew nRF54L register definitions/macros (GPIO/UART/SPIM/SPU/MPC/TRNG, etc.).
hal/nrf54l.cNew nRF54L HAL implementation (UART, clocks, RRAM flash, TrustZone setup, TRNG).
docs/Targets.mdDocuments nRF54L15 target, memory maps, build/flash/update instructions.
config/examples/nrf54l15.configExample config for non-TZ nRF54L15.
config/examples/nrf54l15-wolfcrypt-tz.configExample config for TZ + wolfCrypt/NSC/keyvault variant.
arch.mkSelects nRF54L non-TZ linker script when TZEN != 1.
CMakeLists.txtAdds nrf54l to ARM targets list.
.github/workflows/test-configs.ymlAdds 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 threadhal/nrf54l.c Outdated
Comment threadhal/spi/spi_drv_nrf54l.h
@danielinux
danielinux merged commit f123c4f into wolfSSL:masterMar 18, 2026
366 checks passed
Sign up for freeto 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

@mattia-moffa@danielinux@dgarske@wolfSSL-Bot