-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
almir-okato
wants to merge
2
commits into
zephyrproject-rtos:main
Choose a base branch
from
almir-okato:mcuboot_espressif_port_integration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
choice BOOTLOADER | ||
default BOOTLOADER_MCUBOOT | ||
endchoice | ||
|
||
choice BOOT_SIGNATURE_TYPE | ||
default BOOT_SIGNATURE_TYPE_NONE | ||
endchoice |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
choice BOOTLOADER | ||
default BOOTLOADER_MCUBOOT | ||
endchoice | ||
|
||
choice BOOT_SIGNATURE_TYPE | ||
default BOOT_SIGNATURE_TYPE_NONE | ||
endchoice |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
# Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
choice BOOTLOADER | ||
default BOOTLOADER_MCUBOOT | ||
endchoice | ||
|
||
choice BOOT_SIGNATURE_TYPE | ||
default BOOT_SIGNATURE_TYPE_NONE | ||
endchoice |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
choice BOOTLOADER | ||
default BOOTLOADER_MCUBOOT | ||
endchoice | ||
|
||
choice BOOT_SIGNATURE_TYPE | ||
default BOOT_SIGNATURE_TYPE_NONE | ||
endchoice |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
# Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
choice BOOTLOADER | ||
default BOOTLOADER_MCUBOOT | ||
endchoice | ||
|
||
choice BOOT_SIGNATURE_TYPE | ||
default BOOT_SIGNATURE_TYPE_NONE | ||
endchoice |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
choice BOOTLOADER | ||
default BOOTLOADER_MCUBOOT | ||
endchoice | ||
|
||
choice BOOT_SIGNATURE_TYPE | ||
default BOOT_SIGNATURE_TYPE_NONE | ||
endchoice |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
# Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
choice BOOTLOADER | ||
default BOOTLOADER_MCUBOOT | ||
endchoice | ||
|
||
choice BOOT_SIGNATURE_TYPE | ||
default BOOT_SIGNATURE_TYPE_NONE | ||
endchoice |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
choice BOOTLOADER | ||
default BOOTLOADER_MCUBOOT | ||
endchoice | ||
|
||
choice BOOT_SIGNATURE_TYPE | ||
default BOOT_SIGNATURE_TYPE_NONE | ||
endchoice |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
# Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
choice BOOTLOADER | ||
default BOOTLOADER_MCUBOOT | ||
endchoice | ||
|
||
choice BOOT_SIGNATURE_TYPE | ||
default BOOT_SIGNATURE_TYPE_NONE | ||
endchoice |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
choice BOOTLOADER | ||
default BOOTLOADER_MCUBOOT | ||
endchoice | ||
|
||
choice BOOT_SIGNATURE_TYPE | ||
default BOOT_SIGNATURE_TYPE_NONE | ||
endchoice |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
# Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
choice BOOTLOADER | ||
default BOOTLOADER_MCUBOOT | ||
endchoice | ||
|
||
choice BOOT_SIGNATURE_TYPE | ||
default BOOT_SIGNATURE_TYPE_NONE | ||
endchoice |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
# Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
choice BOOTLOADER | ||
default BOOTLOADER_MCUBOOT | ||
endchoice | ||
|
||
choice BOOT_SIGNATURE_TYPE | ||
default BOOT_SIGNATURE_TYPE_NONE | ||
endchoice |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
choice BOOTLOADER | ||
default BOOTLOADER_MCUBOOT | ||
endchoice | ||
|
||
choice BOOT_SIGNATURE_TYPE | ||
default BOOT_SIGNATURE_TYPE_NONE | ||
endchoice |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,141 @@ | ||
# Copyright (c) 2024 Nordic Semiconductor ASA | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
choice BOOTLOADER | ||
default BOOTLOADER_MCUBOOT | ||
|
||
# Extension for the BOOTLOADER Kconfig choice to allow | ||
# MCUboot Espressif Port to be built | ||
config BOOTLOADER_MCUBOOT_ESPRESSIF | ||
almir-okato marked this conversation as resolved.
Show resolved
Hide resolved
|
||
bool "MCUboot Espressif Port" | ||
depends on SOC_FAMILY_ESPRESSIF_ESP32 | ||
help | ||
Use MCUboot Espressif Port as the bootloader | ||
|
||
endchoice | ||
|
||
choice MCUBOOT_MODE | ||
default MCUBOOT_MODE_OVERWRITE_ONLY if SOC_FAMILY_ESPRESSIF_ESP32 | ||
endchoice | ||
|
||
if BOOTLOADER_MCUBOOT_ESPRESSIF | ||
|
||
config ESP_MCUBOOT_IMGTOOL_OVERWRITE_ONLY | ||
bool | ||
help | ||
If enabled, --overwrite-only option is passed to imgtool to avoid | ||
adding the swap status area size when calculating overflow. | ||
|
||
choice ESP_MCUBOOT_MODE | ||
prompt "Mode of operation" | ||
default ESP_MCUBOOT_MODE_SWAP_SCRATCH | ||
help | ||
The operating mode of MCUboot (which will also be propagated to the application). | ||
|
||
config ESP_MCUBOOT_MODE_SINGLE_APP | ||
bool "Single slot" | ||
select ESP_MCUBOOT_IMGTOOL_OVERWRITE_ONLY | ||
help | ||
MCUboot will only boot slot0_partition placed application and does not care about other | ||
slots. In this mode application is not able to DFU its own update to secondary slot and | ||
all updates need to be performed using MCUboot serial recovery. | ||
|
||
config ESP_MCUBOOT_MODE_SWAP_USING_OFFSET | ||
bool "Swap using offset" | ||
select EXPERIMENTAL | ||
select ESP_MCUBOOT_BOOTLOADER_MODE_HAS_NO_DOWNGRADE | ||
help | ||
MCUboot expects slot0_partition and slot1_partition to be present in DT and application | ||
will boot from slot0_partition. MCUBOOT_BOOTLOADER_NO_DOWNGRADE should also be selected | ||
in main application if MCUboot has been built with MCUBOOT_DOWNGRADE_PREVENTION. | ||
|
||
config ESP_MCUBOOT_MODE_SWAP_USING_MOVE | ||
bool "Swap using move" | ||
select ESP_MCUBOOT_BOOTLOADER_MODE_HAS_NO_DOWNGRADE | ||
help | ||
MCUboot expects slot0_partition and slot1_partition to be present in DT and application | ||
will boot from slot0_partition. MCUBOOT_BOOTLOADER_NO_DOWNGRADE should also be selected | ||
in main application if MCUboot has been built with MCUBOOT_DOWNGRADE_PREVENTION. | ||
|
||
config ESP_MCUBOOT_MODE_SWAP_SCRATCH | ||
bool "Swap using scratch" | ||
select ESP_MCUBOOT_BOOTLOADER_MODE_HAS_NO_DOWNGRADE | ||
help | ||
MCUboot expects slot0_partition, slot1_partition and scratch_partition to be present in | ||
DT, and application will boot from slot0_partition. In this mode scratch_partition is | ||
used as temporary storage when MCUboot swaps application from the secondary slot to the | ||
primary slot. | ||
MCUBOOT_BOOTLOADER_NO_DOWNGRADE should also be selected in main application if MCUboot | ||
has been built with MCUBOOT_DOWNGRADE_PREVENTION. | ||
|
||
config ESP_MCUBOOT_MODE_OVERWRITE_ONLY | ||
bool "Overwrite" | ||
select ESP_MCUBOOT_IMGTOOL_OVERWRITE_ONLY | ||
select ESP_MCUBOOT_BOOTLOADER_MODE_HAS_NO_DOWNGRADE | ||
help | ||
MCUboot will take the content of secondary slot of an image and will overwrite primary | ||
slot with it. In this mode it is not possible to revert back to previous version as it | ||
is not stored in the secondary slot. | ||
This mode supports MCUBOOT_BOOTLOADER_NO_DOWNGRADE which means that the overwrite will | ||
not happen unless the version of secondary slot is higher than the version in primary | ||
slot. | ||
|
||
endchoice # ESP_MCUBOOT_MODE | ||
|
||
config ESP_MCUBOOT_BOOTLOADER_MODE_HAS_NO_DOWNGRADE | ||
bool | ||
help | ||
Selected mode supports downgrade prevention, where you cannot switch to | ||
an application with lower version than the currently running application. | ||
|
||
if ESP_MCUBOOT_BOOTLOADER_MODE_HAS_NO_DOWNGRADE | ||
|
||
config ESP_MCUBOOT_BOOTLOADER_NO_DOWNGRADE | ||
almir-okato marked this conversation as resolved.
Show resolved
Hide resolved
|
||
bool "MCUboot downgrade prevention" | ||
help | ||
Selected MCUboot mode has downgrade prevention, where it's not | ||
possible to revert back to image with lower version number. | ||
This options should be selected when MCUboot has been built with | ||
MCUBOOT_DOWNGRADE_PREVENTION option enabled. | ||
|
||
endif # ESP_MCUBOOT_BOOTLOADER_MODE_HAS_NO_DOWNGRADE | ||
|
||
choice ESP_BOOT_SIGNATURE_TYPE | ||
prompt "Signature type" | ||
default ESP_BOOT_SIGNATURE_TYPE_NONE | ||
|
||
config ESP_BOOT_SIGNATURE_TYPE_NONE | ||
bool "No signature; use only hash check" | ||
|
||
config ESP_BOOT_SIGNATURE_TYPE_RSA | ||
bool "RSA signatures" | ||
|
||
if ESP_BOOT_SIGNATURE_TYPE_RSA | ||
|
||
config ESP_BOOT_SIGNATURE_RSA_LEN | ||
int "RSA signature length" | ||
range 2048 3072 | ||
default 2048 | ||
|
||
endif | ||
|
||
config ESP_BOOT_SIGNATURE_TYPE_ECDSA_P256 | ||
bool "Elliptic curve digital signatures with curve P-256" | ||
|
||
config ESP_BOOT_SIGNATURE_TYPE_ED25519 | ||
bool "Edwards curve digital signatures using ed25519" | ||
|
||
endchoice # ESP_BOOT_SIGNATURE_TYPE | ||
|
||
config ESP_BOOT_SIGNATURE_KEY_FILE | ||
string "Signing PEM key file" | ||
depends on !ESP_BOOT_SIGNATURE_TYPE_NONE | ||
default "$(ZEPHYR_MCUBOOT_MODULE_DIR)/root-ec-p256.pem" if ESP_BOOT_SIGNATURE_TYPE_ECDSA_P256 | ||
default "$(ZEPHYR_MCUBOOT_MODULE_DIR)/root-ed25519.pem" if ESP_BOOT_SIGNATURE_TYPE_ED25519 | ||
default "$(ZEPHYR_MCUBOOT_MODULE_DIR)/root-rsa-2048.pem" if ESP_BOOT_SIGNATURE_TYPE_RSA && ESP_BOOT_SIGNATURE_RSA_LEN=2048 | ||
default "$(ZEPHYR_MCUBOOT_MODULE_DIR)/root-rsa-3072.pem" if ESP_BOOT_SIGNATURE_TYPE_RSA && ESP_BOOT_SIGNATURE_RSA_LEN=3072 | ||
default "" | ||
help | ||
Absolute path to signing key file to use with MCUBoot. | ||
|
||
endif # BOOTLOADER_MCUBOOT_ESPRESSIF |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.