Skip to content

Commit 5ad9110

Browse files
nordicjmrlubos
authored andcommitted
[nrf noup] mgmt: mcumgr: grp: img_mgmt: Add handling for QSPI XIP
Adds handling code to allow selecting the correct image slot when using QSPI XIP in DirectXIP mode Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no> (cherry picked from commit f42af7e)
1 parent fead683 commit 5ad9110

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig

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

219+
config MCUMGR_GRP_IMG_QSPI_XIP_SPLIT_IMAGE
220+
bool "QSPI XIP Split image mode"
221+
depends on MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP
222+
help
223+
This option should not be selected by users and should automatically be selected by
224+
sysbuild if needed. This enables selecting the correct slot when running a QSPI XIP
225+
split image application in DirectXIP mode.
226+
219227
module = MCUMGR_GRP_IMG
220228
module-str = mcumgr_grp_img
221229
source "subsys/logging/Kconfig.template.log_config"

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,12 @@ int img_mgmt_active_slot(int image)
231231
/* Multi image does not support DirectXIP or RAM load currently */
232232
#if CONFIG_MCUMGR_GRP_IMG_UPDATABLE_IMAGE_NUMBER > 1
233233
slot = (image << 1);
234+
235+
#if CONFIG_MCUMGR_GRP_IMG_QSPI_XIP_SPLIT_IMAGE
236+
if (FIXED_PARTITION_IS_RUNNING_APP_PARTITION(slot1_partition)) {
237+
slot += 1;
238+
}
239+
#endif
234240
#elif defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD)
235241
/* RAM load requires querying bootloader */
236242
int rc;

0 commit comments

Comments
 (0)