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

Parents
  • Hi Guillaume,

    From the log I can see that you are updating a pretty big application with the size of 75kB (in hexa: 0x0125c8). The DFU bootloader responded with 0x100104 telling that the size exceed the maximum size (packet 5264). You may need to consider using single bank DFU update instead of dual bank update. See the memory layout here.

    Simply replace dfu_dual_bank.c with dfu_single_bank.c and recompile the bootloader to make it work as single bank DFU.

  • Hi Guillaume,

    You can find the max size for dual bank by looking at DFU_IMAGE_MAX_SIZE_BANKED inside dfu_types.h. It's varied depends on your chip's flash size and the number of data page you reserved.

    Please have a look here. If you take Application code, free/swap, and application data and divide by 2 you have the rough number of the max size you can have.

Reply Children
No Data
Related