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

Maximum Size Bootloader + Soft Device OTA DFU

Hello,

This is an add-on question to the the one outlined in: devzone.nordicsemi.com/.../

That question states that:

The maximum SoftDevice size that can be updated is : (FLASH_SIZE - MBR_SIZE - 2BOOTLOADER_SIZE)/2 + MBR_SIZE. That is (numbers in kBs)

In my case I also have 2KB of pstorage that is maitained during OTA dfu.

Max_SD = (256-4-2-2(24))/2+4 = 105KB

In actuality my bootloader only needs ~20KB or space. I have allotted an additional 4KB of space and put the start address at 0x3A000 in order to give me upgrade flexibility for the bootloader. This gives me a maximum SD size of 105KB witch is 9KB more that the 8.0 release. Additionally it gives me and extra 4KB of flexibility for my bootloader.

We are getting ready to move into production and units will not be able to be re-flashed once they have been released. Hence the bootloader size and start address is very important. Any issues with this logic?

Lucas

Parents
  • Hi Lucas

    I think your calculations are good, that you have 4kB extra for the bootloader and 9kB for the softdevice. But if Asbjørn keeps his word, the S110 softdevice will not be made bigger, only minor revision updates are going to be made from now on. So 9 kB extra should be totally safe.

    If you are using the device manager you also need to account for that it reserves 1kB. The device manager uses pstorage to reserve the 1kB page. Pstorage also reserves 1kB swap page when it is initialized.

    Lets assume that you are using pstorage to store your 2kB or application data and that you also use the device manager, and you initialize the device manager before you register the 2 pages for your application data. Then for the "App data" region in the memory map shown here, first you have 2 pages (2kB) for your application data, then you have one page for device manager on top of that and then you have the swap page at the top closest to the DFU bootloader area. However, you could change the pstorage code so that the swap page is located at the bottom of the "App data", then you would save 1kB of storage space because then you could use the swap page area while doing DFU.

    If we assume that the "App data" is 4kB then you would have

    Max_SD = (256-4-4-2(24))/2+4 = 104KB

    as the max size for your softdevice

  • Ok so in truth I have 1KB reserved of "custom app data" and 1KB for the device manager. In total that means I have 3KB of "App data" including the swap page. So that means I should set #define DFU_APP_DATA_RESERVED 0x0C00 . I don't think I'll modify the pstorage.c, but I do see how the optimization would save 1KB.

    Why does the pstorage_platoform.h in the bootloader #define PSTORAGE_MAX_APPLICATIONS 2

Reply Children
No Data
Related