Skip to content

Commit 9a99f6f

Browse files
Refactor MCUboot configuration and documentation for improved clarity and usability
1 parent bbd1a0b commit 9a99f6f

5 files changed

Lines changed: 20 additions & 21 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ west flash
113113
To build MCUboot alongside the app and produce a signed application image:
114114

115115
```shell
116-
west build -p -b esp32s3_devkitc/esp32s3/procpu OpenAstroFocuser/app --sysbuild
116+
west build -p -b esp32s3_devkitc/esp32s3/procpu OpenAstroFocuser/app --sysbuild -S mcuboot
117117
```
118118

119119
Flash MCUboot first, then the application image:
@@ -126,7 +126,7 @@ west flash -d build/app
126126
Notes:
127127

128128
- The signed application artifact is `build/app/zephyr/zephyr.signed.bin`.
129-
- This repo uses MCUboot's default test key for development; replace it for production.
129+
- By default, sysbuild uses MCUboot's development/test key from the `mcuboot` module; override `SB_CONFIG_BOOT_SIGNATURE_KEY_FILE` for production.
130130

131131
Pass `-DEXTRA_CONF_FILE=debug.conf` for verbose logging or switch `-b` to any supported board/overlay.
132132

app/prj.conf

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@ CONFIG_STD_CPP20=y
77
CONFIG_GLIBCXX_LIBCPP=y
88
CONFIG_MOONLITE=y
99

10-
# Build as an MCUboot-chainloaded image and sign it.
11-
CONFIG_BOOTLOADER_MCUBOOT=y
12-
# ESP32 defaults to unsigned images when MCUboot is enabled; override so signing runs.
13-
CONFIG_MCUBOOT_GENERATE_UNSIGNED_IMAGE=n
14-
CONFIG_MCUBOOT_SIGNATURE_KEY_FILE="bootloader/mcuboot/root-rsa-2048.pem"
15-
1610
# Provide heap storage for std::string and other dynamic allocations.
1711
CONFIG_HEAP_MEM_POOL_SIZE=4096
1812

app/snippets/mcuboot/snippet.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
name: mcuboot
2+
append:
3+
SB_EXTRA_CONF_FILE: sysbuild-mcuboot.conf
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Enable MCUboot (sysbuild) and signed images.
2+
3+
SB_CONFIG_BOOTLOADER_MCUBOOT=y
4+
5+
# ESP32* MCUboot configs default to no signatures; override to RSA.
6+
SB_CONFIG_BOOT_SIGNATURE_TYPE_RSA=y
7+
8+
# The sysbuild bootloader Kconfig provides a default RSA key path from the MCUboot module.
9+
# For production, override SB_CONFIG_BOOT_SIGNATURE_KEY_FILE with an absolute path to your own PEM.

app/sysbuild.conf

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
1-
# Sysbuild configuration for OpenAstroFocuser
1+
# Sysbuild configuration for OpenAstroFocuser.
22
#
3-
# Builds MCUboot alongside the application and signs the application image so
4-
# it can be chain-loaded by MCUboot.
5-
6-
SB_CONFIG_BOOTLOADER_MCUBOOT=y
7-
8-
# ESP32* MCUboot configs default to no signatures; override to RSA.
9-
SB_CONFIG_BOOT_SIGNATURE_TYPE_RSA=y
10-
11-
# By default, sysbuild will use the MCUboot test key shipped with the
12-
# MCUboot module when RSA is selected.
13-
# For production, set SB_CONFIG_BOOT_SIGNATURE_KEY_FILE to an absolute path
14-
# to your own PEM key.
3+
# Keep this file empty by default.
4+
#
5+
# To build with MCUboot + signing, use the Zephyr snippet:
6+
#
7+
# west build -S mcuboot --sysbuild [...]

0 commit comments

Comments
 (0)