52840 SDK 14.2.0 DFU compile error

Compiling nrf_dfu_ble.c I get several errors:

unknown type name 'nrf_dfu_observer_t'

'ble_dfu_transport_init' undeclared here (not in a function); did you mean 'nrf_dfu_transports_init'?

'NRF_DFU_BLE_MIN_CONN_INTERVAL' undeclared here (not in a function); did you mean 'NRF_DFU_BLE_ADV_INTERVAL'?

'nrf_dfu_op_t' undeclared (first use in this function); did you mean 'nrf_dfu_res_t'?

I searched the codebase and found no define for nrf_dfu_observer_t.

  • Hello,

    Could please provide some more background on what you are trying to achieve? The reason for the build errors here are missing dependencies in your project, but these dependencies are already included in our BLE bootloader example projects.

    Dependencies that are missing based on the errors you got:

    - include path to nrf_dfu_types.h

    - include path to nrf_dfu_req_handler.h

    - NRF_DFU_BLE_MIN_CONN_INTERVAL symbol not defined in sdk_config.h

    Also, please note that SDK 14.2.0 only had experimental support for the 52840. The 2 main limitations in this release is that Bluetooth is not qualified, and that bootloader updates are not supported. You may refer to the compatibility matrix for the recommended SDK/SD combinations here: SDKs and SoftDevices  

    Best regards,

    Vidar

  • My mistake. SDK version is 17.1. The search path is old since the project is based on 14.2 sdk.

    I need to update this info.

    Thanks

  • Good to hear that you are on SDK 17. Were you able to resolve the build errors?

  • I resolved the build errors.

    Is it possible to support DFU boot without image signing?

    I would like to bypass signing for development until ready to deal with it.

  • You can disable the NRF_DFU_REQUIRE_SIGNED_APP_UPDATE flag in you sdk_config header if you want to allow unsigned updates of the application. Softdevice and bootloader updates will still need to be signed though. There is no configuration setting to disable this requirement.

    I don't feel that there is much of a practical difference between working with signed and non-signed updates. The difference is that you have to create a key pair and use it when you prepare the DFU package with nrfutil.

    Steps to generate signing keys from the Getting started with Nordic's Secure DFU bootloader, a step by step guide:

    Step A. Generate keys

    We need a pair of Public and Private Key to encrypt the signature and sign the DFU image using ECDSA_P256_SHA256.

    Nordic provides nRFutil tool to generate these keys. nRFutil.exe can be downloaded from github here, the user guide is here.

    Or acquired from python using pip3 install nrfutil. To check for update, call pip3 install nrfutil --upgrade (or use python -m pip install nrfutil)

    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
    

    After you have the public_key.c file we can move to the next step, build the bootloader.

Related