nRF5 SDK is not maintained anymore
More Info: Consider nRF Connect SDK for new designs
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How does OTA update work conceptually?

When I build the smp_svr example, which I think contains firmware update over BLE functionality, the flash memory is reported as about 72% full.

Memory region         Used Size  Region Size  %age Used
           FLASH:      171104 B     237056 B     72.18%
            SRAM:       32053 B        64 KB     48.91%
        IDT_LIST:          0 GB         2 KB      0.00%

Does this mean when I'm doing a firmware update it overwrites the firmware while the same firmware is running at the same time?

  • Hi,

    which I think contains firmware update over BLE functionality

    If you built the sample with an appropriate configuration (like overlay-bt.conf), then yes, it will include BLE transport.

    Does this mean when I'm doing a firmware update it overwrites the firmware while the same firmware is running at the same time?

    No. The flash will be partitioned in several partitions, most importantly here, the primary slot (0) and secondary slot (1). The primary slot holds the active firmware, and during and update the new firmware is copied to the secondary slot. Then, when that firmware is activated, it is copied down to the primary slot by the bootloader (MCUboot). The flash partitioning is done automatically. To see the configuration you got build the same and to go the build folder. Then type: "ninja partition_manager_report". If you do this with the smp_svr sample in nRF Connect SDK 2.0.0 for the nRF52 DK you should see this output, which is the memory layout:

      flash_primary (0x80000 - 512kB):
    +-------------------------------------------------+
    | 0x0: mcuboot (0xc000 - 48kB)                    |
    +---0xc000: mcuboot_primary (0x3a000 - 232kB)-----+
    | 0xc000: mcuboot_pad (0x200 - 512B)              |
    +---0xc200: mcuboot_primary_app (0x39e00 - 231kB)-+
    | 0xc200: app (0x39e00 - 231kB)                   |
    +-------------------------------------------------+
    | 0x46000: mcuboot_secondary (0x3a000 - 232kB)    |
    +-------------------------------------------------+
    
      sram_primary (0x10000 - 64kB):
    +-------------------------------------------+
    | 0x20000000: sram_primary (0x10000 - 64kB) |
    +-------------------------------------------+

Related