Skip to content

Commit 8c84839

Browse files
nordicjmcarlescufi
authored andcommitted
Reapply "[nrf noup] mgmt: mcumgr: grp: img_mgmt: Add handling for QSPI XIP"
This reverts commit e321b55. Signed-off-by: Jamie McCrae <[email protected]>
1 parent 51911b5 commit 8c84839

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,14 @@ config MCUMGR_GRP_IMG_SLOT_INFO_HOOKS
237237
This will enable the slot info function hooks which can be used to add additional
238238
information to responses.
239239

240+
config MCUMGR_GRP_IMG_QSPI_XIP_SPLIT_IMAGE
241+
bool "QSPI XIP Split image mode"
242+
depends on MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP
243+
help
244+
This option should not be selected by users and should automatically be selected by
245+
sysbuild if needed. This enables selecting the correct slot when running a QSPI XIP
246+
split image application in DirectXIP mode.
247+
240248
module = MCUMGR_GRP_IMG
241249
module-str = mcumgr_grp_img
242250
source "subsys/logging/Kconfig.template.log_config"

subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,14 @@ int img_mgmt_active_slot(int image)
218218
/* Multi image does not support DirectXIP or RAM load currently */
219219
#if CONFIG_MCUMGR_GRP_IMG_UPDATABLE_IMAGE_NUMBER > 1
220220
slot = (image << 1);
221+
222+
#if defined(CONFIG_MCUMGR_GRP_IMG_QSPI_XIP_SPLIT_IMAGE) || \
223+
defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP) || \
224+
defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP_WITH_REVERT)
225+
if (FIXED_PARTITION_IS_RUNNING_APP_PARTITION(slot1_partition)) {
226+
slot += 1;
227+
}
228+
#endif
221229
#elif defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD)
222230
/* RAM load requires querying bootloader */
223231
int rc;

0 commit comments

Comments
 (0)