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

DFU application doesn't seems to be updated

Hi,

I am currently trying to perform DFU update over BLE, I am working on SDK v11.0, and Softdevice S130 v2.0.0. My traget is an nRF51822-QFACA1.

When I enter in bootloader mode, everything works fine until I am trying to upload trhough BLE an Init packet from my smartphone with the nRF Toolbox app.

When an app is already flashed on the device, bootloader_app_is_valid returns 0, then it enters in bootloader_dfu_start() and waits for events. When I launch the upload of the new firmware, the device goes back directly to bootloader_app_is_valid (bootloader_dfu_start doesn't seems to return according to the RTT trace), then do a system reset, and the bootloader restarts.

When I have an app flashed and I use the following command : nrfjprog --family nrf51 --memwr 0x3fc00 --val 1, I have to force the device to go in DFU with a button, which is normal. Then in DFU mode, the bootloader_app_valid function goes in the following condition : "(p_bootloader_settings->bank_0 == BANK_VALID_APP)", which is ok and the CRC variables are the following : 'image_crc = 0, bank_0_crc = 0', then the bootloader_dfu_start function begins and waits for events. Then when I try to update the firmware, the program goes back to bootloader_app_is_valid function, which does the same than the first time, and then the bootloader starts the old version of the app.

When I have no app already flashed, a reset is done and the bootloader restarts. I noticed in this case that in the bootloader_app_is_valid function, the "(*((uint32_t *)app_addr) == EMPTY_FLASH_MASK)" condition is true, so the function returns false, and the device reset directly after that.

From know I didn't see any errors, could you please help me to understand what to do to solve this problem ?

Best regards,

Guillaume

  • Hi Guillaume,

    Could you clarify, if you don't have any app flashed, can you do a DFU update ? Or the device simply restart and you can't do any update ? Could you describe clearly what happens, would the device advertise as DFUTarg ?

    Note that you can uncheck the optimization level and debug the bootloader to figure out why it restart/crash. You may need to follow this instruction on how to debug.

    My suggestion is to try to test with the default, unmodified example. Also please describe how you generate the .zip file for DFU ? Have you tried to use a default .zip provided with the nRFToolbox ?

  • Hi, I am sorry if I didn't clarify enough, if I don't have any app flashed, I can't do a DFU update. It just restart in DFU mode without loading any app, and advertise as DFUTarg. I will look into the debug of the bootloader and maybe try an unmodified example. About the init packet, I am using nrfutil with the following command line :

    nrfutil pkg generate --application app_helio_v2-00.bin --hw-version 2 --application-version 0x00000002 --sd-req 0x80 --key-file key.pem pckg_app_v2-00.zip
    
  • Hi,

    Seems that you are using the create image command for the DFU bootloader in SDK v12 and later. For SDK v11, you should follow this instruction. You should use the nrfutil.exe located at C:\Program Files (x86)\Nordic Semiconductor\Master Control Panel<version>\nrf\

    The command should look like this:

    nrfutil.exe dfu genpkg app.zip --application yourapplication.hex --application-version 0xffff --dev-revision 0xffff --dev-type 0xffff --sd-req 0xfffe
    

    You can try to test using our provided .zip sample file in \examples\dfu\ble_dfu_send_hex

  • Hi, I have Master Control Panel v.3.6.0.8331, and unfortunately I don't have any nrf folder in it. Do you know where can I get the good version of nrfutil ?

  • Finally I have downloaded Master Control Panel v 3.10.0.14 which contains nrfutil 0.3.0. I used the command line that you mentioned and downloaded the zip file with nRFToolbox on a target containing only the softdevice and the bootloader, but it still doesn't work, and I have (*((uint32_t *)app_addr) == EMPTY_FLASH_MASK) again. I also tried sending dfu_test_app_hrm_s130.zip, which is already in the SDK, but the same thing happens...

Related