Skip to content

Commit 0fb7618

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 In case of Direct XIP and multiple images, the radio active slot changes accordingly (i.e. application slot 1 boots radio slot 1). Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no> Signed-off-by: Tomasz Chyrowicz <tomasz.chyrowicz@nordicsemi.no> (cherry picked from commit a5b67c1)
1 parent bdef61c commit 0fb7618

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
@@ -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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,14 @@ 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 defined(CONFIG_MCUMGR_GRP_IMG_QSPI_XIP_SPLIT_IMAGE) || \
240+
defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP) || \
241+
defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP_WITH_REVERT)
242+
if (FIXED_PARTITION_IS_RUNNING_APP_PARTITION(slot1_partition)) {
243+
slot += 1;
244+
}
245+
#endif
238246
#elif defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD)
239247
/* RAM load requires querying bootloader */
240248
int rc;

0 commit comments

Comments
 (0)