Seems i can not find where nrf_dfu_set_adv_name_init is defined? It seems not in SDK source files, neither can find any sign on SDK documents.
Thank you.
Seems i can not find where nrf_dfu_set_adv_name_init is defined? It seems not in SDK source files, neither can find any sign on SDK documents.
Thank you.
Hi Rolandash,
nrf_dfu_set_adv_name_init is defined by the Asynchronous supervisor function interface NRF_SVCI_ASYNC.
You can find this macro in ble_dfu_unbonded.c
NRF_SVCI_ASYNC_FUNC_DECLARE(NRF_DFU_SVCI_SET_ADV_NAME, nrf_dfu_set_adv_name, nrf_dfu_adv_name_t, nrf_dfu_set_adv_name_state_t);
"The async interface provides a method to call into a external application through the SVCI interface without relying on allocated or reserved memory inside the external application."
Basically it's the call from the buttonless application to the bootloader to write the advertising name that the application want the bootloader to advertise. You can find the call nrf_dfu_set_adv_name() in set_adv_name() inside ble_dfu_unbonded.c. This call will trigger nrf_dfu_set_adv_name_on_call() inside nrf_dfu_svci_handler.c in the bootloader.
Hi Rolandash,
nrf_dfu_set_adv_name_init is defined by the Asynchronous supervisor function interface NRF_SVCI_ASYNC.
You can find this macro in ble_dfu_unbonded.c
NRF_SVCI_ASYNC_FUNC_DECLARE(NRF_DFU_SVCI_SET_ADV_NAME, nrf_dfu_set_adv_name, nrf_dfu_adv_name_t, nrf_dfu_set_adv_name_state_t);
"The async interface provides a method to call into a external application through the SVCI interface without relying on allocated or reserved memory inside the external application."
Basically it's the call from the buttonless application to the bootloader to write the advertising name that the application want the bootloader to advertise. You can find the call nrf_dfu_set_adv_name() in set_adv_name() inside ble_dfu_unbonded.c. This call will trigger nrf_dfu_set_adv_name_on_call() inside nrf_dfu_svci_handler.c in the bootloader.
Thanks for the reply.
I am still not fully understand. what is defined in NRF_SVCI_ASYNC_FUNC_DECLARE macro is nrf_dfu_set_adv_name(), but it seems not identical to nrf_dfu_set_adv_name_init(); Am i misunderstood something?
Sorry Hung Bui, i checked the macro and I got the point. Thank you.
I did not find more document about asynchronous Supervisor function interface. What exactly 'asynchronous' means here? Does it imply that those function calls return without waiting for the execution results?
The "asynchronous" mean it relies on an asynchronous operation to complete. In our case, it's a system event. You can have a look at the documentation for Asynchronous Supervisior interface here.
For example in the adv name set, we wait for the NRF_EVT_FLASH_OPERATION_SUCCESS to finish the task. (nrf_dfu_set_adv_name_on_sys_evt)
thanks for pointing the direction. I will read into it. Will async SVC call interrupt RTT Log? I am adding DFU service into my app, and noticed the RTT logs in caller application seems like been lost or muted when SVC calls issued.