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

undefined to find dfu_targ after enable NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS

Hi,

HW:PCA10056

SW: nRF5_SDK_15.2.0_9412b96

EXAMPLE: nRF5_SDK_15.2.0_9412b96\examples\ble_peripheral\ble_app_buttonless_dfu\pca10056\s140\

Step:

1) enable NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS in sdk_config.h

2) prepare the setup as following step:

i) prepare dfu package

- Generate a private key by running this command in cmd in your SDK 15 folder:
nrfutil keys generate priv.pem

- Generate a public key file from that private key by running this command in cmd in your SDK 15 folder:
nrfutil keys display --key pk --format code private.pem --out_file dfu_public_key.c

- copy dfu_public_key.c into \nRF5_SDK_15.2.0_9412b96\examples\dfu to replace the dummy dfu_public_key.c

-  Compile \dfu\secure_bootloader\pca10056_ble\ses example and copy the output secure_bootloader_ble_s140_pca10056.hex to the nrfutil folder

- Generate a bootloader settings page in nrfutil folder:
nrfutil settings generate --family NRF52840 --application ble_app_buttonless_dfu_pca10056_s140.hex --application-version 1 --bootloader-version 1 --bl-settings-version 1 settings.hex

- Generate merged bootloader hex
mergehex.exe --merge settings.hex secure_bootloader_ble_s140_pca10056.hex --output my_bootloader.hex

-  Generate DFU package
nrfutil pkg generate --hw-version 52 --application-version 1 --application ble_app_buttonless_dfu_pca10056_s140.hex --softdevice s140_nrf52_6.1.0_softdevice.hex --bootloader my_bootloader.hex --bootloader-version 1 --sd-req 0xAE --sd-id 0xAE --key-file private.pem mwds_app_dfu_package.zip

ii) Program the dfu application

nrfjprog.exe -e
nrfjprog.exe --family NRF52 --program s140_nrf52_6.1.0_softdevice.hex --verify
nrfjprog.exe --family NRF52 --program ble_app_buttonless_dfu_pca10056_s140.hex --verify –r
nrfjprog.exe --program my_bootloader.hex --verify –r
nrfjprog.exe --reset

DFU_targ nor buttonless dfu advertising not founded.

  • Hello,

    I believe I went through the same steps as you did, and saw that the device wasn't advertising. The fact that the two LEDs on the nRF DK didn't turn on (and the fact that it wasn't advertising) indicates that it isn't in DFU mode, so I started investigating the log of the application that I used, the ble_app_buttonless_dfu. It said:

    <info> app: Setting vector table to bootloader 0x000F8000
    <error> app: Fatal

    which indicates that it is the error handler that caught something. 

    Looking in the ble_dfu_buttonless_async_svci_init(), which is the function printing the line: "Setting vector table to bootloader 0x000F8000":

    uint32_t ble_dfu_buttonless_async_svci_init(void)
    {
        uint32_t ret_val;
    
        ret_val = nrf_dfu_svci_vector_table_set();
        VERIFY_SUCCESS(ret_val);
    
        ret_val = nrf_dfu_set_adv_name_init();
        VERIFY_SUCCESS(ret_val);
    
        ret_val = nrf_dfu_svci_vector_table_unset();
    
        return ret_val;
    }

    The first function, nrf_dfu_svxi_vector_table_set() prints the line that was printed, but nothing more (which it would have done if it returned an error.

    The last function, nrf_dfu_svci_vector_table_unset() didn't print anything, so it must have stopped before this.

    That leaves the middle function, which was indeed the function that returned ret_val != 0.

    I noticed that ble_dfu_buttonless_async_svci_init was pointing to a function inside ble_dfu_unbonded.c, and that there was a check near the top of the file:

    #if (!NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS)

    So I set NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS to 1 in sdk_config.h (of the ble_app_buttonless_dfu project), recompiled, created a new dfu image and bootloader settings hex-file. Then it worked.

    So try to change line 224 in sdk_config.h for the ble_app_buttonless_dfu project from

    #define NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS 0

    to

    #define NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS 1

    and see if that works.

    Best regards,

    Edvin

  • Do you have logging enabled in your project? That is, the application that you transfer over DFU, the ble_app_buttonless_dfu project. By default, it is enabled, and you can monitor it using RTT Viewer from Segger.

    Does it say anything after you program it?

    BR

    Edvin

Related