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

Buttonless DFU example code from SDK 15.3.0, once flashed into the board is not displaying Nordic_Buttonless in the nrf_connect application on my phone.

Hello,

  My current setup is:

Nrf 52832 custom board (pca10040)
SDK 15.3.0
SES 4.52
Soft Device s132
Using a j-link mini EDU debugger

I've tested out the secure bootloader for OTA DFU and it works perfectly but once I run the buttonless DFU application on the board, the board does not advertise as Nordic_DFU to find and update the firmware. I used the NRF programmer in the NRF Connect PC application to program the board. As per the procedure, I generated a bootloader settings page as per the application and merged the secure bootloader hex file, bootloader settings hex file, and the application hex files and flashed it onto the board with the softdevice but I do not see the advertising. I've made the bsp board led glow blue if it is advertising in the bootloader. 

Where could I be going wrong?

Parents Reply Children
  • Hey,

    Yes, similar. I merged the secure_bootloader and the bootloader settings hex using mergehex before dumping the code onto the board. It does not display Nordic_buttonless in nrf connect. the buttonless dfu example code gets complied but doesn't run. 

  • Hi,

    Is it only on your custom board you have this issue, or do you see the issue on the nRF52832 DK as well?

    It works fine when I test this on a nRF52832 DK. Here is the steps I did when testing:

    Keys:

    A1. Generate your own private key. Type this command line:

    nrfutil.exe keys generate private.key

    private.key file will be generated. You will keep this key secret

    A2. Generate your public key based on your private key.

    nrfutil keys display --key pk --format code private.key --out_file public_key.c

    For simplicity, I just replace the key in dfu_public_key.c, with the one in my public_key.c file

    -------

    Step 1) Compile application ble_app_buttonless_dfu.hex using SES IDE.
    Using the ble_app_buttonless_dfu_pca10040_s132 SES project, the file ble_app_buttonless_dfu_pca10040_s132.hex is created by SES in the Output/Release/Exe folder.

    Step 2) Generate the settings.hex file:

    nrfutil settings generate --family NRF52 --application ble_app_buttonless_dfu_pca10040_s132.hex --application-version 0 --bootloader-version 0 --bl-settings-version 2 settings.hex

    The file settings.hex is created.

    Step 3) Compile the bootloader. I'm using the bootloader project in the folder dfu\secure_bootloader\pca10040_ble

    The file secure_bootloader_ble_s132_pca10040.hex is created.

    Step 4) Merge all together.

    Bootloader and settings:
    mergehex -m secure_bootloader_ble_s132_pca10040.hex settings.hex -o bootloader_settings.hex

    Softdevice and application:

    mergehex -m s132_nrf52_6.1.1_softdevice.hex ble_app_buttonless_dfu_pca10040_s132.hex -o sd_app.hex

    All hex files together:

    mergehex -m sd_app.hex bootloader_settings.hex -o sd_app_bootloader_settings.hex


    Note: From nrfjprog v10.10.0, you can use mergehex to merge these files in one operation.

    Step 5) Flash the hex file
    Make sure the chip is erased first:
    nrfjprog -e
    Flash and reset:
    nrfjprog --program sd_app_bootloader_settings.hex --reset

    You should now see the device advertise as Nordic_Buttonless

    Then you can use e.g. this command to generate a DFU package with a new application

    nrfutil pkg generate --hw-version 52 --application my_new_app.hex --application-version 1 --sd-req 0xB7 --key-file private.key my_dfu_pkg.zip

    Note: If you don't have a LF crystal on your custom board, make sure you set these configs in both the application and bootloader sdk_config.h files:
    NRF_SDH_CLOCK_LF_SRC 0
    NRF_SDH_CLOCK_LF_RC_CTIV 16
    NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 2
    NRF_SDH_CLOCK_LF_ACCURACY 1

  • Hey,

    It works now.

    I changed sdk_config.h as per your note guidelines and then followed the steps as you mentioned above. I programmed the board with the secure bootloader file and the board started to display the Nordic_Buttonless_DFU in the NRF toolbox application.

    Thank you!!

Related