File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 34
34
#define BOOT_HEADER_MAGIC_V1 0x96f3b83d
35
35
#define BOOT_HEADER_SIZE_V1 32
36
36
37
+ #if USE_PARTITION_MANAGER
38
+ #include <pm_config.h>
39
+
40
+ #if CONFIG_BUILD_WITH_TFM
41
+ #define PM_ADDRESS_OFFSET (PM_MCUBOOT_PAD_SIZE + PM_TFM_SIZE)
42
+ #else
43
+ #define PM_ADDRESS_OFFSET (PM_MCUBOOT_PAD_SIZE)
44
+ #endif
45
+
46
+ #ifdef CONFIG_MCUBOOT
47
+ /* lib is part of MCUboot -> operate on the primart application slot */
48
+ #define ACTIVE_SLOT_ID PM_MCUBOOT_PRIMARY_ID
49
+ #else
50
+ /* lib is part of the App -> operate on active slot */
51
+ #if (PM_ADDRESS - PM_ADDRESS_OFFSET ) == PM_MCUBOOT_PRIMARY_ADDRESS
52
+ #define ACTIVE_SLOT_ID PM_MCUBOOT_PRIMARY_ID
53
+ #elif (PM_ADDRESS - PM_ADDRESS_OFFSET ) == PM_MCUBOOT_SECONDARY_ADDRESS
54
+ #define ACTIVE_SLOT_ID PM_MCUBOOT_SECONDARY_ID
55
+ #else
56
+ #error Missing partition definitions.
57
+ #endif
58
+ #endif /* CONFIG_MCUBOOT */
59
+
60
+ #define ACTIVE_SLOT_FLASH_AREA_ID ACTIVE_SLOT_ID
61
+ #else
37
62
/* Get active partition. zephyr,code-partition chosen node must be defined */
38
63
#define ACTIVE_SLOT_FLASH_AREA_ID DT_FIXED_PARTITION_ID(DT_CHOSEN(zephyr_code_partition))
64
+ #endif /* USE_PARTITION_MANAGER */
39
65
40
66
/*
41
67
* Raw (on-flash) representation of the v1 image header.
You can’t perform that action at this time.
0 commit comments