From e5ecbcebfa68ae4ec0c99ba00fb1d65c624a4357 Mon Sep 17 00:00:00 2001 From: Dominik Ermel Date: Thu, 30 Sep 2021 15:01:26 +0000 Subject: [PATCH] zephyr: Fix support for single application with serial recovery The commit fixes compilation error when attempting to build support for single application slot with serial recovery enabled. Signed-off-by: Dominik Ermel --- boot/boot_serial/src/boot_serial.c | 8 ++++---- boot/zephyr/include/mcuboot_config/mcuboot_config.h | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/boot/boot_serial/src/boot_serial.c b/boot/boot_serial/src/boot_serial.c index 6325179d..914167e5 100644 --- a/boot/boot_serial/src/boot_serial.c +++ b/boot/boot_serial/src/boot_serial.c @@ -63,6 +63,10 @@ BOOT_LOG_MODULE_DECLARE(mcuboot); +#ifndef BOOT_IMAGE_NUMBER +#define BOOT_IMAGE_NUMBER MCUBOOT_IMAGE_NUMBER +#endif + #define BOOT_SERIAL_INPUT_MAX 512 #define BOOT_SERIAL_OUT_MAX (128 * MCUBOOT_IMAGE_NUMBER) @@ -77,10 +81,6 @@ BOOT_LOG_MODULE_DECLARE(mcuboot); #define htons(x) sys_cpu_to_be16(x) #endif -#ifndef BOOT_IMAGE_NUMBER -#define BOOT_IMAGE_NUMBER MCUBOOT_IMAGE_NUMBER -#endif - #if (BOOT_IMAGE_NUMBER > 1) #define IMAGES_ITER(x) for ((x) = 0; (x) < BOOT_IMAGE_NUMBER; ++(x)) #else diff --git a/boot/zephyr/include/mcuboot_config/mcuboot_config.h b/boot/zephyr/include/mcuboot_config/mcuboot_config.h index 1f664d80..7061fc1c 100644 --- a/boot/zephyr/include/mcuboot_config/mcuboot_config.h +++ b/boot/zephyr/include/mcuboot_config/mcuboot_config.h @@ -68,6 +68,7 @@ #ifdef CONFIG_SINGLE_APPLICATION_SLOT #define MCUBOOT_SINGLE_APPLICATION_SLOT 1 +#define MCUBOOT_IMAGE_NUMBER 1 #else #ifdef CONFIG_BOOT_SWAP_USING_MOVE