Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Update bootloader OTA with bigger size

Hi,

I work on a project quite advanced as our product is already in the hands of some of our clients.
My problem is that we would like to add some feature to our bootloader. The main feature is to add the possibility to use our LED driver from the bootloader.

For that our current FLASH section for bootloader is too small. So we need to update the bootloader.
First of all I learned that we could not update bootloader and app in the same package anymore if the softdevice is the not changed. I don't think it was the case in older SDK. I wonder why it is the case.

Now the main issue is that I don't know how to update my bootloader because the new bootloader is bigger than the one on the devices currently.
These lines in nrf_dfu_validation.c did answer my question as for the reason of the failure of the update. 

if ((p_init->type & DFU_FW_TYPE_BOOTLOADER) && (p_init->has_bl_size == true))
{
    if (p_init->bl_size <= BOOTLOADER_SIZE)
    {
        fw_sz += p_init->bl_size;
    }
    else
    {
        NRF_LOG_ERROR("BL size (%d) over limit (%d)", p_init->bl_size, BOOTLOADER_SIZE);
        fw_sz   = 0;
        ret_val = NRF_DFU_RES_CODE_INSUFFICIENT_RESOURCES;
    }
}

BOOTLOADER_SIZE is calculated on the size of the current bootloader and not the new so the update will always fail.

My question is, is there really no way of updating a bootloader to a bootloader of a bigger size?
It is really important to me so I don't have to ask our clients to send back the devices.

Thanks

Infos : 
Chip : nrf52840
SDK : 16

Parents Reply Children
No Data
Related