i.MX RT1020 MCUboot image swap failing silently on reboot under Zephyr 3.5.0 (FlexSPI/RAMFUNC issue I am implementing a multi-image OTA firmware update pipeline using MCUboot and the MCUmgr / SMP UDP transport stack on a MIMXRT1020-EVK board, running Zephyr RTOS version 3.5.0 via Sysbuild. While the networking, upload, and state-writing segments are working flawlessly, MCUboot completely skips/refuses the image swap operation upon reboot, dropping right back into the older slot 0 image without throwing visible error traces I am sending signed application updates via an Intercreate smpmgr script over UDP. The snapshot query of the flash tables right before triggering an os reset indicates the secondary slot is properly armed and flagged ImageState( slot=0, version='1.0.0', hash=HashBytes('00ECFDFD...'), bootable=True, pending=False, confirmed=True, active=True, permanent=False ) ImageState( slot=1, version='1.0.0', hash=HashBytes('2FD1F2FC...'), bootable=True, pending=True, confirmed=False, active=False, permanent=True ) Upon running the remote reset command, the board successfully triggers a system reboot, but MCUboot does not execute any sector shuffling or delays. It boots instantly straight back into the exact same HashBytes 00ECFDFD... in Slot 0. Flash Layout Configurations (.overlay) &flexspi { status = "okay"; reg = <0x402a8000 0x4000>, <0x60000000 DT_SIZE_M(8)>; is25wp064: is25wp064@0 { compatible = "nxp,imx-flexspi-nor"; size = <67108864>; reg = <0>; spi-max-frequency = <133000000>; status = "okay"; jedec-id = [9d 70 17]; erase-block-size = <4096>; write-block-size = <1>; partitions { compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; /* STEP 1: Delete all conflicting stock partitions from the base board dts */ /delete-node/ partition@0; /delete-node/ partition@10000; /delete-node/ partition@310000; /delete-node/ partition@610000; /delete-node/ partition@630000; boot_partition: partition@0 { label = "mcuboot"; reg = <0x00000000 DT_SIZE_K(64)>; }; /* Reduced slot0 to 3.4MB (0x366000) instead of 3.5MB */ slot0_partition: partition@10000 { label = "image-0"; reg = <0x00010000 0x366000>; /* 3.5MB */ }; slot1_partition: partition@390000 { label = "image-1"; reg = <0x00376000 0x366000>; /* 3.5MB */ }; scratch_partition: partition@710000 { label = "image-scratch"; reg = <0x00710000 DT_SIZE_K(128)>; }; storage_partition: partition@730000 { label = "storage"; reg = <0x00730000 DT_SIZE_K(832)>; }; }; }; }; app/prj.conf CONFIG_BOOTLOADER_MCUBOOT=y CONFIG_XIP=y CONFIG_MCUBOOT_BOOTLOADER_MODE_SWAP_WITHOUT_SCRATCH=y CONFIG_USE_DT_CODE_PARTITION=y app/sysbuild/mcuboot.conf CONFIG_XIP=y CONFIG_BOOT_SWAP_USING_MOVE=y CONFIG_BOOT_SIGNATURE_TYPE_RSA=y CONFIG_BOOT_SIGNATURE_KEY_FILE="bootloader/mcuboot/root-rsa-2048.pem" CONFIG_BOOT_VALIDATE_SLOT0=y # Attempted RAM function isolation flags for Zephyr 3.5.0 CONFIG_FLEXSPI_CONFIG_IN_RAM=y suspect we are hitting an execute-in-place (XIP) constraint where the NXP FlexSPI driver cannot write or erase flash blocks safely while executing commands out of the flash channel, causing MCUboot to safely drop the transaction on boot to protect the system. However, several modern NXP RAM function flags (such as CONFIG_CODE_FLEXSPI_RAMFUNC or CONFIG_MCUX_CODE_QUICK_ACCESS_RAMFUNC) throw "undefined symbol" compiler exceptions or dependency warnings In Zephyr 3.5.0, what are the precise Kconfig variables required to safely force all flash driver manipulation hooks entirely into internal SRAM (ITCM/SRAM) for the MCUboot child image context? Are there any hidden hardware alignment limits, FlexSPI look-up-table (LUT) configurations, or write-block sizes unique to the RT1020 that cause MCUboot to silently skip a marked permanent=True secondary image slot? Re: i.MX RT1020 MCUboot image swap failing silently on reboot under Zephyr 3.5.0 (FlexSPI/RAMFUNC is Hi @Deepa-khatri2588 ,
Thanks for your interest in NXP MIMXRT series!
I’ve reviewed your KConfig and DTS files, and it appears there are some issues. For example, `CONFIG_FLEXSPI_CONFIG_IN_RAM` and `CONFIG_CODE_FLEXSPI_RAMFUNC` do not exist in Zephyr 3.5.0.
Please check your KConfig settings in this official documentation:
https://docs.zephyrproject.org/3.5.0/kconfig.html
I recommend paying attention to the following KConfig settings:
CONFIG_CODE_FLEXSPI=y
CONFIG_XIP=y
CONFIG_FLASH_MCUX_FLEXSPI_XIP=y
CONFIG_FLASH_MCUX_FLEXSPI_XIP_MEM_ITCM=y
CONFIG_FLASH_MCUX_FLEXSPI_NOR_WRITE_BUFFER=y
CONFIG_FLASH_LOG_LEVEL_OFF=y
CONFIG_MEMC_LOG_LEVEL_OFF=y
CONFIG_MEMC=y
In DTS, there is an issue where node IDs and offset addresses do not match, which may also need to be verified:
slot1_partition: partition@390000 {
label = "image-1";
reg = <0x00376000 0x366000>;
};
Best regards, Gavin
View full article