How to enable / disable MCUboot FOTA

Hi,

I have tested the MCUboot FOTA for my sensor with the peripheral_lbs sample project, by enabling the macros:

#Enable MCUBOOT bootloader build in the application
CONFIG_BOOTLOADER_MCUBOOT=y
#Include MCUMGR and the dependencies in the build
CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y

 
This works, and I can bootload the sensor via the nRF App.
On our custom board, we also use bluetooth, but when adding the MCUboot, does this add a separate BLE thread ?
And when our sensor firmware is running, we would like to do some stuff, and probably write something on our sensor display, when bootloader starts, how is this possible ?
Best regards
Jakob
Parents Reply
  • Okay, maybe I'm just slow today... :-)
    I am guessing that the CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y
    includes some code that can accept some magic BLE command, that will run the DFU.
    But two things:
    1. We have some very timing critical stuff in our firmware, so we would like to check what code is actually running, when including the NCS sample.
    2. We want to use our current App communications to enable DFU, but if the CONFIG_NCS_... stuff is included, this will (I guess) happen automatically ?

Children
  • jju said:
    1. We have some very timing critical stuff in our firmware, so we would like to check what code is actually running, when including the NCS sample.

    It is quite magic indeed. To quote myself from the course:

    "
    use that.
    This configuration is named CONFIG_NCS_SAMPLE… as it makes some assumptions about the project. For your custom project, I recommend that you look at what configurations CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU set for you, and include the ones from there you need instead.

    "

    Anyways. This enabled the mcumgr library in zephyr, which sets up a BLE service for you which lets you send FOTA over BLE.

    It will still be up to you to set up BLE and advertise. The setting just sets up the service.

    jju said:
    1. We have some very timing critical stuff in our firmware, so we would like to check what code is actually running, when including the NCS sample.

    https://github.com/nrfconnect/sdk-zephyr/tree/main/subsys/mgmt/mcumgr

    jju said:
    2. We want to use our current App communications to enable DFU, but if the CONFIG_NCS_... stuff is included, this will (I guess) happen automatically ?

    Yes it will.

    But you can see what is done in here, and then not set CONFIG_MCUMGR_TRANSPORT_BT, and instead set it up manually.

Related