DFU target API integration

Hi,

I am trying to integrate DFU into my application. Below is what I need to do.

I receive OTA application image over BLE (I can not use legacy DFU feature as we are using our own encryption for all the data exchange over BLE) and I need to write the application image.

I try using dfu_target APIs to do the work and I see undefined reference error for all the dfu_target APIs.

Please let me know what I need to do to include dfu_target APIs into my application.

Thank you in advance.

Parents Reply
  • Well, you can include it manually using CMake:

    +++ b/samples/tfm/tfm_secure_peripheral/secure_peripheral_partition/CMakeLists.txt
    @@ -21,6 +21,7 @@ target_sources(tfm_app_rot_partition_spp
         PRIVATE
             secure_peripheral_partition.c
             util.c
    +        ${ZEPHYR_BASE}/../nrf/subsys/dfu/dfu_target/src/dfu_target.c
     )
     
     target_include_directories(tfm_app_rot_partition_spp
    @@ -29,6 +30,7 @@ target_include_directories(tfm_app_rot_partition_spp
             ${HAL_NORDIC_PATH}/nrfx
             ${HAL_NORDIC_PATH}/nrfx/mdk
             ${HAL_NORDIC_PATH}/nrfx/drivers/include
    +        ${ZEPHYR_BASE}/../nrf/include/dfu
     )
    

    However, all the dependencies of this file are not included, so it does not build.

    I do not think we have any "DEPENDENCY" for dfu_target in Secure yet.
    Therefore I think you have to manually use CMakeLists.txt to include dependencies here.

    Another alternative would be to add the .h and .c files from dfu_target to your project, and slim away other dependencies.

    Regards,
    Sigurd Hellesvik

Children
Related