Hi,
I would like to use external app firmware to update over BLE a secondary microncontroler behind a NRF52832. I read that it's an experimental feature but it's very intersting because this avoids to implement an other mecanism in mobile application to update the other MCU.
I already developped the DFU over BLE for application, bootloader and soft device. I now try to make work the external app update.
SDK 17.0.2, SoftDevice s112
The process I imagine :
- Run the NRF52 in DFU mode
- Upload the external firmware (in Bank 1 to preserve app in Bank 0)
- Once done, run boot the secondary MCU by driving GPIO (nReset/Boot)
- Send the firmware over UART
- Restart in normal mode
I already created a zip package using nrfutil : nrfutil pkg generate --hw-version 52 --application-version-string 1.0.0 --application XYZ_Project.hex --external-app --key-file private.key XYZ_Project.zip
where XYZ_Project.hex is a STM32 hex file.
I succeed in downloading the zip file in the NRF52 and I check the internal memory of the MCU. Everythong looks good in Bank 1 ;)
Now, I want to push the Bank 1 data to the other MCU. Searhing the code, I saw I have to implement this method :
nrf_dfu_result_t nrf_dfu_validation_post_external_app_execute(dfu_init_command_t const * p_init, bool is_trusted)
However, it's never called; I ran the code in debbuger mode and saw this code section in postvalidate function nrf_dfu_validation.c but don't really understand how it works :
#if NRF_DFU_SUPPORTS_EXTERNAL_APP else if (p_init->type == DFU_FW_TYPE_EXTERNAL_APPLICATION) { if (!is_trusted) { // This function must be implemented externally ret_val = nrf_dfu_validation_post_external_app_execute(p_init, is_trusted); } else { s_dfu_settings.bank_1.bank_code = NRF_DFU_BANK_VALID_EXT_APP; } } #endif // NRF_DFU_SUPPORTS_EXTERNAL_APP
The method nrf_dfu_validation_post_external_app_execute is never executed (in debugger mode, I put a breakpoint on the function).
Help is welcome