Skip to content

soc: espressif: Build MCUboot Espressif Port using sysbuild #87710

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

almir-okato
Copy link
Contributor

@almir-okato almir-okato commented Mar 26, 2025

Use sysbuild to build MCUboot Espressif Port as an external project.

The current sysbuild usage for Espressif should not be affected, so the regular west build <BOARD> <SAMPLE> --sysbuild still builds Zephyr Port. In order to build Espressif Port, the Kconfig CONFIG_BOOTLOADER_MCUBOOT_ESPRESSIF needs to be enabled on the sysbuild menuconfig, or it can be passed as sysbuild domain variable in the command line --sysbuild -DSB_CONFIG_BOOTLOADER_MCUBOOT_ESPRESSIF=y.

Kconfigs for Espressif's Kconfig.sysbuild were added to match MCUboot Espressif Port configuration, so they are partially similar to the regular Zephyr Port, but notice it's a different MCUboot Port.

CONFIG_MCUBOOT_ESPRESSIF indicates that the current build is MCUboot Espressif Port image. Defined in Espressif Port from MCUboot repository.
(SB_)CONFIG_BOOTLOADER_MCUBOOT_ESPRESSIF indicates to Espressif's sysbuild cmake that it needs to build the MCUboot Espressif Port bootloader and that it needs to set the main image as a MCUboot compatible image, similar as Zephyr already does with the CONFIG_BOOTLOADER_MCUBOOT for setting Zephyr Port and MCUboot compatibility when building with sysbuild.

How to build and test:

west build -b esp32c3_devkitc samples/hello_world --sysbuild -DSB_CONFIG_BOOTLOADER_MCUBOOT_ESPRESSIF=y -p
west flash

OR

west build -b esp32c3_devkitc ../bootloader/mcuboot/boot/espressif/zephyr/  -p
west flash
  • Update hal_espressif revision in west.yml
  • Update mcuboot revision in west.yml

Move BOOTLOADER_MCUBOOT configuration from
boards/espressif/<BOARD>/Kconfig.sysbuild to
soc/espressif/Kconfig.sysbuild so it applies generally to every
board with Espressif's SoC when building a project using sysbuild.

Signed-off-by: Almir Okato <[email protected]>
@almir-okato almir-okato force-pushed the mcuboot_espressif_port_integration branch from 2077475 to db68a0f Compare April 14, 2025 19:40
@almir-okato almir-okato changed the title DRAFT: soc: espressif: Build MCUboot Espressif Port using sysbuild soc: espressif: Build MCUboot Espressif Port using sysbuild Apr 14, 2025
@almir-okato almir-okato marked this pull request as ready for review April 15, 2025 13:36
@almir-okato almir-okato force-pushed the mcuboot_espressif_port_integration branch from db68a0f to 3d99369 Compare April 22, 2025 15:50
@almir-okato almir-okato requested a review from JarmouniA April 22, 2025 15:52
@almir-okato almir-okato force-pushed the mcuboot_espressif_port_integration branch from 3d99369 to 72de282 Compare April 23, 2025 13:35
@almir-okato almir-okato requested a review from nordicjm April 23, 2025 13:55
@almir-okato almir-okato force-pushed the mcuboot_espressif_port_integration branch from 72de282 to fd0fbcc Compare April 24, 2025 15:09
Enable sysbuild to build MCUboot Espressif's port as an
external project.

Signed-off-by: Almir Okato <[email protected]>
Signed-off-by: Lucas Tamborrino <[email protected]>
Signed-off-by: Marek Matej <[email protected]>
@almir-okato almir-okato force-pushed the mcuboot_espressif_port_integration branch from fd0fbcc to e1c5597 Compare April 24, 2025 15:28
@almir-okato almir-okato requested a review from nordicjm April 24, 2025 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants