Add wolfBoot support for NXP LPC54S018M-EVK#752
Open
dgarske wants to merge 8 commits intowolfSSL:masterfrom
Open
Add wolfBoot support for NXP LPC54S018M-EVK#752dgarske wants to merge 8 commits intowolfSSL:masterfrom
dgarske wants to merge 8 commits intowolfSSL:masterfrom
Conversation
The LPC54S018M HAL had three critical SPIFI controller issues preventing
flash write/erase operations from working, which blocked wolfBoot_success(),
wolfBoot_update_trigger(), and the firmware swap:
1. Wrong memory-mode read command: Used opcode 0x6B (Quad Output, serial
address) but the boot ROM configures 0xEB (Quad I/O, quad address) with
MCMD=0xEB930000. The mismatch caused garbled address bits when re-entering
XIP after flash operations, crashing on instruction fetch.
2. SPIFI POLL mode not waiting: The boot ROM leaves CLIMIT[7:0]=0x00 which
makes the hardware POLL comparison always succeed immediately. Set
IDATA=0x00 and CLIMIT[7:0]=0x01 to properly wait for flash BUSY to clear.
3. SPIFI reset clears CTRL/CLIMIT: The reset used to exit memory mode clears
the boot ROM's timing config (CTRL=0x600F03E8) and cache limit
(CLIMIT=0x08000000). Save and restore both registers around every reset.
Additional changes:
- Add RAMFUNCTION memcpy (src/string.o) to test app for SPIFI XIP safety
- Add bare-metal UART driver for Flexcomm0 (non-blocking, skips if FC0
doesn't respond — observed on some LPC54S018M-EVK boards)
- Add DSB+ISB barriers after entering memory mode for pipeline coherency
- Enable DEBUG_UART in example config
- Update test app to follow LPC55S69 port patterns with LED indicators
for boot version and update status
Tested: cold boot, ECC256 signature verify, wolfBoot_success(),
wolfBoot_update_trigger(), and full v1->v2 firmware swap all working.
Swap takes ~60 seconds for the 960KB partition (240 sector operations).
- HAL: Remove debug spifi_test_mode_switch(), use wolfBoot_printf
instead of raw uart_write, add printf.h include
- Test app: Use check_parts() (was defined but unused), replace
custom print_str/print_hex32 with wolfBoot_printf, fix LED logic
to show LED1 for v1 and LED2 for v2+ (was always LED1)
- Docs: Remove incorrect MCUXpresso SDK section (port is bare-metal),
fix typo, add swap timing note, add flash script references
- Build: Add --no-warn-rwx-segments to arch.mk, improve Makefile
comments
- Add tools/scripts/nxp-lpc54s018m-flash.sh following the
nxp-s32k142-flash.sh pattern (build, sign, flash via pyocd)
Tested: full boot + firmware update cycle (v1 -> v2 swap) verified
on LPC54S018M-EVK hardware.
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds wolfBoot bring-up for the NXP LPC54S018M-EVK (LPC540xx/LPC54S0xx SPIFI-boot family), including a bare-metal HAL, build/link integration, and tooling/docs to build/sign/flash and exercise A/B updates.
Changes:
- Add bare-metal SPIFI (QSPI XIP) HAL + linker scripts for
TARGET=nxp_lpc54s0xx. - Add LPC54S0xx test application + Makefile integration and example
.config. - Add documentation, a pyocd-based flashing helper script, and CI build coverage for the new config.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/scripts/nxp-lpc54s0xx-flash.sh | New end-to-end build/sign/flash helper for LPC54S018M-EVK via pyocd |
| test-app/app_nxp_lpc54s0xx.c | New LPC54S0xx test app demonstrating confirm + update trigger with LEDs |
| test-app/Makefile | Add nxp_lpc54s0xx target wiring and syscall/string objects |
| test-app/ARM-nxp_lpc54s0xx.ld | New test-app linker script template for SPIFI-boot layout |
| hal/nxp_lpc54s0xx.ld | New wolfBoot linker script template for SPIFI-boot external flash |
| hal/nxp_lpc54s0xx.c | New bare-metal HAL for SPIFI flash ops + optional UART debug |
| docs/Targets.md | Document LPC540xx/LPC54S0xx SPIFI-boot support and workflow |
| config/examples/nxp_lpc54s0xx.config | New reference configuration for LPC54S018M-EVK |
| arch.mk | Add nxp_lpc54s0xx target flags (flash offset, linker flags) |
| Makefile | Post-process wolfboot.bin to add enhanced boot block + vector checksum |
| .github/workflows/test-configs.yml | Add CI build job for the new example config |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.