This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new c22df41ca6 espressif: Add variable to override MCUboot version and URL
c22df41ca6 is described below
commit c22df41ca6a17bcfc10c242242b0cd55945db8ab
Author: Tiago Medicci Serrano <[email protected]>
AuthorDate: Tue Apr 29 12:36:08 2025 -0300
espressif: Add variable to override MCUboot version and URL
The version and the git repository of Espressif's MCUboot port can
be changed by setting the `MCUBOOT_VERSION` and `MCUBOOT_URL`
environment variables before running the `make bootloader` command.
Signed-off-by: Tiago Medicci Serrano <[email protected]>
---
arch/risc-v/src/common/espressif/Bootloader.mk | 10 ++++++++--
arch/xtensa/src/esp32/Bootloader.mk | 10 ++++++++--
arch/xtensa/src/esp32s2/Bootloader.mk | 10 ++++++++--
arch/xtensa/src/esp32s3/Bootloader.mk | 10 ++++++++--
4 files changed, 32 insertions(+), 8 deletions(-)
diff --git a/arch/risc-v/src/common/espressif/Bootloader.mk
b/arch/risc-v/src/common/espressif/Bootloader.mk
index e46f723536..46eee4f9e0 100644
--- a/arch/risc-v/src/common/espressif/Bootloader.mk
+++ b/arch/risc-v/src/common/espressif/Bootloader.mk
@@ -35,8 +35,14 @@ BOOTLOADER_CONFIG = $(BOOTLOADER_SRCDIR)/bootloader.conf
MCUBOOT_SRCDIR = $(BOOTLOADER_SRCDIR)/mcuboot
MCUBOOT_ESPDIR = $(MCUBOOT_SRCDIR)/boot/espressif
-MCUBOOT_URL = https://github.com/mcu-tools/mcuboot
MCUBOOT_TOOLCHAIN = $(TOOLSDIR)/mcuboot_toolchain_espressif.cmake
+ifndef MCUBOOT_VERSION
+ MCUBOOT_VERSION = $(CONFIG_ESPRESSIF_MCUBOOT_VERSION)
+endif
+
+ifndef MCUBOOT_URL
+ MCUBOOT_URL = https://github.com/mcu-tools/mcuboot
+endif
# Helpers for creating the configuration file
@@ -92,7 +98,7 @@ BOOTLOADER_BIN = $(TOPDIR)/mcuboot-$(CHIP_SERIES).bin
$(MCUBOOT_SRCDIR): $(BOOTLOADER_SRCDIR)
$(Q) echo "Cloning MCUboot"
$(Q) git clone --quiet $(MCUBOOT_URL) $(MCUBOOT_SRCDIR)
- $(Q) git -C "$(MCUBOOT_SRCDIR)" checkout --quiet
$(CONFIG_ESPRESSIF_MCUBOOT_VERSION)
+ $(Q) git -C "$(MCUBOOT_SRCDIR)" checkout --quiet $(MCUBOOT_VERSION)
$(Q) git -C "$(MCUBOOT_SRCDIR)" submodule --quiet update --init
--recursive ext/mbedtls
$(BOOTLOADER_BIN): chip/$(ESP_HAL_3RDPARTY_REPO) $(MCUBOOT_SRCDIR)
$(BOOTLOADER_CONFIG)
diff --git a/arch/xtensa/src/esp32/Bootloader.mk
b/arch/xtensa/src/esp32/Bootloader.mk
index 975eabc897..411cce20ba 100644
--- a/arch/xtensa/src/esp32/Bootloader.mk
+++ b/arch/xtensa/src/esp32/Bootloader.mk
@@ -35,8 +35,14 @@ BOOTLOADER_CONFIG = $(BOOTLOADER_DIR)/bootloader.conf
MCUBOOT_SRCDIR = $(BOOTLOADER_DIR)/mcuboot
MCUBOOT_ESPDIR = $(MCUBOOT_SRCDIR)/boot/espressif
-MCUBOOT_URL = https://github.com/mcu-tools/mcuboot
MCUBOOT_TOOLCHAIN = $(TOPDIR)/tools/esp32/mcuboot_toolchain_esp32.cmake
+ifndef MCUBOOT_VERSION
+ MCUBOOT_VERSION = $(CONFIG_ESP32_MCUBOOT_VERSION)
+endif
+
+ifndef MCUBOOT_URL
+ MCUBOOT_URL = https://github.com/mcu-tools/mcuboot
+endif
# Helpers for creating the configuration file
@@ -128,7 +134,7 @@ BOOTLOADER_SIGNED_BIN = $(TOPDIR)/mcuboot-esp32.signed.bin
$(MCUBOOT_SRCDIR):
$(Q) echo "Cloning MCUboot"
$(Q) git clone --quiet $(MCUBOOT_URL) $(MCUBOOT_SRCDIR)
- $(Q) git -C "$(MCUBOOT_SRCDIR)" checkout --quiet
$(CONFIG_ESP32_MCUBOOT_VERSION)
+ $(Q) git -C "$(MCUBOOT_SRCDIR)" checkout --quiet $(MCUBOOT_VERSION)
$(Q) git -C "$(MCUBOOT_SRCDIR)" submodule --quiet update --init
--recursive ext/mbedtls
$(BOOTLOADER_BIN): chip/$(ESP_HAL_3RDPARTY_REPO) $(MCUBOOT_SRCDIR)
$(BOOTLOADER_CONFIG)
diff --git a/arch/xtensa/src/esp32s2/Bootloader.mk
b/arch/xtensa/src/esp32s2/Bootloader.mk
index b83a59025c..34507d08dd 100644
--- a/arch/xtensa/src/esp32s2/Bootloader.mk
+++ b/arch/xtensa/src/esp32s2/Bootloader.mk
@@ -35,8 +35,14 @@ BOOTLOADER_CONFIG = $(BOOTLOADER_DIR)/bootloader.conf
MCUBOOT_SRCDIR = $(BOOTLOADER_DIR)/mcuboot
MCUBOOT_ESPDIR = $(MCUBOOT_SRCDIR)/boot/espressif
-MCUBOOT_URL = https://github.com/mcu-tools/mcuboot
MCUBOOT_TOOLCHAIN = $(TOPDIR)/tools/esp32s2/mcuboot_toolchain_esp32s2.cmake
+ifndef MCUBOOT_VERSION
+ MCUBOOT_VERSION = $(CONFIG_ESP32S2_MCUBOOT_VERSION)
+endif
+
+ifndef MCUBOOT_URL
+ MCUBOOT_URL = https://github.com/mcu-tools/mcuboot
+endif
$(BOOTLOADER_DIR):
$(Q) mkdir -p $(BOOTLOADER_DIR) &>/dev/null
@@ -121,7 +127,7 @@ BOOTLOADER_SIGNED_BIN = $(TOPDIR)/mcuboot-esp32s2.signed.bin
$(MCUBOOT_SRCDIR): $(BOOTLOADER_DIR)
$(Q) echo "Cloning MCUboot"
$(Q) git clone --quiet $(MCUBOOT_URL) $(MCUBOOT_SRCDIR)
- $(Q) git -C "$(MCUBOOT_SRCDIR)" checkout --quiet
$(CONFIG_ESP32S2_MCUBOOT_VERSION)
+ $(Q) git -C "$(MCUBOOT_SRCDIR)" checkout --quiet $(MCUBOOT_VERSION)
$(Q) git -C "$(MCUBOOT_SRCDIR)" submodule --quiet update --init
--recursive ext/mbedtls
$(BOOTLOADER_BIN): chip/$(ESP_HAL_3RDPARTY_REPO) $(MCUBOOT_SRCDIR)
$(BOOTLOADER_CONFIG)
diff --git a/arch/xtensa/src/esp32s3/Bootloader.mk
b/arch/xtensa/src/esp32s3/Bootloader.mk
index 7e47af0cc9..07f5c7e485 100644
--- a/arch/xtensa/src/esp32s3/Bootloader.mk
+++ b/arch/xtensa/src/esp32s3/Bootloader.mk
@@ -35,8 +35,14 @@ BOOTLOADER_CONFIG = $(BOOTLOADER_DIR)/bootloader.conf
MCUBOOT_SRCDIR = $(BOOTLOADER_DIR)/mcuboot
MCUBOOT_ESPDIR = $(MCUBOOT_SRCDIR)/boot/espressif
-MCUBOOT_URL = https://github.com/mcu-tools/mcuboot
MCUBOOT_TOOLCHAIN = $(TOPDIR)/tools/esp32s3/mcuboot_toolchain_esp32s3.cmake
+ifndef MCUBOOT_VERSION
+ MCUBOOT_VERSION = $(CONFIG_ESP32S3_MCUBOOT_VERSION)
+endif
+
+ifndef MCUBOOT_URL
+ MCUBOOT_URL = https://github.com/mcu-tools/mcuboot
+endif
$(BOOTLOADER_DIR):
$(Q) mkdir -p $(BOOTLOADER_DIR) &>/dev/null
@@ -98,7 +104,7 @@ BOOTLOADER_BIN = $(TOPDIR)/mcuboot-esp32s3.bin
$(MCUBOOT_SRCDIR): $(BOOTLOADER_DIR)
$(Q) echo "Cloning MCUboot"
$(Q) git clone --quiet $(MCUBOOT_URL) $(MCUBOOT_SRCDIR)
- $(Q) git -C "$(MCUBOOT_SRCDIR)" checkout --quiet
$(CONFIG_ESP32S3_MCUBOOT_VERSION)
+ $(Q) git -C "$(MCUBOOT_SRCDIR)" checkout --quiet $(MCUBOOT_VERSION)
$(Q) git -C "$(MCUBOOT_SRCDIR)" submodule --quiet update --init
--recursive ext/mbedtls
$(BOOTLOADER_BIN): chip/$(ESP_HAL_3RDPARTY_REPO) $(MCUBOOT_SRCDIR)
$(BOOTLOADER_CONFIG)