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

BLE Secure DFU Bootloader - Noob Doubts

Hello,

I have a working application on nrf52832, running sdk version 15.0 and SD132 version 6.0.0. Now I would like to add dfu functionality. I followed the instructions at https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.0.0%2Fble_sdk_app_dfu_bootloader.html.

Regarding this I have some questions and hoping someone can clarify these 

  1. I followed the instructions and compiled the standard bootloader project under nRF5_SDK_15.0.0/examples/dfu/secure_bootloader. The final hex file produced was of size 64Kb. My understanding was that as per the memory map, we have 24kb bootloader space in the region 0x0007 8000 to 0x0007 E000. Why is this hex bigger in size?

    ls -liah dfu/bootloader/pca10040_ble/armgcc/_build
    total 552K
    13869703 drwxrwxr-x 3 ankit ankit 4.0K Oct 10 19:57 .
    13869746 drwx------ 3 ankit ankit 4.0K Oct 10 19:57 ..
    13869747 drwxrwxr-x 2 ankit ankit 4.0K Oct 10 19:57 secure_dfu_bootloader
    13794307 -rwxrwxr-x 1 ankit ankit 256M Oct 10 19:57 secure_dfu_bootloader.bin
    13794294 -rw-rw-r-- 1 ankit ankit  66K Oct 10 19:57 secure_dfu_bootloader.hex
    13794295 -rw-rw-r-- 1 ankit ankit 3.2K Oct 10 19:57 secure_dfu_bootloader.in
    13794297 -rw-rw-r-- 1 ankit ankit  89K Oct 10 19:57 secure_dfu_bootloader.map
    13794298 -rwxrwxr-x 1 ankit ankit 434K Oct 10 19:57 secure_dfu_bootloader.out
    


  2. To generate the bootloader settings hex file, I need to specify application-version, bootloader-version & bl-settings-version. For what and how are these values used by the bootloader? Under my dfu process, I plan to only ever update the application fw. Never the SD or the bootloader itself.

  3. Within the bootloader itself, I want to be able to activate the dfu mode from software. To do this, I set the NRF_BL_DFU_ENTER_METHOD_BUTTONLESS define in sdk_config.h file under the bootloader project. Now to enter dfu mode I need to Enter DFU mode when the Boolean enter_buttonless_dfu in DFU settings is true. How do I do this?

  4. My understanding is that whenever the system boots up, the bootloader comes up and boots the application immediately, if present. If this is true, what is the define NRF_BL_DFU_INACTIVITY_TIMEOUT_MS for? Or is it that on boot bootloader comes up and waits for NRF_BL_DFU_INACTIVITY_TIMEOUT_MS before loading a valid application if present?

Thank you for the help.

Parents
  • Hi,

    1. The size of the hex file is much larger than the actual size of the binary data, as it is an ASCII encoded version of the binary data including addresses, checksums and other commands in addition to the data itself. See the Intel HEX Wikipedia article for more information on the format of hex files, and for examples.

    2. BL settings version is needed so that the bootloader knows the format of the settings page is correct. If it is different from what the bootloader expects then it will treat it as if it was empty.

    For the other settings in 2., and for 3. and 4., I refer to the answers provided by . I might add for 4. that the inactivity timeout is used regardless of how you enter DFU mode.

    Regards,
    Terje

Reply
  • Hi,

    1. The size of the hex file is much larger than the actual size of the binary data, as it is an ASCII encoded version of the binary data including addresses, checksums and other commands in addition to the data itself. See the Intel HEX Wikipedia article for more information on the format of hex files, and for examples.

    2. BL settings version is needed so that the bootloader knows the format of the settings page is correct. If it is different from what the bootloader expects then it will treat it as if it was empty.

    For the other settings in 2., and for 3. and 4., I refer to the answers provided by . I might add for 4. that the inactivity timeout is used regardless of how you enter DFU mode.

    Regards,
    Terje

Children
No Data
Related