This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Max size of the application for Firmware upgrade OTA (nRF52832)

Hi,

Question about FOTA (firmaware upgrade over the air).

I know that nrf52832 has 512 kB of flash, and the ble stack(softdevice) has 136 kB , and the bootloader has 19 kB.

So MBR + Ble stack+ bootloader = 159 kB.

Q: What is the Max size of the application that we can reach and still can do the Full firmware upgrade over the air (Softdevice +application+bootloader)?  

thanks,

regards,

Parents
  • "I know that nrf52832 has 512 kB of flash"

    There exists a variant with 256 kB as well, but yes, the most common one which you find on our development kits has 512 kB.

    "ble stack(softdevice) has 136 kB"

    For S132 v5.X.X, yes, and as you have correctly done later on the MBR comes in addition to the SoftDevice itself. Other SoftDevices have other sizes.

    "the bootloader has 19 kB"

    First a clarification: The nRF52832 has 4 kB flash pages, so nothing can ever really be 19 kB from the perspective of the bootloader. When the bootloader copy firmware, it's done at whole flash pages.

    Which bootloader did you check? As far as I can recall, all SDKs since SDK 12.0.0 has had a bootloader of 24 kB. Additionally, the bootloader settings page, MBR settings page and any reserved app data come in addition to the bootloader itself. This means that with the two settings pages (both required) the minimum size required to have a bootloader is 32 kB. The default reserved app data is 3 pages, but you can remove this if you want to. It's an area of flash which the application can use to store data persistently which the bootloader will never overwrite.

    "What is the Max size of the application that we can reach and still can do the Full firmware upgrade over the air (Softdevice +application+bootloader)?"

    Our bootloader implements dual banking and single banking. So if the application is too large to fit at the same time as the new SoftDevice and Bootloader it will be deleted temporarily while the SoftDevice+Bootloader update is complete the application will be added in a separate Application update. Both of the updates are done right after each other automatically, so an end user will not experience it as two updates, but from a technical point of view this is what happens.

    "So MBR + Ble stack+ bootloader = 159 kB."

    MBR + Ble stack + bootloader + MBR settings page + bootloader settings page =

    4 + 136 + 24 + 4 + 4 = 172 kB

    This means your application can be up to 340 kB, but most customers will have at least 2 pages of reserved app flash additionally. With an application of this size, you can still perform full firmware upgrades.

    Just to put this answer in context, here is a map of the typical flash content.

    Best regards,
    Rune Holmgren

Reply
  • "I know that nrf52832 has 512 kB of flash"

    There exists a variant with 256 kB as well, but yes, the most common one which you find on our development kits has 512 kB.

    "ble stack(softdevice) has 136 kB"

    For S132 v5.X.X, yes, and as you have correctly done later on the MBR comes in addition to the SoftDevice itself. Other SoftDevices have other sizes.

    "the bootloader has 19 kB"

    First a clarification: The nRF52832 has 4 kB flash pages, so nothing can ever really be 19 kB from the perspective of the bootloader. When the bootloader copy firmware, it's done at whole flash pages.

    Which bootloader did you check? As far as I can recall, all SDKs since SDK 12.0.0 has had a bootloader of 24 kB. Additionally, the bootloader settings page, MBR settings page and any reserved app data come in addition to the bootloader itself. This means that with the two settings pages (both required) the minimum size required to have a bootloader is 32 kB. The default reserved app data is 3 pages, but you can remove this if you want to. It's an area of flash which the application can use to store data persistently which the bootloader will never overwrite.

    "What is the Max size of the application that we can reach and still can do the Full firmware upgrade over the air (Softdevice +application+bootloader)?"

    Our bootloader implements dual banking and single banking. So if the application is too large to fit at the same time as the new SoftDevice and Bootloader it will be deleted temporarily while the SoftDevice+Bootloader update is complete the application will be added in a separate Application update. Both of the updates are done right after each other automatically, so an end user will not experience it as two updates, but from a technical point of view this is what happens.

    "So MBR + Ble stack+ bootloader = 159 kB."

    MBR + Ble stack + bootloader + MBR settings page + bootloader settings page =

    4 + 136 + 24 + 4 + 4 = 172 kB

    This means your application can be up to 340 kB, but most customers will have at least 2 pages of reserved app flash additionally. With an application of this size, you can still perform full firmware upgrades.

    Just to put this answer in context, here is a map of the typical flash content.

    Best regards,
    Rune Holmgren

Children
Related