How to do BLE DFU for nRF7002DK

Hello,

I am trying to implement BLE DFU with nRF7002DK and SDK 2.7.0(Sorry but not use sysbuild yet.)

https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-8-bootloaders-and-dfu-fota/

I tried to do BLE DFU with nRF7002DK referring to Lesson 8, but I cannot write to the external flash memory.
<err> mcumgr_img_grp: Failed to open flash area ID 1: -2

Also, the Device Manager app is giving me the error 'n must be >= 0'.

(Sorry, but I have no idea what the error means).

Of course, all jumpers from SB11 to SB14 are shorted.

I will attach the project so you can tell me what I am missing.

8484.ble_dfu_nrf7002.zip

I think I need to set the MTU, but haven't tried it yet. Because I don't think this error has anything to do with MTU.

Best Regards,

Yoshihiro Goto.

Parents
  • Hi, 

    Please refer to this smp_svr_nRF7002DK.7z project which includes configs and overlay files for nRF7002DK and NCS v2.7.1 without sysbuild. 

    Beware that this code/configuration is not fully tested or qualified and should be considered provided “as-is”. Please test it with your application and let me know if you find any issues.

    Regards,
    Amanda H.

  • Dear Amanda,

    Thank you for sending me your sample project.

    I no longer get the '<err> mcumgr_img_grp: Failed to open flash area ID 1: -2' error, but instead get '<err> mcumgr_img_grp: Image upload inspect failed: 9'.

    Also in the device manager app, I no longer get the 'n must be >= 0' error, but instead I get 'Hash not found(8)' or 'No free slot(9)' errors.

    The progress bar in the Device Manager app shows that it appears to be able to DFU, but the firmware has not been updated.

    I need a little more help.

  • Hi,

    The latest project files are attached. This project is to check if the network core is able to DFU by switching CONFIG_BT_EXT_ADV on and off.

    dfu_ble_nrf7002.zip
    Unfortunately, The problem has not yet been resolved. I have looked at various threads and also created mcuboot_secondary_1 (flash area for network core) on external flash. But it doesn't work.

    Best regards,
    Yoshihiro Goto

  • Hi, 

    Sorry for the late reply. I was working on your case and trying to find a solution. 

    CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU cannot enable DFU for nRF7002DK with SPI external flash, so nRF7002DK requires the SPI-relevant configs for app and mcuboot to use SPI external flash. To enable Simultaneous DFU for app and net core, it needs to enable these configs

    Your uploaded project also enables serial DFU configs. That makes the thing complex and hard to fix the issues, so I remove them and only make your project able to BLE DFU without issue. dfu_ble_nrf7002_modfied.7z

    You will see the error: "Failed to open flash area ID 1: -2". The error is that the mcumgr drivers try to open mcuboot_primary_1, which is in simulated RAM-flash. And this can not be opened as such. See my colleague's explanation in this post

    -Amanda H.

  • Sorry I haven't heard from you in a long time. I've been working on my main business and haven't had time to verify the sample project.
    I have verified that the network core is able to DFU in the sample project. First write the legacy advertise firmware to the evaluation board and then rewrite it to the extended advertise firmware with DFU. I confirmed that it was rewritten properly.
    There is one thing I am concerned about. I am getting some error messages in the log.

    [00:00:00.002,746] <inf> spi_nor: mx25r6435f@0: 8 MiBy flash
    *** Booting nRF Connect SDK v2.7.0-5cb85570ca43 ***
    *** Using Zephyr OS v3.6.99-100befc70c74 ***
    [00:00:00.043,701] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
    [00:00:00.043,731] <inf> bt_hci_core: HW Variant: nRF53x (0x0003)
    [00:00:00.043,762] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 214.51162 Build 1926957230
    [00:00:00.045,440] <inf> bt_hci_core: Identity: E9:92:C3:56:07:8F (random)
    [00:00:00.045,471] <inf> bt_hci_core: HCI: version 5.4 (0x0d) revision 0x21fb, manufacturer 0x0059
    [00:00:00.045,501] <inf> bt_hci_core: LMP: version 5.4 (0x0d) subver 0x21fb
    [00:00:00.045,501] <inf> main: Bluetooth controller has been initialized.
    [00:00:00.045,501] <inf> main: Start undirected advertising.
    build time: Dec  4 2024 17:35:33
    [00:02:20.760,345] <inf> mcuboot_util: Image index: 0, Swap type: none
    [00:02:20.760,833] <inf> mcuboot_util: Image index: 1, Swap type: none
    [00:02:20.760,864] <err> mcumgr_img_grp: Failed to open flash area ID 1: -2
    [00:02:21.784,637] <inf> mcuboot_util: Image index: 0, Swap type: none
    [00:02:24.048,187] <inf> mcumgr_img_grp: Erased 0x29000 bytes of image slot
    [00:02:24.148,681] <inf> mcumgr_img_grp: Erased 0x1000 bytes of image slot trailer
    [00:02:42.364,868] <inf> mcuboot_util: Image index: 1, Swap type: none
    [00:02:45.181,182] <inf> mcumgr_img_grp: Erased 0x2a000 bytes of image slot
    [00:02:45.281,677] <inf> mcumgr_img_grp: Erased 0x1000 bytes of image slot trailer
    [00:02:54.092,102] <err> mcumgr_img_grp: Failed to open flash area ID 1: -2
    [00:02:54.092,773] <inf> mcuboot_util: Image index: 1, Swap type: none
    [00:02:54.094,696] <inf> mcuboot_util: Image index: 0, Swap type: none
    [00:02:54.095,642] <inf> mcuboot_util: Image index: 1, Swap type: perm
    [00:02:54.095,672] <err> mcumgr_img_grp: Failed to open flash area ID 1: -2
    [00:02:55.727,355] <inf> mcuboot_util: Image index: 0, Swap type: none
    [00:02:55.729,339] <inf> mcuboot_util: Image index: 0, Swap type: perm
    [00:02:55.730,285] <inf> mcuboot_util: Image index: 1, Swap type: perm
    [00:02:55.730,316] <err> mcumgr_img_grp: Failed to open flash area ID 1: -2

    thanks for your kindness help.

    Best Regards,
    Yoshihiro Goto

  • I completely forgot, but I wrote in my first question that I get the same error.
    Is this a bug in the SDK?

Reply Children
Related