Skip to content

Commit 943026b

Browse files
committed
[nrf noup] mgmt: mcumgr: bootutil_hooks: nrf53_hooks: Handle sysbuild image ID
fixup! [nrf noup] mgmt/mcumgr: Bootutil hooks to handle image-1 Adds support for sysbuild assigned image IDs Signed-off-by: Jamie McCrae <[email protected]>
1 parent 187d590 commit 943026b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,18 @@
88
#include <zephyr/device.h>
99
#include "bootutil/bootutil_public.h"
1010

11+
#if CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER != -1
12+
/* Sysbuild */
13+
#define NET_CORE_IMAGE CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER
14+
#else
15+
/* Legacy child/parent */
16+
#define NET_CORE_IMAGE 1
17+
#endif
18+
1119
int boot_read_swap_state_primary_slot_hook(int image_index,
1220
struct boot_swap_state *state)
1321
{
14-
if (image_index == 1) {
22+
if (image_index == NET_CORE_IMAGE) {
1523
/* Pretend that primary slot of image 1 unpopulated */
1624
state->magic = BOOT_MAGIC_UNSET;
1725
state->swap_type = BOOT_SWAP_TYPE_NONE;

0 commit comments

Comments
 (0)