Add Nuvoton NuMaker M2354 Cortex-M23 target with TrustZone - #884
Conversation
There was a problem hiding this comment.
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 new Nuvoton NuMaker-M2354 (Cortex-M23 / ARMv8-M baseline) target, including a self-contained HAL plus TrustZone support and host-side unit tests for the flash ISP driver.
Changes:
- Introduces M2354 HAL (flash ISP, clocks, UART0, TrustZone attribution) and linker scripts/configs for TZ and non-TZ builds
- Updates shared ARM boot path to support ARMv8-M baseline (Cortex-M23) handoff semantics
- Adds unit tests + CI build configs + provisioning script for the TrustZone flash boundary (NSCBA)
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
tools/unit-tests/unit-flash-m2354.c |
New host unit tests for M2354 flash write/erase behavior and alias masking |
tools/unit-tests/Makefile |
Adds the new M2354 unit test target to the unit-test build |
tools/scripts/set-m2354-nscba.sh |
Provisioning helper script to program NSCBA via pyOCD |
tools/config.mk |
Adds CORTEX_M23 config knob into the shared config variable list |
test-app/app_m2354.c |
Adds a simple UART test application for update/confirm flows (TZ + non-TZ) |
test-app/Makefile |
Adds build flags/linker scripts for M2354 test app, including TZ non-secure build handling |
test-app/ARM-m2354.ld |
Linker script for secure/non-TZ M2354 test application |
test-app/ARM-m2354-ns.ld |
Linker script for non-secure (TZ) M2354 test application |
src/boot_arm.c |
Extends ARMv8-M boot procedure to include Cortex-M23 + adds M2354 IRQ vector mapping |
hal/m2354.ld |
Secure/TZ linker script for wolfBoot on M2354 (includes NSC veneers region) |
hal/m2354.h |
New M2354 register/geometry definitions (including NS alias conventions) |
hal/m2354.c |
New M2354 HAL implementation (flash ISP, clocks, UART, TrustZone setup) |
hal/m2354-ns.ld |
Non-TZ linker script variant for wolfBoot on M2354 |
docs/Targets.md |
Documents M2354 target build/flash/TZ provisioning details |
config/examples/m2354.config |
Example config for non-TZ M2354 build |
config/examples/m2354-tz.config |
Example config for TrustZone M2354 build |
arch.mk |
Adds M2354 target wiring + Cortex-M23 toolchain flags + SP math selection |
Makefile |
Adjusts main target outputs for M2354 in TZ mode (non-contiguous images) |
.github/workflows/test-configs.yml |
Adds CI build jobs for M2354 configs |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
0f11de7 to
fe44326
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #884
Scan targets checked: wolfboot-src, wolfboot-bugs
Findings: 2
2 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Reported findings require changes before merge.
fe44326 to
7190a15
Compare
7190a15 to
1ddf5a5
Compare
Summary
Adds support for the Nuvoton NuMaker-M2354 (Cortex-M23), introducing wolfBoot's first ARMv8-M baseline architecture target (
CORTEX_M23). Includes a bare-metal HAL without BSP dependencies, necessary sharedboot_arm.cfixes for ARMv8-M baseline support, updated build configs, unit tests, and emulator integration.Key Changes
hal/m2354.*,arch.mk,config/examples/m2354*): Added bare-metal driver for FMC ISP flash, clock tree, UART0 console (PA6/PA7), and SAU/SCU TrustZone setup. Includes linker scripts and build configurations for TZ/non-TZ mode.src/boot_arm.c):do_boot()logic so ARMv8-M baseline targets perform secure-to-non-secure handoff instead of falling through to ARMv6/v7.bic.w) with C masking forBLXNScompatibility.IMAGE_HEADER_SIZEto 1024 for proper VTOR alignment.sp_armthumb.o): ConfiguredCORTEX_M23to use Thumb-1 SP assembly (NO_ASM=0), dropping boot time from 2619 ms to 623 ms.set-m2354-nscba.sh), host flash unit tests, andm33muemulator backend updates.Hardware & Test Status
BLXNS, gateway veneers, swap updates, and rollback logic.TZEN=1).m33muCI emulator workflow. Host unit tests pass for FMC flash driver.Technical & Design Notes
hal_init()enabling additional banks.+0x10000000. Images are flashed separately due to non-contiguous address space underTZEN=1.hal_flash_erase()skips pre-erased pages to optimize update speed;hal_flash_write()uses 16-byte multi-word ISP programming.hal_init()verifiesSCU->FNSADDRagainst expected build bounds and panics on mismatch.Out of Scope / Deferred
WOLFCRYPT_TZ: Non-secure crypto service deferred; HAL currently omits TRNG.isr_crptalias included for future hookup).