Mistake on this page? Email us

Implementing component update

The FOTA library supports update of components different from the main firmware image, such as wireless connectivity modules, embedded sensors or different partitions or packages in Linux-based devices; a BLE stack running on a coprocessor.

To use the component update feature, your application must use the APIs specified in the FOTA component update header file.

To register extra components:

  1. Define the number of components present in the system by adding the FOTA_NUM_COMPONENTS=x macro to your build configuration file.

    • Where x is the number of components present in the system including the MAIN component of the firmware image.

    • For Mbed OS, add this line to your mbed_app.json file:

      "fota.num-components": x
      
  2. Enable implementation of firmware update in your application by enabling the FOTA_CUSTOM_PLATFORM macro, as described in Integrating firmware update platform hooks with your application.

  3. Register your component by calling the fota_component_add() API in the application implementation of the fota_platform_init_hook() API (see fota_platform.h), which the client calls when it initializes the FOTA module.

  4. To register a component, the application must fill in the fota_component_desc_info_t component descriptor structure defined in fota_component.h.

    For a component registration example, please see https://github.com/PelionIoT/pelion-client-lite-example/blob/master/source/fota_platform.c.

    Device Management Portal displays the names and version numbers of registered components when the device connects. You can use component names and versions to filter devices when creating an update campaigns.