Hi,
We are developing a product with an nRF528322 that should be able to perform a DFU on an external microcontroller by receiving the firmware over BLE and then sending it to the external microcontroller over UART.
We do this by letting the nRF bootloader receive the firmware and place it in the DFU bank and the boot our firmware. In our firmware we send the firmware over UART and then invalidate the DFU bank.
Invalidating the firmware works when we have a debugger connected and logging (even if no log function is called) but when it is disconnected the firmware crashes. The crash occurs after the
call to return (p_fs->p_api)->erase(p_fs, page_addr, len, p_context); from the function nrf_fstorage_erase
The crash location have been deduced by turning of and on some LEDS and see when a LED action does not occur. It also seems the erase function is called twice and it is during the second time it crashes.
How we invalidate the DFU bank:
https://pastebin.com/swb1VtRU
Best Regards,
Andreas