This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
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

Bootloader only update with DFU

I have added the DFU service to our own project. Normal application updates work perfectly and even the update of bootloader and softdevice is fine.

In a new case we had to update the bootloader only. The resulting behavior is a bit odd:

  1. The App downloads the new bootloader (hex-file)
  2. After the new bootloader has been downloaded the device resets to application
  3. This seams to be ok, but when checking the flash the bootloader didn't get updated
  4. After a power cycle the device enters bootmode (Why?)
  5. I download the application to the device and the device reboots to application again
  6. Now the bootloader is updated??? What happens here?

How is the update of only the bootloader working? What should happen after download of the bootloader hex-file?

Regards Adrian

Parents
  • Thank you for the links. The guide "how to debug bootloader" will be helpfull.

    The description in the Softdevice Specification sounds good to me, but my behavior when updating only the bootloader is different. The bootloader reboots to application after the update of the bootloader (bootloader.hex). After a power-cycle the bootloader won't start the application ind remains in the bootloader. Only an update of the application seams to complete the update.

    I investigated this issue with the guide for debugging the bootloader and found a misbehaviour of the SDK code when updating the bootloader only.

    Setup used:

    • SDK 6.1
    • S110 7.0
    • Bootloader (nrf51822\Board\nrf6310\device_firmware_updates\bootloader\arm) -> modified for debugging (devzone.nordicsemi.com/.../)
    • Application (nrf51822\Board\pca10001\s110\ble_app_hrs\arm)

    Steps to reproduce the failure:

    • Program the softdevice, the bootloader and the application
    • Download the ble_app_hrs.hex as application with the nRF51 Toolbox
    • Restart the device with pressed button to enter DFU mode in bootloader
    • Download a new bootloader.hex as bootloader with the nRF51 Toolbox
    • When the bootloader leaves the function "bootloader_dfu_start" the bootloader settings are set to -> Bank0: BANK_VALID_APP / Bank1: BANK_VALID_BOOT
    • The following check "bootloader_app_is_valid" returns true because Bank0 is BANK_VALID_APP and the application gets started
    • After a later reboot the settings are still set to -> Bank0: BANK_VALID_APP / Bank1: BANK_VALID_BOOT
    • The test "bootloader_dfu_sd_in_progress" returns true because Bank1 is BANK_VALID_BOOT
    • In the function "bootloader_dfu_sd_update_finalize" both banks are set to BANK_INVALID_APP
    • The bootloader now remians in bootmode because the valid app has been invalidated
Reply
  • Thank you for the links. The guide "how to debug bootloader" will be helpfull.

    The description in the Softdevice Specification sounds good to me, but my behavior when updating only the bootloader is different. The bootloader reboots to application after the update of the bootloader (bootloader.hex). After a power-cycle the bootloader won't start the application ind remains in the bootloader. Only an update of the application seams to complete the update.

    I investigated this issue with the guide for debugging the bootloader and found a misbehaviour of the SDK code when updating the bootloader only.

    Setup used:

    • SDK 6.1
    • S110 7.0
    • Bootloader (nrf51822\Board\nrf6310\device_firmware_updates\bootloader\arm) -> modified for debugging (devzone.nordicsemi.com/.../)
    • Application (nrf51822\Board\pca10001\s110\ble_app_hrs\arm)

    Steps to reproduce the failure:

    • Program the softdevice, the bootloader and the application
    • Download the ble_app_hrs.hex as application with the nRF51 Toolbox
    • Restart the device with pressed button to enter DFU mode in bootloader
    • Download a new bootloader.hex as bootloader with the nRF51 Toolbox
    • When the bootloader leaves the function "bootloader_dfu_start" the bootloader settings are set to -> Bank0: BANK_VALID_APP / Bank1: BANK_VALID_BOOT
    • The following check "bootloader_app_is_valid" returns true because Bank0 is BANK_VALID_APP and the application gets started
    • After a later reboot the settings are still set to -> Bank0: BANK_VALID_APP / Bank1: BANK_VALID_BOOT
    • The test "bootloader_dfu_sd_in_progress" returns true because Bank1 is BANK_VALID_BOOT
    • In the function "bootloader_dfu_sd_update_finalize" both banks are set to BANK_INVALID_APP
    • The bootloader now remians in bootmode because the valid app has been invalidated
Children
No Data
Related