This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DFU over BLE + MCUboot + External Flash QSPI: "MGMT_ERR_ENOENT"

Hi,

I am working with nRF52840 SoC (custom board) and AT25QL641 QSPI Flash chip. I am on v2.1.0 of nRF Connect SDK. The slot1 (update slot) is on an external flash. 

Whenever I try to upload the update image from nRF Connect Device Manager I get "Remote error: No Entry (5)". This is translated from a  "MGMT_ERR_ENOENT" error code return from img_mgmt_read_info() of MCUmanager. I have seen this thread with a similar issue:

 Failure in mgmt while trying to upgrade the app using external flash as secondary slot 

but increasing stack sizes did not resolve my issue.

I have also looked through a number of DFU+MCUboot+External Flash threads to get to this point. It is possible that this issue is related to the partition manager or MCUboot configuration since I have had prior issues with those.  

My child_image/mcuboot.conf looks like this:

CONFIG_PINCTRL=y
CONFIG_FLASH=y
CONFIG_NRFX_QSPI=y
CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=n
CONFIG_NORDIC_QSPI_NOR=y
CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16

CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y
CONFIG_BOOT_MAX_IMG_SECTORS=256
CONFIG_PM_EXTERNAL_FLASH_BASE=0x0
 

I don't use a static partition file.


The device tree is modified in the following way:

/delete-node/ &slot0_partition;
/delete-node/ &slot1_partition;

// Extending boot partition in internal flash (since slot1 will be moved)
&flash0{
    partitions {
        slot0_partition: partition@c000 {
            label = "image-0";
            reg = <0xc000 0xE4000>;
        }; 
    };
};

&qspi {
	status = "okay";
	pinctrl-0 = <&qspi_default>;
    pinctrl-1 = <&qspi_sleep>;
	pinctrl-names = "default", "sleep";
	at25ql641: at25ql641@0 {
		compatible = "nordic,qspi-nor";
        reg = < 0 >;
        jedec-id = [ 1F 43 17 ];
        sck-frequency = < 133000000 >;
        //size-in-bytes = < 67108864 >; Does not work with partition manager
        size=<536870912>; 
        partitions {
            compatible = "fixed-partitions";
            #address-cells = <1>;
            #size-cells = <1>;
            slot1_partition: partition@0 {
                label = "image-1";
                reg = <0x0 0x0E4000>;
            };
        };
	};
};

/ {
    chosen {
        nordic,pm-ext-flash = &at25ql641;
    };
};

I have already applied the "partition_manager.cmake" fix from this thread:

 RE: nRF9160dk FOTA using external flash, ncs 2.0.2 

Finally, I have also confirmed that I am able to read and write to external flash from the application itself.

Thank you,

Andy

  • Hi,

     

    Which example are you using as a starting-point?

    Whenever I try to upload the update image from nRF Connect Device Manager I get "Remote error: No Entry (5)". This is translated from a  "MGMT_ERR_ENOENT" error code return from img_mgmt_read_info() of MCUmanager. I have seen this thread with a similar issue:

    This indicates that you are using an application aware DFU process, ie. that your application is fetching the image and storing it to flash.

    This will therefore require that the application has certain configurations enabled as well as the mcuboot child_image.

    Do you have a log output from the nRF that you can share?

     

    The size in DT should be provided as bits, and you have set 512MBit (size=<536870912>; -> 64MByte), while the part number that you list:

    AT25QL641

    indicates that the flash is 64 MBit.

     

    Kind regards,

    Håkon

  • Thank you   the size has been fixed.

    The example that I have used as a starting point is this one:

     Add DFU support to your application 

    With all debugging logging enabled, the only message I am logging is:

    <inf> mcuboot_util: Swap type: revert

    When I read the image information from nRF Connect Device Manager I only see:

    Image 0

    • Slot: 0
    • Version 0.0.0
    • Hash: 0x...
    • Flags: Bootable, Active

    When I was using internal flash only, I saw information about two slots. I believe the second slot is not recognized by the MCUmgr for some reason. 

    In addition to the above in child_image/mcuboot.conf I do also have:

    CONFIG_NCS_MCUBOOT_IN_BUILD=y
     

    While in the prj.conf I have:

    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_MCUMGR=y
    CONFIG_MCUMGR_CMD_IMG_MGMT=y
    CONFIG_MCUMGR_CMD_OS_MGMT=y
    CONFIG_MCUMGR_SMP_BT=y
    
    CONFIG_FLASH=y
    CONFIG_NRFX_QSPI=y
    CONFIG_NORDIC_QSPI_NOR=y
    
    CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16
    CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y
    CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=n
    
    CONFIG_MCUMGR_LOG_LEVEL_DBG=y
    CONFIG_MCUMGR_IMG_MGMT_LOG_LEVEL_DBG=y
    CONFIG_MCUMGR_SMP_LOG_LEVEL_DBG=y
    CONFIG_IMG_MANAGER_LOG_LEVEL_DBG=y
    CONFIG_BT_DFU_SMP_LOG_LEVEL_DBG=y
    CONFIG_FLASH_LOG_LEVEL_DBG=y
    CONFIG_IMG_MGMT_VERBOSE_ERR=y

  • Hi  ,

    I was able to resolve the issue of not being able to transfer by including pm_static.yml in my project directory.

    I re-opened this ticked because even though I am able to transfer the update images and boot them, I am unable to confirm them. After the transfer is finished and the target has restarted and booted up, nRF Connect Device Manager tries to confirm the image and returns "Device returned error: In Value (3)". This also happens when I try to confirm manually through the "Advanced" interface.

    Meanwhile, the logs do not show any issues.

    00> [00:00:58.944,274] <inf> mcuboot_util: Swap type: none
    00> [00:00:58.948,577] <inf> mcuboot_util: Swap type: none
    00> [00:00:59.040,557] <inf> mcuboot_util: Swap type: none
    00> [00:00:59.041,381] <inf> mcuboot_util: Swap type: none
    00> [00:01:40.856,719] <inf> mcuboot_util: Swap type: none
    00> [00:01:40.857,543] <dbg> mcuboot_util: boot_write_magic: writing magic; fa_id=2 off=0xe3ff0 (0xe3ff0)
    00> [00:01:40.858,367] <dbg> mcuboot_util: boot_write_swap_info: writing swap_info; fa_id=2 off=0xe3fd8 (0xe3fd8), swap_type=0x2 image_num=0x0
    00> [00:01:40.860,626] <inf> mcuboot_util: Swap type: test
    00> [00:01:40.864,959] <inf> mcuboot_util: Swap type: test

  • Hi,

     

    ayuzva said:

    I was able to resolve the issue of not being able to transfer by including pm_static.yml in my project directory.

    Great that you found this!

    This should be done for all "upgrade project" to align the flash layout as your original mcuboot expects.

    ayuzva said:
    I re-opened this ticked because even though I am able to transfer the update images and boot them, I am unable to confirm them. After the transfer is finished and the target has restarted and booted up, nRF Connect Device Manager tries to confirm the image and returns "Device returned error: In Value (3)". This also happens when I try to confirm manually through the "Advanced" interface.

    To eliminate any firmware related issues, could you try to run the function "ret = boot_write_img_confirmed();" in the init of your updated project?

    This will manually verify a "test" firmware, and swap it as a permanent image.

     

    Kind regards,

    Håkon

  • The second issue seems to have been resolved also after a pristine rebuild of the project directory. Perhaps the application update image had the wrong layout. Thank you.

Related