This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NRF Connect app stuck on "VALIDATING" when performing DFU

Based on documentation included in http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/ug_nrf52.html#fota-upgrades I am attempting to get DFU working on the following setup:

-nRF52840

-nrfConnect/Zephyr

-MCUBoot

I am loading the 'app_update.bin' file onto my mobile phone. I am able to see the device and the SMP service. I click the 'DFU' icon and select the 'app_update.bin' file and then the DFU screen appears (with the transfer speed graph) and "Validating" shows below the graph. Nothing happens after this point.

I tried the NRF Toolbox's DFU button. I click the 'Select file' button and choose 'Application' and select the same 'app_update.bin' file. The app then asks for an init packet file and I click the 'NO' option. When starting the upload it gives the error "DFU Init packet required'.

I am confused about the need for an init packet. The documentation mentioned at the start of this ticket indicates that the 'app_update.bin' file can be used directly. Also, the definition of the init file indicates fields like softdevice version, etc, which are not applicable in my configuration (MCU Boot is the bootloader and I am using the MCUMgr for FOTA while the application is running).

Can you please help here?

Thanks,

Jon

Parents Reply Children
  • Another update: I traced the DFU process to the point where the first upload message is sent to the device from the NRF Connect app. The CBOR message includes the MCUBoot header. The message includes the CBOR payload as follows:

    {"data": h'3DB8F3960000000000020000344B0800000000000000', "len": 544203, "sha": h'034862', "off": 0}

    As you can see, the MCUBoot magic is correct (0x96f3b83d). However, this data is rejected in the function img_mgmt_impl_upload_inspect() in 'modules/lib/mcumgr/cmd/img_mgmt/port/zephyr/src/zephyr_img_mgmt.c' of the NRFConnect SDK because the header sent by the app only contains 22 bytes of data, whereas the MCUBoot header is defined as 32 bytes in length. The line which checks this is:

        if (req->off == 0) {
            /* First upload chunk. */
            if (req->data_len < sizeof(struct image_header)) {
                /*
                 * Image header is the first thing in the image.
                 */
                *errstr = img_mgmt_err_str_hdr_malformed;
                return MGMT_ERR_EINVAL;
            }
    

  • Yet another update:

    I added the following configs and was able to get a DFU to work from the NRF Connect app (note that I am still unsuccessful from the NRF Toolbox app, as I still get the same 'DFU Init packet required' error):

    CONFIG_BT_RX_BUF_LEN=86
    CONFIG_BT_L2CAP_RX_MTU=75
    CONFIG_BT_L2CAP_TX_MTU=75
    CONFIG_MCUMGR_SMP_BT_AUTHEN=n

    With said configuration, I see a throughput of about 0.5KB/sec from my Android phone.

    Then I made the following changes to increase MTU:

    CONFIG_BT_RX_BUF_LEN=258
    CONFIG_BT_L2CAP_RX_MTU=247
    CONFIG_BT_L2CAP_TX_MTU=247
    CONFIG_BT_CTLR_TX_BUFFER_SIZE=251
    CONFIG_BT_CTLR_DATA_LENGTH_MAX=251

    With this configuration, I see an average throughput of about 2.3KB/sec. I tried further increasing the MTU to 517 as follows:

    CONFIG_BT_RX_BUF_LEN=528
    CONFIG_BT_L2CAP_RX_MTU=517
    CONFIG_BT_L2CAP_TX_MTU=517

    ...but with this configuration I get an assert:"ASSERTION FAIL [net_buf_simple_tailroom(buf) >= len] @ WEST_TOPDIR/zephyr/subsys/net/buf.c:793"

    Can you provide information on the ideal configuration to maximize throughput on DFU from IOS and Android (I realize that some issues cannot be controlled since they are handled by the mobile OS).

    Thanks!

    Jon

  • Sorry for the delay on this, I'll look into this the next week

    Best regards,

    Simon

  •  Jon: It seems like your initial issue is solved: performing BLE DFU on the nRF52840 using the mcumgr protocol. Right?

    Could you open a new ticket about "maximize throughput on DFU from IOS and Android". This way we can keep the forum more organized and easier to navigate for other developers. By the way, I recommend you to check out the nRF Connect Device Manager App, which is made for your usecase; updating and managing devices running nRF Connect SDK (using the mcumgr protocol).

    Mike Hibbett: Your case will be assigned to a Nordic engineer today, which will take a look at you issue.

    Best regards,

    Simon

Related