Hello,
I'm currently experimenting with the dual-bank bootloader in SDK 13.1. According to the documentation, if the new application can be activated, it is copied from bank 1 to bank 0.
Where and when does this happen? I haven't been able to find the code that copies the image from one bank to the other.
There is this code in nrf_dfu_postvalidate()
in dfu_req_handling.c
that basically sets the application in the current bank to valid before starting the "copy routine", but I don't see any copy routine being called after this:
case DFU_FW_TYPE_APPLICATION:
p_bank->bank_code = NRF_DFU_BANK_VALID_APP;
// If this update is in bank 1, invalidate bank 0 before starting copy routine.
if (s_dfu_settings.bank_current == NRF_DFU_CURRENT_BANK_1)
{
NRF_LOG_INFO("- Invalidating old application in bank 0.\r\n");
s_dfu_settings.bank_0.bank_code = NRF_DFU_BANK_INVALID;
}
The way I see it, if the application was stored in bank 1, the bootloader just says that the application in bank 1 is valid and the one in bank 0 isn't. I think I'm missing something but I can't put my finger on it.
Any ideas?