@@ -20,6 +20,7 @@ This README describes configuration of supported targets.
2020* [ Nordic nRF54L15] ( #nordic-nrf54l15 )
2121* [ NXP iMX-RT] ( #nxp-imx-rt )
2222* [ NXP Kinetis] ( #nxp-kinetis )
23+ * [ NXP Kinetis KL26Z] ( #nxp-kinetis-kl26z )
2324* [ NXP LPC546xx] ( #nxp-lpc546xx )
2425* [ NXP LPC540xx / LPC54S0xx (SPIFI boot)] ( #nxp-lpc540xx--lpc54s0xx-spifi-boot )
2526* [ NXP LPC55S69] ( #nxp-lpc55s69 )
@@ -4623,6 +4624,155 @@ WOLFBOOT_PARTITION_SWAP_ADDRESS?=0xff000
46234624```
46244625
46254626
4627+ ## NXP Kinetis KL26Z
4628+
4629+ NXP MKL26Z128 is a Cortex-M0+ microcontroller running at 48MHz with 128 KB
4630+ flash and 16 KB SRAM. The support has been tested using the FRDM-KL26Z board
4631+ with the onboard OpenSDA debugger reflashed to Segger J-Link firmware.
4632+
4633+ The TARGET is `kinetis_kl26`, separate from the `kinetis` target used for
4634+ K64/K82 because the KL26 silicon ships a different flash driver family
4635+ (legacy `fsl_flash.c`, no FTFx cache, no SYSMPU) and a different memory map.
4636+
4637+ Two example configurations are provided:
4638+
4639+ - `config/examples/kinetis-kl26.config` — **ECC256** with SHA-256.
4640+ - `config/examples/kinetis-kl26-lms.config` — **LMS** post-quantum
4641+ signatures (parameters L=1, H=20, W=8, SHA-256).
4642+
4643+ Both produce a working bootloader for the FRDM-KL26Z; pick the one matching
4644+ your signature scheme. The two configs use different partition layouts (the
4645+ LMS variant trades a larger bootloader region and partition header for the
4646+ bigger PQ signature), so the addresses in the steps below differ between
4647+ them.
4648+
4649+ This requires the legacy NXP MCUXpresso SDK 2.2 for FRDM-KL26Z, generated and
4650+ downloaded from the [MCUXpresso SDK Builder](https://mcuxpresso.nxp.com/)
4651+ (select the board, then build and download the SDK package). The extracted
4652+ archive should be placed into `../NXP/SDK_2_2_0_FRDM-KL26Z` by default (see
4653+ .config or set with `MCUXPRESSO`).
4654+
4655+ ### KL26Z: Configuring and compiling
4656+
4657+ Copy one of the example configuration files and build with make:
4658+
4659+ ```sh
4660+ # ECC256 variant
4661+ cp config/examples/kinetis-kl26.config .config
4662+
4663+ # LMS variant
4664+ cp config/examples/kinetis-kl26-lms.config .config
4665+
4666+ make
4667+ ```
4668+
4669+ ### KL26Z: Loading the firmware
4670+
4671+ The FRDM-KL26Z board ships with the PEMicro OpenSDA firmware on the K20 debug
4672+ chip. Reflash it once with Segger' s board-specific J-Link OpenSDA build:
4673+
4674+ - Download the firmware from
4675+ [Segger' s J-Link OpenSDA Board-Specific Firmwares page](https://www.segger.com/downloads/jlink/#JLinkOpenSDABoardSpecificFirmwares).
4676+ - Hold the reset button while plugging in USB so the OpenSDA chip enters its
4677+ bootloader mode (the volume should mount as `BOOTLOADER`).
4678+ - Drop the downloaded firmware file onto the `BOOTLOADER` volume.
4679+ - Replug; the device now enumerates as a Segger J-Link.
4680+
4681+ Use JLinkExe to upload the initial firmware:
4682+ `JLinkExe -if swd -Device MKL26Z128xxx4`
4683+
4684+ At the J-Link prompt, type:
4685+
4686+ ```
4687+ unlock kinetis
4688+ loadbin factory.bin 0
4689+ r
4690+ g
4691+ ```
4692+
4693+ The `unlock kinetis` step is required after any chip-erase: a blank Kinetis
4694+ flash configuration field reads `0xFF` at offset `0x40C`, which secures the
4695+ chip on next reset and locks out SWD. `unlock kinetis` issues a mass-erase
4696+ through the MDM-AP backdoor that bypasses the secured state.
4697+
4698+ Reset or power cycle the board.
4699+
4700+ Once wolfBoot has performed validation of the partition and booted the v1
4701+ test app, the onboard RGB LED will light up blue.
4702+
4703+ ### KL26Z: Testing firmware update
4704+
4705+ 1) Sign the test-app as v2 passing appropriate parameters:
4706+
4707+ For the ECC256 variant:
4708+
4709+ ```sh
4710+ tools/keytools/sign --ecc256 --sha256 \
4711+ test-app/image.bin wolfboot_signing_private_key.der 2
4712+ ```
4713+
4714+ For the LMS variant:
4715+
4716+ ```sh
4717+ IMAGE_HEADER_SIZE=4096 \
4718+ LMS_LEVELS=1 LMS_HEIGHT=20 LMS_WINTERNITZ=8 \
4719+ IMAGE_SIGNATURE_SIZE=1776 \
4720+ tools/keytools/sign --lms --sha256 \
4721+ test-app/image.bin wolfboot_signing_private_key.der 2
4722+ ```
4723+
4724+ Either command produces `test-app/image_v2_signed.bin`.
4725+
4726+ 2) Create a bin footer with the wolfBoot trailer "pBOOT" to manually trigger
4727+ an update:
4728+
4729+ ```sh
4730+ echo -n "pBOOT" > trigger_magic.bin
4731+ ```
4732+
4733+ 3) Assemble the update partition image. The trigger offset is
4734+ `WOLFBOOT_PARTITION_SIZE - 5`.
4735+
4736+ For the ECC256 variant (partition size `0xC000`):
4737+
4738+ ```sh
4739+ ./tools/bin-assemble/bin-assemble \
4740+ update.bin \
4741+ 0x0 test-app/image_v2_signed.bin \
4742+ 0xBFFB trigger_magic.bin
4743+ ```
4744+
4745+ For the LMS variant (partition size `0xB000`):
4746+
4747+ ```sh
4748+ ./tools/bin-assemble/bin-assemble \
4749+ update.bin \
4750+ 0x0 test-app/image_v2_signed.bin \
4751+ 0xAFFB trigger_magic.bin
4752+ ```
4753+
4754+ 4) Flash `update.bin` to the update partition base address and reset. On the
4755+ next boot wolfBoot will perform the update and launch version 2. The test app
4756+ will then light up the onboard LED green instead of blue.
4757+
4758+ - ECC256 variant: `loadbin update.bin 0x12000`
4759+ - LMS variant: `loadbin update.bin 0x13000`
4760+
4761+ ### KL26Z: Debugging
4762+
4763+ To debug with JLink:
4764+
4765+ In one terminal: `JLinkGDBServer -if swd -Device MKL26Z128xxx4 -port 3333`
4766+
4767+ In another terminal use `gdb`:
4768+
4769+ ```
4770+ b main
4771+ mon reset
4772+ c
4773+ ```
4774+
4775+
46264776## NXP QorIQ P1021 PPC
46274777
46284778The NXP QorIQ P1021 is a PPC e500v2 based processor (two cores). This has been tested with a NAND boot source.
0 commit comments