BLE FOTA with double application slot when update

Hi all,

i am using NCS 2.4.0

I have a question is there any possible that i can use double slot to update firmware over BLE FOTA?

I already look at the website below

https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-8-bootloaders-and-dfu-fota/topic/exercise-3-fota-over-bluetooth-low-energy/

in lesson 8, exercise 1, there is a define call  CONFIG_SINGLE_APPLICATION_SLOT, which i can choice to use single slot to over write or double slot to swap.

but there is no  CONFIG_SINGLE_APPLICATION_SLOT at exercise 3 with BLE FOTA !

and i trace the code at mcuboot, it 

my ultimate objective is to apply both BLE FOTA and serial OTA(or uart) at same project

or is there anything that needs attention?

thanks.

  • Yes, you can use double-slot firmware updates over BLE (FOTA) in NCS (nRF Connect SDK) 2.4.0
    To enable double-slot swapping, you need to add the following to your project's `prj.conf`:
    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_UPDATEABLE_IMAGE_NUMBER=2

    boxing random

  • Hi swallowirritate,

    thanks for your answer

    I already use 
    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y

    after I add CONFIG_UPDATEABLE_IMAGE_NUMBER=2

    I encounter a problem when i build the code

    /home/ncs/v2.4.0/nrf/include/flash_map_pm.h:41:22: error: 'PM_mcuboot_primary_1_ID' undeclared (first use in this function); did you mean 'PM_mcuboot_primary_ID'?
       41 | #define PM_ID(label) PM_##label##_ID
    /home/ncs/v2.4.0/nrf/include/flash_map_pm.h:41:22: error: 'PM_mcuboot_secondary_1_ID' undeclared (first use in this function); did you mean 'PM_mcuboot_secondary_ID'?
       41 | #define PM_ID(label) PM_##label##_ID

    do I need to add something else in my `prj.conf`?

  • Hi,

    Wiht nRF Connect SDK, bluetooth updates are always done with dual application slots (never single slot). That is because the transprot must happen in the application.

  • Hi Einar Thorsrud,

    thanks for your answer

    the flash map below is reading after BLE FOTA 

    Are the partitions' names what I wrote correct?

    if so, can I generate new app_update.bin, and use jlink or something to programming bin file to mcuboot_secondary, and then swap to mcuboot_primary ?

    for example:

    mcuboot_secondary:
      address: 0x85000
      end_address: 0xfe000

    I programming new bin file to 0x85000 then I want mcuboot update this to app slot

  • Hi,

    Wayne_Chang said:
    Are the partitions' names what I wrote correct?

    This looks good. I take it DFU works via BLE now?

    Wayne_Chang said:
    can I generate new app_update.bin, and use jlink or something to programming bin file to mcuboot_secondary, and then swap to mcuboot_primary ?

    In principl yes, but it is not enough to just write the firmware image. There is also other metadata that is written together with the image normally via the SMP protocol. So you would have to write this in the image trailer as well via the debugger before you reset if you want to test like this.

Related