Skip to content

Commit 5c8efd4

Browse files
boards: nxp: mr_canhubk3: add mcuboot variant and document sysbuild
Add an mcuboot board variant under the S32K344 SoC in board.yml. New target is - mr_canhubk3/s32k344/mcuboot. This enables a single sysbuild invocation to build MCUboot and the application. Also make a common dtsi for all mr_canhubk3 board variants. Extend the board documentation with an “MCUboot (sysbuild)” section that: Shows one-command sysbuild to produce both MCUboot and app Documents signing via sysbuild (SB_CONFIG_BOOT_SIGNATURE_*), and where the signed artifacts are generated. Provides simple flashing instructions and a troubleshooting note about using a 1 KiB (0x400) image header and not emitting an IVT for chain-loaded apps. Signed-off-by: Sumit Batra <sumit.batra@nxp.com>
1 parent 804610e commit 5c8efd4

File tree

8 files changed

+787
-607
lines changed

8 files changed

+787
-607
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright 2025 NXP
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
5+
if BOARD_MR_CANHUBK3_S32K344_MCUBOOT
6+
7+
choice BOOTLOADER
8+
default BOOTLOADER_MCUBOOT
9+
endchoice
10+
11+
# Use direct-XIP mode (dual-slot) on S32K3
12+
choice MCUBOOT_MODE
13+
default MCUBOOT_MODE_DIRECT_XIP
14+
endchoice
15+
16+
choice BOOT_SIGNATURE_TYPE
17+
default BOOT_SIGNATURE_TYPE_RSA
18+
endchoice
19+
20+
endif # BOARD_MR_CANHUBK3_S32K344_MCUBOOT

boards/nxp/mr_canhubk3/board.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ board:
44
vendor: nxp
55
socs:
66
- name: s32k344
7+
variants:
8+
- name: mcuboot

boards/nxp/mr_canhubk3/doc/index.rst

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,37 @@ For example, to erase and verify flash content:
296296
297297
west flash -r trace32 --startup-args elfFile=build/zephyr/zephyr.elf loadTo=flash eraseFlash=yes verifyFlash=yes
298298
299+
MCUboot
300+
=======
301+
302+
This board supports app chain-loading using MCUboot.
303+
304+
Build & Flash
305+
-------------
306+
307+
To build MCUboot and the ``flash_shell`` sample application together and
308+
generate HEX files suitable for flashing, run:
309+
310+
.. code-block:: console
311+
312+
west build -p -b mr_canhubk3/s32k344/mcuboot samples/drivers/flash_shell --sysbuild
313+
west flash
314+
315+
The resulting artifacts are:
316+
317+
* MCUboot: ``build/mcuboot/zephyr/zephyr.hex``
318+
* App (unsigned): ``build/flash_shell/zephyr/zephyr.hex``
319+
320+
Troubleshooting
321+
---------------
322+
323+
If MCUboot prints “Image in the primary slot is not valid” or stalls after
324+
“Jumping to the first image slot”, the app was likely signed with a 512-byte header.
325+
Re-sign with --header-size 0x400 and re-flash.
326+
327+
Do not add an IVT to MCUboot-chainloaded applications;
328+
it’s only emitted for standalone/XIP images or MCUboot itself.
329+
299330
Debugging
300331
=========
301332

0 commit comments

Comments
 (0)