Skip to content

Commit 7641f6a

Browse files
bootutil: add BLINFO_FLASH_AREA to report image flash area
Add BLINFO_FLASH_AREA TLV to boot info passed via retention. This is useful to report the flash area ID of the booted image, which can be used by boot utilities to read image status Signed-off-by: Daniel DeGrasse <[email protected]>
1 parent 936d247 commit 7641f6a

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

boot/bootutil/include/bootutil/boot_status.h

+1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ extern "C" {
119119
#define BLINFO_MAX_APPLICATION_SIZE_IMAGE_2 0x07
120120
#define BLINFO_MAX_APPLICATION_SIZE_IMAGE_3 0x08
121121
#define BLINFO_MAX_APPLICATION_SIZE_IMAGE_4 0x09
122+
#define BLINFO_FLASH_AREA 0x0A
122123

123124
enum mcuboot_mode {
124125
MCUBOOT_MODE_SINGLE_SLOT,

boot/bootutil/src/boot_record.c

+6
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,12 @@ int boot_save_shared_data(const struct image_header *hdr, const struct flash_are
330330
BLINFO_RUNNING_SLOT,
331331
sizeof(slot), (void *)&slot);
332332
}
333+
334+
if (!rc) {
335+
rc = boot_add_data_to_shared_area(TLV_MAJOR_BLINFO,
336+
BLINFO_FLASH_AREA,
337+
sizeof(fap->fa_id), (void *)&fap->fa_id);
338+
}
333339
#endif
334340

335341
#if defined(MCUBOOT_VERSION_AVAILABLE)

0 commit comments

Comments
 (0)