From d6a73a46e8518f54bc4bc83f73d181ecdced8dcf Mon Sep 17 00:00:00 2001 From: Davi Diogo Date: Wed, 13 Nov 2024 11:02:29 -0300 Subject: [PATCH] riscv/espressif/bootloader/mcuboot: Sign image with MCUBoot version Add version signature to MCUBoot compatible image on espressif RISC-V architecture Signed-off-by: Davi Diogo --- arch/risc-v/src/common/espressif/Kconfig | 5 +++++ tools/espressif/Config.mk | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/risc-v/src/common/espressif/Kconfig b/arch/risc-v/src/common/espressif/Kconfig index c8d55964bf..2e432d0814 100644 --- a/arch/risc-v/src/common/espressif/Kconfig +++ b/arch/risc-v/src/common/espressif/Kconfig @@ -197,6 +197,11 @@ config ESPRESSIF_ESPTOOL_TARGET_SECONDARY endchoice +config ESPRESSIF_MCUBOOT_SIGN_IMAGE_VERSION + string "Sign image version" + depends on ESPRESSIF_BOOTLOADER_MCUBOOT + default "1.0.0" + config ESPRESSIF_APP_MCUBOOT_HEADER_SIZE int "Application image header size (in bytes)" default 32 diff --git a/tools/espressif/Config.mk b/tools/espressif/Config.mk index 4e76bd1d0c..8ac396863c 100644 --- a/tools/espressif/Config.mk +++ b/tools/espressif/Config.mk @@ -91,7 +91,7 @@ ifeq ($(CONFIG_ESPRESSIF_BOOTLOADER_MCUBOOT),y) APP_IMAGE := nuttx.bin FLASH_APP := $(APP_OFFSET) $(APP_IMAGE) IMGTOOL_ALIGN_ARGS := --align 4 - IMGTOOL_SIGN_ARGS := --pad $(VERIFIED) $(IMGTOOL_ALIGN_ARGS) -v 0 -s auto \ + IMGTOOL_SIGN_ARGS := --pad $(VERIFIED) $(IMGTOOL_ALIGN_ARGS) -v $(CONFIG_ESPRESSIF_MCUBOOT_SIGN_IMAGE_VERSION) -s auto \ -H $(CONFIG_ESPRESSIF_APP_MCUBOOT_HEADER_SIZE) --pad-header \ -S $(CONFIG_ESPRESSIF_OTA_SLOT_SIZE) else ifeq ($(CONFIG_ESPRESSIF_SIMPLE_BOOT),y)