Skip to content

Add the NXP FDRM-MCXN947 port - #79

Draft
aidangarske wants to merge 45 commits into
wolfSSL:mainfrom
aidangarske:mcxn947-port
Draft

aidangarske wants to merge 45 commits into
wolfSSL:mainfrom
aidangarske:mcxn947-port

Conversation

@aidangarske

Copy link
Copy Markdown
Member
  • Adds new port parity for NXP FRDM-MCXN947
  • Adds port/mcxn947 for the FRDM-MCXN947, with TrustZone on CPU0 and wolfBoot booting wolfTrust as the Secure app.
  • Isolates guests with the SAU per dispatch window, and keeps the ELS crypto engine reserved to the SPM.
  • Supports the native wolfCrypt and the wolfHSM ELS crypto engines.
  • Gets random numbers from the ELS RND with a static DMA page and a failure latch, covered by host tests in tests/host/mcxn947_rng.
  • Stages firmware updates in bank 1 through the ROM flash API, reserving both write-once trailer sectors and accepting a padded final phrase.
  • Adds provisioning_ctrl_mcxn947.sh for status, discover, advance, regress and verify-pages; the lock step stays hard-wired to refuse.
  • Runs all 49 MCXN947 m33mu scenarios on both crypto engines in CI, including the Arm FF-M IPC conformance suite (85 passed, 4 skipped).
  • Carries an m33mu patch that adds post-indexed LDRSH decoding and fixes to the MCXN947 model.
  • The FRDM-MCXN947 board suite (positive, sauneg, periphneg, restart, psa, wrpoff) checks each negative test's fault address and passes 6/6 on both engines.
  • Testing: fork CI M33MU 181/181, make test 1028 passed, make test-provisioning 139/139, run_mcxn947_suite.sh 6/6 on both engines.
  • The MCXN947 has no reset-locked flash write protection, so the guest flash fence is documented as an open item in docs/MCXN947-Guide.md.

@aidangarske aidangarske self-assigned this Nov 6, 2026
Copilot AI balanced review requested due to automatic review settings November 6, 2026 02:25
@aidangarske aidangarske added ci:mcxn947 Run the MCXN947 full M33MU matrix on the PR (port-only change) ci:all Run every M33MU scenario of every port on the PR (core change) labels Nov 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved pyOCD executable inconsistency, an out-of-window NSPE test buffer, and an incorrect FWU payload length can cause hardware-suite failures or misleading test results.

3 open issues
What changed in this PR

Adds NXP FRDM-MCXN947 as wolfTrust’s third Armv8-M port, reusing the shared TrustZone runtime with board-specific isolation, entropy, flash storage, and validation support.

Changes:

  • Adds MCXN947 memory layouts, partition manifests, SAU guest isolation, ELS entropy, and ROM flash access.
  • Integrates host tests, guest firmware, hardware checks, provisioning tests, and CI coverage.
  • Documents port setup, testing, lifecycle handling, and protection limitations.
File Description
tools/​ci-static-analysis-build.sh Includes MCXN947 in static-analysis builds.
tests/​target/​wolfboot-mcxn947-lifecycle.patch Derives attestation lifecycle from device state.
tests/​target/​test_mcxn947_suite_evidence.sh Checks evidence retention and runner failure handling.
tests/​target/​run_suite.sh Routes MCXN947 emulator scenarios.
tests/​target/​run_mcxn947_suite.sh Runs serialized hardware scenario batches.
tests/​target/​provisioning/​test_provisioning_gates.sh Tests MCXN947 provisioning safeguards with stubs.
tests/​target/​lib/​scenario_matrix.py Defines MCXN947 scenarios and CI routing.
tests/​target/​lib/​mcxn947_wolfboot.sh Builds and caches the pinned wolfBoot stage.
tests/​target/​detect_mcxn947.sh Detects board and tooling prerequisites.
tests/​host/​mcxn947_rng/​mock_els.h Redirects ELS register access to mocks.
tests/​host/​mcxn947_rng/​Makefile Builds entropy-driver host tests.
tests/​host/​mcxn947_rng/​main.c Tests entropy requests, failures, and DMA storage.
tests/​host/​mcxn947_lifecycle/​Makefile Builds tests from the carried lifecycle header.
tests/​host/​mcxn947_lifecycle/​main.c Tests lifecycle and debug-state mappings.
tests/​host/​mcxn947_flash/​mock_rom_api.h Supplies mock ROM and flash addresses.
tests/​host/​mcxn947_flash/​Makefile Builds flash tests with alternate write units.
tests/​host/​Makefile Registers MCXN947 host suites.
tests/​firmware/​psa-guest/​Makefile Adds configurable firmware-update tail size.
tests/​firmware/​psa-guest/​main.c Uses the configured final-write size.
tests/​firmware/​psa-guest/​boards/​mcxn947/​board.mk Defines PSA guest memory windows.
tests/​firmware/​psa-guest/​boards/​mcxn947/​board.h Adds MCXN947 guest UART support.
tests/​firmware/​mcxn947-baremetal/​Makefile Builds both bare-metal guest images.
tests/​firmware/​mcxn947-baremetal/​guest0.ld Places guest vectors, code, and RAM sections.
tests/​firmware/​mcxn947-baremetal/​guest0.c Exercises PSA connections and isolation probes.
README.md Lists the port and validation commands.
port/​mcxn947/​secure.ld Defines secure-image and partition section placement.
port/​mcxn947/​secure_owners.txt Assigns port objects to the SPM.
port/​mcxn947/​rom_flash.h Declares the ROM flash interface.
port/​mcxn947/​rom_flash.c Implements flash initialization, programming, and erase.
port/​mcxn947/​rng_entropy.c Implements ELS entropy with a failure latch.
port/​mcxn947/​platform_mcxn947.c Configures protection, guest windows, and platform hooks.
port/​mcxn947/​partitions.c Binds guest configuration, measurements, and runtime state.
port/​mcxn947/​memory_map.h Defines flash, RAM, and isolation layouts.
port/​mcxn947/​mcxn947_regs.h Defines peripheral and ROM register addresses.
port/​mcxn947/​manifest.json Declares production domains and services.
port/​mcxn947/​manifest-conformance.json Adds conformance partitions and interrupt resources.
port/​mcxn947/​l3_port.h Supplies the shared isolation layer’s peripheral input.
port/​mcxn947/​hsm_flash.h Declares flash context and integration interfaces.
port/​mcxn947/​hsm_flash_ctx.c Holds vault-owned flash state and diagnostics.
port/​mcxn947/​conformance/​pal_driver_intf.c Implements conformance storage and interrupt hooks.
port/​mcxn947/​conformance/​pal_crypto_config.h Selects supported crypto test algorithms.
port/​mcxn947/​conformance/​pal_config.h Defines conformance resources and API configuration.
port/​mcxn947/​conformance/​pal_attestation_config.h Configures attestation verification support.
port/​mcxn947/​conformance/​conf_nvm.h Declares privileged storage and interrupt interfaces.
port/​mcxn947/​conformance/​conf_nvm_sync.c Routes conformance operations through SVC calls.
mk/​target-mcxn947.mk Defines MCXN947 build inputs and defaults.
mk/​arch-armv8m.mk Includes port-specific ownership maps in layout checks.
Makefile Adds MCXN947 validation entry points.
docs/​Testing.md Documents emulator, hardware, and CI coverage.
docs/​Provisioning.md Documents MCXN947 lifecycle and provisioning limits.
docs/​Porting.md Adds the port and local ownership-map guidance.
docs/​Home.md Links the MCXN947 guide.
docs/​_Sidebar.md Adds guide navigation.
.gitignore Excludes generated bare-metal guest builds.
.github/​workflows/​README.md Documents MCXN947 CI coverage and selection.
.github/​workflows/​m33mu.yml Adds MCXN947 selection and SDK staging.
.github/​workflows/​cross-compile.yml Builds both engines and checks vector placement.

Review effort: Balanced

Comment thread port/mcxn947/conformance/pal_config.h Resolved
Comment thread tests/firmware/psa-guest/main.c Resolved
Comment thread tests/target/detect_mcxn947.sh Resolved
@aidangarske

Copy link
Copy Markdown
Member Author

@claude review

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #79

Scan targets checked: wolftrust-src, wolftrust-bugs
Not reviewed (no scan target covers them): .github/workflows/README.md, .github/workflows/cross-compile.yml, .github/workflows/m33mu.yml, .gitignore, Makefile, README.md, docs/Home.md, docs/MCXN947-Guide.md, docs/Porting.md, docs/Provisioning.md, docs/Testing.md, docs/_Sidebar.md, mk/arch-armv8m.mk, mk/target-mcxn947.mk, port/mcxn947/secure_owners.txt, tests/firmware/mcxn947-baremetal/Makefile, tests/firmware/mcxn947-baremetal/guest0.ld, tests/firmware/psa-guest/Makefile, tests/firmware/psa-guest/boards/mcxn947/board.h, tests/firmware/psa-guest/boards/mcxn947/board.mk and 19 more
Coverage: 16 of 25 in-scope changed file(s) opened by the reviewer; not opened: port/mcxn947/hsm_flash.h, port/mcxn947/hsm_flash_ctx.c, port/mcxn947/l3_port.h, port/mcxn947/manifest-conformance.json, port/mcxn947/manifest.json, port/mcxn947/rom_flash.h, tests/firmware/mcxn947-baremetal/guest0.c, tests/host/mcxn947_flash/main.c, tests/host/mcxn947_lifecycle/main.c

Fenrir result: Approved ✅

No new issues found in the changed files.

Advisory only — this automated result does not count as a GitHub approval.

Review tier: Max

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

Labels

ci:all Run every M33MU scenario of every port on the PR (core change) ci:mcxn947 Run the MCXN947 full M33MU matrix on the PR (port-only change)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants