Skip to content

Commit 63893d4

Browse files
dfu: mcuboot: update dependencies for RAMLOAD_WITH_REVERT
Much like in RAMLOAD mode, RAMLOAD_WITH_REVERT requires that mcuboot subsystem fetch bootloader information via the retention subsystem. Signed-off-by: Daniel DeGrasse <[email protected]>
1 parent 25699ee commit 63893d4

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

subsys/dfu/boot/mcuboot.c

+13-5
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
#include "bootutil/bootutil_public.h"
2121
#include <zephyr/dfu/mcuboot.h>
2222

23-
#if defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD)
23+
#if defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD) || \
24+
defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD_WITH_REVERT)
25+
/* For RAM LOAD mode, the active image must be fetched from the bootloader */
2426
#include <bootutil/boot_status.h>
2527
#include <zephyr/retention/blinfo.h>
2628
#endif
@@ -49,7 +51,8 @@ enum IMAGE_INDEXES {
4951
IMAGE_INDEX_2
5052
};
5153

52-
#if defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD)
54+
#if defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD) || \
55+
defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD_WITH_REVERT)
5356
/* For RAM LOAD mode, the active image must be fetched from the bootloader */
5457
#define ACTIVE_SLOT_FLASH_AREA_ID boot_fetch_active_slot()
5558
#define INVALID_SLOT_ID 255
@@ -81,7 +84,8 @@ struct mcuboot_v1_raw_header {
8184
* End of strict defines
8285
*/
8386

84-
#if defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD)
87+
#if defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD) || \
88+
defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD_WITH_REVERT)
8589
uint8_t boot_fetch_active_slot(void)
8690
{
8791
int rc;
@@ -99,12 +103,16 @@ uint8_t boot_fetch_active_slot(void)
99103

100104
return slot;
101105
}
102-
#else /* CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD */
106+
#else /* CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD ||
107+
* CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD_WITH_REVERT
108+
*/
103109
uint8_t boot_fetch_active_slot(void)
104110
{
105111
return ACTIVE_SLOT_FLASH_AREA_ID;
106112
}
107-
#endif /* CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD */
113+
#endif /* CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD ||
114+
* CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD_WITH_REVERT
115+
*/
108116

109117
#if defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_SWAP_USING_OFFSET)
110118
size_t boot_get_image_start_offset(uint8_t area_id)

0 commit comments

Comments
 (0)