@@ -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 )
@@ -4259,6 +4260,155 @@ WOLFBOOT_PARTITION_SWAP_ADDRESS?=0xff000
42594260```
42604261
42614262
4263+ ## NXP Kinetis KL26Z
4264+
4265+ NXP MKL26Z128 is a Cortex-M0+ microcontroller running at 48MHz with 128 KB
4266+ flash and 16 KB SRAM. The support has been tested using the FRDM-KL26Z board
4267+ with the onboard OpenSDA debugger reflashed to Segger J-Link firmware.
4268+
4269+ The TARGET is ` kinetis_kl26 ` , separate from the ` kinetis ` target used for
4270+ K64/K82 because the KL26 silicon ships a different flash driver family
4271+ (legacy ` fsl_flash.c ` , no FTFx cache, no SYSMPU) and a different memory map.
4272+
4273+ Two example configurations are provided:
4274+
4275+ - ` config/examples/kinetis-kl26.config ` &mdash ; ** ECC256** with SHA-256.
4276+ - ` config/examples/kinetis-kl26-lms.config ` &mdash ; ** LMS** post-quantum
4277+ signatures (parameters L=1, H=20, W=8, SHA-256).
4278+
4279+ Both produce a working bootloader for the FRDM-KL26Z; pick the one matching
4280+ your signature scheme. The two configs use different partition layouts (the
4281+ LMS variant trades a larger bootloader region and partition header for the
4282+ bigger PQ signature), so the addresses in the steps below differ between
4283+ them.
4284+
4285+ This requires the legacy NXP MCUXpresso SDK 2.2 for FRDM-KL26Z, generated and
4286+ downloaded from the [ MCUXpresso SDK Builder] ( https://mcuxpresso.nxp.com/ )
4287+ (select the board, then build and download the SDK package). The extracted
4288+ archive should be placed into ` ../NXP/SDK_2_2_0_FRDM-KL26Z ` by default (see
4289+ .config or set with ` MCUXPRESSO ` ).
4290+
4291+ ### KL26Z: Configuring and compiling
4292+
4293+ Copy one of the example configuration files and build with make:
4294+
4295+ ``` sh
4296+ # ECC256 variant
4297+ cp config/examples/kinetis-kl26.config .config
4298+
4299+ # LMS variant
4300+ cp config/examples/kinetis-kl26-lms.config .config
4301+
4302+ make
4303+ ```
4304+
4305+ ### KL26Z: Loading the firmware
4306+
4307+ The FRDM-KL26Z board ships with the PEMicro OpenSDA firmware on the K20 debug
4308+ chip. Reflash it once with Segger's board-specific J-Link OpenSDA build:
4309+
4310+ - Download the firmware from
4311+ [ Segger's J-Link OpenSDA Board-Specific Firmwares page] ( https://www.segger.com/downloads/jlink/#JLinkOpenSDABoardSpecificFirmwares ) .
4312+ - Hold the reset button while plugging in USB so the OpenSDA chip enters its
4313+ bootloader mode (the volume should mount as ` BOOTLOADER ` ).
4314+ - Drop the downloaded firmware file onto the ` BOOTLOADER ` volume.
4315+ - Replug; the device now enumerates as a Segger J-Link.
4316+
4317+ Use JLinkExe to upload the initial firmware:
4318+ ` JLinkExe -if swd -Device MKL26Z128xxx4 `
4319+
4320+ At the J-Link prompt, type:
4321+
4322+ ```
4323+ unlock kinetis
4324+ loadbin factory.bin 0
4325+ r
4326+ g
4327+ ```
4328+
4329+ The ` unlock kinetis ` step is required after any chip-erase: a blank Kinetis
4330+ flash configuration field reads ` 0xFF ` at offset ` 0x40C ` , which secures the
4331+ chip on next reset and locks out SWD. ` unlock kinetis ` issues a mass-erase
4332+ through the MDM-AP backdoor that bypasses the secured state.
4333+
4334+ Reset or power cycle the board.
4335+
4336+ Once wolfBoot has performed validation of the partition and booted the v1
4337+ test app, the onboard RGB LED will light up blue.
4338+
4339+ ### KL26Z: Testing firmware update
4340+
4341+ 1 ) Sign the test-app as v2 passing appropriate parameters:
4342+
4343+ For the ECC256 variant:
4344+
4345+ ``` sh
4346+ tools/keytools/sign --ecc256 --sha256 \
4347+ test-app/image.bin wolfboot_signing_private_key.der 2
4348+ ```
4349+
4350+ For the LMS variant:
4351+
4352+ ``` sh
4353+ IMAGE_HEADER_SIZE=4096 \
4354+ LMS_LEVELS=1 LMS_HEIGHT=20 LMS_WINTERNITZ=8 \
4355+ IMAGE_SIGNATURE_SIZE=1776 \
4356+ tools/keytools/sign --lms --sha256 \
4357+ test-app/image.bin wolfboot_signing_private_key.der 2
4358+ ```
4359+
4360+ Either command produces ` test-app/image_v2_signed.bin ` .
4361+
4362+ 2 ) Create a bin footer with the wolfBoot trailer "pBOOT" to manually trigger
4363+ an update:
4364+
4365+ ``` sh
4366+ echo -n " pBOOT" > trigger_magic.bin
4367+ ```
4368+
4369+ 3 ) Assemble the update partition image. The trigger offset is
4370+ ` WOLFBOOT_PARTITION_SIZE - 5 ` .
4371+
4372+ For the ECC256 variant (partition size ` 0xC000 ` ):
4373+
4374+ ``` sh
4375+ ./tools/bin-assemble/bin-assemble \
4376+ update.bin \
4377+ 0x0 test-app/image_v2_signed.bin \
4378+ 0xBFFB trigger_magic.bin
4379+ ```
4380+
4381+ For the LMS variant (partition size ` 0xB000 ` ):
4382+
4383+ ``` sh
4384+ ./tools/bin-assemble/bin-assemble \
4385+ update.bin \
4386+ 0x0 test-app/image_v2_signed.bin \
4387+ 0xAFFB trigger_magic.bin
4388+ ```
4389+
4390+ 4 ) Flash ` update.bin ` to the update partition base address and reset. On the
4391+ next boot wolfBoot will perform the update and launch version 2. The test app
4392+ will then light up the onboard LED green instead of blue.
4393+
4394+ - ECC256 variant: ` loadbin update.bin 0x12000 `
4395+ - LMS variant: ` loadbin update.bin 0x13000 `
4396+
4397+ ### KL26Z: Debugging
4398+
4399+ To debug with JLink:
4400+
4401+ In one terminal: ` JLinkGDBServer -if swd -Device MKL26Z128xxx4 -port 3333 `
4402+
4403+ In another terminal use ` gdb ` :
4404+
4405+ ```
4406+ b main
4407+ mon reset
4408+ c
4409+ ```
4410+
4411+
42624412## NXP QorIQ P1021 PPC
42634413
42644414The NXP QorIQ P1021 is a PPC e500v2 based processor (two cores). This has been tested with a NAND boot source.
0 commit comments