Repository navigation
Add NXP FRDM-RW612 port and test NXP HALs against the real MCUXpresso SDK - #926
Conversation
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #926
Scan targets checked: wolfboot-src, wolfboot-bugs
Coverage: 1 of 5 in-scope changed file(s) opened by the reviewer; not opened: src/boot_arm.c, test-app/app_rw612.c, tools/unit-tests/unit-rw612-flash.c, tools/unit-tests/unit-rw612-tz.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: Lite
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The SAU currently exposes address ranges beyond the documented FLEXCOMM0–3 peripherals.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Adds FRDM-RW612 support, including FlexSPI flash operations, TrustZone isolation, secure wolfCrypt services, test applications, CI, documentation, and unit tests.
Changes:
- Adds RW612 HAL, linker layouts, boot metadata, and target configurations.
- Adds secure/non-secure test applications and TrustZone/TRNG/flash unit tests.
- Adds RW612 CI builds and user documentation.
| File | Description |
|---|---|
.github/workflows/test-build-rw612.yml |
Builds four RW612 configurations. |
.gitignore |
Ignores new unit-test binaries. |
arch.mk |
Adds RW612 SDK and architecture settings. |
config/examples/rw612.config |
Defines the standard RW612 configuration. |
config/examples/rw612-tz.config |
Defines the TrustZone configuration. |
config/examples/rw612-wolfcrypt-tz.config |
Enables secure wolfCrypt/PKCS11. |
docs/Targets.md |
Documents setup, layout, flashing, and updates. |
hal/rw612-ns.ld |
Defines the non-TrustZone bootloader layout. |
hal/rw612.c |
Implements flash, UART, SAU, and TRNG support. |
hal/rw612.ld |
Defines the secure bootloader layout. |
src/boot_arm.c |
Adds RW612 ROM image vector metadata. |
test-app/ARM-rw612-ns.ld |
Defines non-secure application memory. |
test-app/ARM-rw612.ld |
Defines standard application memory. |
test-app/Makefile |
Integrates RW612 application builds. |
test-app/app_rw612.c |
Adds the RW612 demonstration application. |
tools/unit-tests/Makefile |
Registers RW612 unit tests. |
tools/unit-tests/rw612_fsl_stub/fsl_clock.h |
Stubs the clock header. |
tools/unit-tests/rw612_fsl_stub/fsl_common.h |
Provides common register mocks. |
tools/unit-tests/rw612_fsl_stub/fsl_romapi_flexspi.h |
Mocks the ROM FlexSPI API. |
tools/unit-tests/rw612_fsl_stub/fsl_trng.h |
Mocks the TRNG API. |
tools/unit-tests/rw612_fsl_stub/target.h |
Defines the test memory layout. |
tools/unit-tests/unit-rw612-flash.c |
Tests flash operations and failure paths. |
tools/unit-tests/unit-rw612-tz.c |
Tests SAU attribution, IRQs, and TRNG. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #926
Scan targets checked: wolfboot-src, wolfboot-bugs
Coverage: 3 of 6 in-scope changed file(s) opened by the reviewer; not opened: test-app/app_rw612.c, tools/unit-tests/unit-rw612-flash.c, tools/unit-tests/unit-rw612-tz.c
Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Reported findings require changes before merge.
Review tier: Lite
|
Tested this on an FRDM-RW612 here (A1 silicon, I could not exercise the pyOCD path, since pyOCD will not drive the MCU-Link once it carries J-Link firmware, so that half of the flashing docs is still unverified by me. One docs suggestion, patch below. The J-Link fallback line is accurate but omits two things that make a scripted flash silently do nothing: diff --git a/docs/Targets.md b/docs/Targets.md
index 974134ab..7a12ce72 100644
--- a/docs/Targets.md
+++ b/docs/Targets.md
@@ -7289,6 +7289,11 @@ west update_board --set board frdmrw612
deactivate
```
+`update_board` fetches the whole `frdmrw612.yml` repo list. The only project
+this target needs is `mcux-devices-wireless`, which provides
+`devices/Wireless/RW/RW612`, so `west update mcux-devices-wireless` is enough
+in an existing workspace.
+
### RW612: Configuring and compiling
```sh
@@ -7343,8 +7348,35 @@ pyocd flash -t rw612eta2i -a 0x08000000 -e sector wolfboot.bin
pyocd flash -t rw612eta2i -a 0x08100000 -e sector test-app/image_v1_signed.bin
```
-If the MCU-Link has been updated to J-Link firmware, `JLinkExe -device RW612
--if SWD` with `loadbin <file> <address>` works at the same addresses.
+`factory.bin` covers both writes in one: `bin-assemble` lays it out relative to
+its lowest address, so `-a 0x08000000` programs wolfBoot and the signed v1
+application together.
+
+If the MCU-Link has been updated to J-Link firmware, `loadbin <file> <address>`
+works at the same addresses:
+
+```sh
+JLinkExe -device RW612 -if SWD -speed 4000 -NoGui 1 -CommanderScript flash.jlink
+```
+
+```
+exec EnableEraseAllFlashBanks
+connect
+h
+erase 0x08200000 0x08420FFF
+loadbin factory.bin 0x08000000
+r
+g
+qc
+```
+
+`connect` has to be the first command in the script. Any other command ahead of
+it triggers an implicit connect, after which J-Link Commander reports `Script
+processing completed.` and discards the remaining lines, so `loadbin` never
+runs. `exec EnableEraseAllFlashBanks` is needed for an explicit `erase` range,
+because the FlexSPI NOR is not an internal bank; without it J-Link reports `No
+Flash bank within given address range` and erases nothing. `loadbin` erases the
+sectors it writes on its own.
The debug console is FLEXCOMM3 on the MCU-Link virtual COM port at 115200
baud. After reset: |

RW612 port
make WOLFCRYPT_TZ=1 WOLFCRYPT_TZ_PKCS11=1on rw612-tz.FlexSPI XIP cache the boot ROM leaves off.
side.
NXP unit tests on the real SDK (all NXP ports)
of hand-written fsl_*.h stubs. Only the Arm CMSIS core is mocked, in tools/unit-tests/cmsis_stub/core_cm33.h, which any Cortex-M33
vendor SDK can reuse.
west checkout). test-units.yml runs it and passes MCUXSDK to the unit tests; without MCUXSDK the NXP tests are skipped with a
message.
a new NXP chip needs only its SDK paths and a test, with no stub files.
removed, and the test also runs on non-x86 hosts.
Testing
self-update, and boot with ECC256, ECC384, RSA-4096 and ML-DSA-44/65/87.