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

adding DFU to Mesh Network

Hello!

I'm trying to develop a mesh network and I've been building on top of sensor example, which has been very useful since I'm reading a few sensors. However I want to integrate DFU into it. I've loaded the pre-compiled bootloader and device-page (created using python script and following documentation). Now I'm trying to integrate DFU model or service or whatever name it receives into my application. Basically, I'm copying stuff from lpn example (that looks like it already has dfu integrated).
I'm getting this error now and I can't figure out what is wrong. I've found a few tickets here in devzone and whatever they say to try, I've tried. I've added stuff to preprocessor definition and changed DFU_ENABLE on sdk_config.h, all unsuccessful.



Building 'sensor_client_nrf52840_xxAA_s140_7.2.0' from solution 'sensor_client_nrf52840_xxAA_s140_7.2.0' in configuration 'Debug'
  Compiling 'main.c'
  Compiling 'app_sensor_utils.c'
  Compiling 'mesh_provisionee.c'
  Compiling 'rtt_input.c'
  Compiling 'simple_hal.c'
  Compiling 'mesh_app_utils.c'
  Compiling 'mesh_adv.c'
  Compiling 'ble_softdevice_support.c'
  Compiling 'nrf_mesh_weak.c'
  Compiling 'app_error_weak.c'
  Compiling 'assertion_handler_weak.c'
  Compiling 'ble_dfu_support.c'
  Compiling 'internal_event.c'
  Compiling 'nrf_mesh_configure.c'
  Compiling 'aes.c'
  Compiling 'msg_cache.c'
  Compiling 'transport.c'
  Compiling 'event.c'
  Compiling 'packet_buffer.c'
  Compiling 'flash_manager_defrag.c'
  Compiling 'fifo.c'
  Compiling 'nrf_flash.c'
  Compiling 'net_state.c'
  Compiling 'mesh_flash.c'
  Compiling 'nrf_mesh_utils.c'
  Compiling 'nrf_mesh.c'
  Compiling 'queue.c'
  Compiling 'hal.c'
  Compiling 'aes_cmac.c'
  Compiling 'timer_scheduler.c'
  Compiling 'timer.c'
  Compiling 'long_timer.c'
  Compiling 'rand.c'
  Compiling 'nrf_mesh_opt.c'
  Compiling 'mesh_opt.c'
  Compiling 'timeslot.c'
  Compiling 'timeslot_timer.c'
  Compiling 'bearer_event.c'
  Compiling 'enc.c'
  Compiling 'network.c'
  Compiling 'net_packet.c'
  Compiling 'msqueue.c'
  Compiling 'nrf_mesh_keygen.c'
  Compiling 'cache.c'
  Compiling 'list.c'
  Compiling 'log.c'
  Compiling 'flash_manager.c'
  Compiling 'ccm_soft.c'
  Compiling 'toolchain.c'
  Compiling 'replay_cache.c'
  Compiling 'beacon.c'
  Compiling 'flash_manager_internal.c'
  Compiling 'core_tx.c'
  Compiling 'heartbeat.c'
  Compiling 'net_beacon.c'
  Compiling 'mesh_config.c'
  Compiling 'fsm.c'
  Compiling 'mesh_config_backend.c'
  Compiling 'mesh_config_flashman_glue.c'
  Compiling 'lpn.c'
  Compiling 'core_tx_lpn.c'
  Compiling 'mesh_lpn_subman.c'
  Compiling 'core_tx_local.c'
  Compiling 'emergency_cache.c'
  Compiling 'core_tx_adv.c'
  Compiling 'mesh_mem_stdlib.c'
  Compiling 'mesh_stack.c'
  Compiling 'mesh_gatt.c'
  Compiling 'proxy.c'
  Compiling 'proxy_filter.c'
  Assembling 'thumb_crt0.s'
  Compiling 'access_publish.c'
  Compiling 'access_publish_retransmission.c'
  Compiling 'access.c'
  Compiling 'access_reliable.c'
  Compiling 'device_state_manager.c'
  Compiling 'ad_listener.c'
  Compiling 'ad_type_filter.c'
  Compiling 'adv_packet_filter.c'
  Compiling 'advertiser.c'
  Compiling 'bearer_handler.c'
  Compiling 'broadcast.c'
  Compiling 'filter_engine.c'
  Compiling 'gap_address_filter.c'
  Compiling 'radio_config.c'
  Compiling 'rssi_filter.c'
  Compiling 'scanner.c'
  Compiling 'mesh_pa_lna.c'
  Compiling 'SEGGER_RTT.c'
  Compiling 'SEGGER_RTT_printf.c'
  Compiling 'uECC.c'
  Compiling 'nrfx_gpiote.c'
  Compiling 'app_util_platform.c'
  Compiling 'ble_advdata.c'
  Compiling 'nrf_sdh_soc.c'
  Compiling 'nrf_sdh_ble.c'
  Compiling 'nrf_sdh.c'
  Compiling 'ble_conn_params.c'
  Compiling 'nrf_atomic.c'
  Compiling 'ble_srv_common.c'
  Compiling 'system_nrf52840.c'
  Compiling 'app_error.c'
  Compiling 'app_error_handler_gcc.c'
  Assembling 'ses_startup_nrf52840.s'
  Assembling 'ses_startup_nrf_common.s'
  Compiling 'nrf_section_iter.c'
  Compiling 'nrfx_uart.c'
  Compiling 'nrfx_uarte.c'
  Compiling 'nrf_drv_uart.c'
  Compiling 'app_fifo.c'
  Compiling 'app_uart.c'
  Compiling 'nrf_pwr_mgmt.c'
  Compiling 'ble_advertising.c'
  Compiling 'ble_dfu.c'
  Compiling 'peer_database.c'
  Compiling 'peer_data_storage.c'
  Compiling 'peer_id.c'
  Compiling 'peer_manager.c'
  Compiling 'pm_buffer.c'
  Compiling 'ble_conn_state.c'
  Compiling 'nrf_atflags.c'
  Compiling 'ble_dfu_unbonded.c'
    ble_dfu_unbonded.c
    unknown type name ‘nrf_dfu_set_adv_name_svci_async_t’
    in definition of macro ‘SVCI_DECL’
    in expansion of macro ‘SVCI_1’
    in expansion of macro ‘SVCI_IMPLI’
    in expansion of macro ‘SVCI_IMPL’
    in expansion of macro ‘SVCI’
    in expansion of macro ‘NRF_SVCI_ASYNC_FUNC_DEFINE’
    unknown type name ‘nrf_dfu_set_adv_name_svci_async_t’
    in definition of macro ‘SVCI_1’
    in expansion of macro ‘SVCI_IMPLI’
    in expansion of macro ‘SVCI_IMPL’
    in expansion of macro ‘SVCI’
    in expansion of macro ‘NRF_SVCI_ASYNC_FUNC_DEFINE’
    ble_dfu_unbonded.c
    unknown type name ‘nrf_dfu_set_adv_name_svci_async_t’
    in definition of macro ‘NRF_SVCI_ASYNC_FUNC_DEFINE’
    In function ?nrf_dfu_set_adv_name_init?:
    implicit declaration of function ‘nrf_dfu_set_adv_name_svci_async_init’; did you mean ‘nrf_dfu_set_adv_name_init’? [-Wimplicit-function-declaration]
    in definition of macro ‘NRF_SVCI_ASYNC_FUNC_DEFINE’
    In function ?nrf_dfu_set_adv_name?:
    request for member ‘async_func’ in something not a structure or union
    in expansion of macro ‘NRF_SVCI_ASYNC_FUNC_DEFINE’
    request for member ‘state’ in something not a structure or union
    in expansion of macro ‘NRF_SVCI_ASYNC_FUNC_DEFINE’
    In function ?nrf_dfu_set_adv_name_on_sys_evt?:
    request for member ‘sys_evt_handler’ in something not a structure or union
    in expansion of macro ‘NRF_SVCI_ASYNC_FUNC_DEFINE’
    request for member ‘state’ in something not a structure or union
    in expansion of macro ‘NRF_SVCI_ASYNC_FUNC_DEFINE’
    In function ?nrf_dfu_set_adv_name_is_initialized?:
    request for member ‘async_func’ in something not a structure or union
    in expansion of macro ‘NRF_SVCI_ASYNC_FUNC_DEFINE’
    request for member ‘sys_evt_handler’ in something not a structure or union
    in expansion of macro ‘NRF_SVCI_ASYNC_FUNC_DEFINE’
    In function ?ble_dfu_buttonless_on_ctrl_pt_write?:
    ‘nrf_dfu_adv_name_t’ has no member named ‘name’
    ‘nrf_dfu_adv_name_t’ has no member named ‘len’
  Compiling 'ble_dfu_bonded.c'
  Compiling 'prov_provisionee.c'
Build failed


Thank you,

  • Hi,

    Can you provide more details regarding your setup? More info about your use-case would also be useful.

    Which mesh SDK version are you using? What device are you using and is it a custom board or DK?

    Note that DFU in LPN example is DFU over BLE, so each device will be updated individually and not in the background. You can read more about the difference between DFU over BLE and mesh DFU here

  • Hi,

    We are using

    - nrf mesh sdk 5.0.0

    - nrf SDK 17.0.2

    I had read the infocenter information about the difference between BLE DFU and Mesh DFU. I found out about DFU on lpn being a BLE DFU the same day I posted the question.
    We are using a few different boards to test and develop. We have Waveshare dev kit, nRF52840 DK, nRF52840 dongle.
    we started the project using sensors example as base, but we will need to find a way to reduce power consumption. I understand why lpn uses BLE DFU, but this won't work for this project.

    For now we would like to use mesh DFU running in background. I've seen the DFU example, but I don't know how to merge DFU into another example or project. Do you have a tutorial, or guidance to what should I read / study to learn and figure out how to do it?

    Anyway, I was in half way trying to "copy" the idea of DFU from lpn and it is giving me that error.

    Thank you

  • Hi,

    Unfortunatetly, we don't have any tutorials that show you how to do this. The documentation I recommend you to read through is:

    Proprietary mesh DFU protocol

    Configuring and performing DFU over Mesh

    DFU example

    I think the DFU example will be the most helpful since it illustrates how to create an application that can be updated over Bluetooth mesh using background mode DFU. You will have to try and copy the DFU unctionality available in the DFU example over to your sensor example.

Related