I have a problem with upgrading bootloader on NRF52832 IC. We are in the middle of porting our own bootloader from SDK 8.1 to SDK 14, because we had to change BLE modules in our products. The application transfers the image into internal flash and signals the bootloader to start the upgrade. We have verified that bootloader image gets transfered and stored succesfully. After transfer the device resets, sets the flags for dfu functions, resets again and then goes into nrf_dfu_bl_continue() function, which compares the BL images and returns missmatch. So far, so good.
Then the program goes ahead and calls nrf_dfu_mbr_copy_bl() function, which calls sd_mbr_command() with SD_MBR_COMMAND_COPY_BL parameter. After that, device resets again, as it should, but BL doesn't get copied at all. If I manually compare the FWs in BANK_1 and actual installed bootloader, they don't match, so the copy didn't happen. Is there something I am missing?
Also, after an unsuccesfull copying, device starts to behave strange, it sometimes doesn't start, other times it starts but goes back into nrf_dfu_mbr_copy_bl() function, because FWs still don't match. Any hints will be apreciated.