Skip to content

Commit eff4005

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 5ad9110)
1 parent d8ae490 commit eff4005

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
@@ -219,6 +219,14 @@ config MCUMGR_GRP_IMG_SLOT_INFO_HOOKS
219219
This will enable the slot info function hooks which can be used to add additional
220220
information to responses.
221221

222+
config MCUMGR_GRP_IMG_QSPI_XIP_SPLIT_IMAGE
223+
bool "QSPI XIP Split image mode"
224+
depends on MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP
225+
help
226+
This option should not be selected by users and should automatically be selected by
227+
sysbuild if needed. This enables selecting the correct slot when running a QSPI XIP
228+
split image application in DirectXIP mode.
229+
222230
module = MCUMGR_GRP_IMG
223231
module-str = mcumgr_grp_img
224232
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
@@ -235,6 +235,12 @@ int img_mgmt_active_slot(int image)
235235
/* Multi image does not support DirectXIP or RAM load currently */
236236
#if CONFIG_MCUMGR_GRP_IMG_UPDATABLE_IMAGE_NUMBER > 1
237237
slot = (image << 1);
238+
239+
#if CONFIG_MCUMGR_GRP_IMG_QSPI_XIP_SPLIT_IMAGE
240+
if (FIXED_PARTITION_IS_RUNNING_APP_PARTITION(slot1_partition)) {
241+
slot += 1;
242+
}
243+
#endif
238244
#elif defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD)
239245
/* RAM load requires querying bootloader */
240246
int rc;

0 commit comments

Comments
 (0)