Mistake on this page? Email us

Upgrading deployed devices to Device Management Client 4.8.0 or higher

Device Management Client 4.8.0 introduces an upgraded update client and bootloader.

This short guide details the steps required to update deployed devices that are running firmware based on Device Management Client 4.7.1 or lower to firmware based on Device Management Client 4.8.0 and higher without updating the existing bootloader.

Prerequisites

Upgrading Device Management Client

  1. Update mbed-cloud-client.lib, on your application root folder, with the latest release hash from Device Management Client release.
  2. Pull latest sources:
    mbed deploy
    

Building the new client firmware image

  1. Enable FOTA, our upgraded update client, by adding "fota.enable" : true to your target configuration in your mbed_app.json file.

  2. Add the MBED_CLOUD_CLIENT_SUPPORT_UPDATE macro to your mbed_app.json file.

  3. If you are using developer mode, make sure to build with the same update_default_resources.c file you used for your legacy firmware.

  4. If your target uses external storage to hold the candidate image ("mbed-cloud-client.update-storage" : "ARM_UCP_FLASHIAP_BLOCKDEVICE"), set the storage size ("update-client.storage-size") to be aligned with the erase size of the block device.

    For example, this is the configuration for the DISCO_L475VG_IOT01A target:

    "update-client.storage-size" : "((((MBED_ROM_START + MBED_ROM_SIZE - APPLICATION_ADDR) * MBED_CONF_UPDATE_CLIENT_STORAGE_LOCATIONS)/0x1000)*0x1000)"
    

    Where 0x1000 is the erase size of the block device.

  5. Compile the image:

    mbed compile
    

    For the update campaign candidate, use the created mbed-cloud-client-example_update.bin image.

Upgrading device firmware - developer flow

  1. Use the same update-related configuration and credentials (update private key, public key certificate and configuration file located by default in .manifest-dev-tool) you created with manifest-dev-tool init for your legacy firmware.

  2. Update the firmware on your device by running the manifest-dev-tool update-v1 command:

    manifest-dev-tool update-v1 \
                      --payload-path mbed-cloud-client-example_update.bin \
                      --fw-migrate-ver <Candidate SemVer> \
                      --device-id <Device ID> \
                      --wait-for-completion
    
    • --fw-migrate-ver is the candidate firmware version in SemVer format and can be between 0.0.1 and 999.999.999.

    During the update flow, the client tracing log shows:

    Firmware download requested
    Authorization granted
    Downloading: [++++++++++++++++++++++++++++++++++++++++++++++++++] 100 %
    Download completed
    Firmware install requested
    Authorization granted
    

    To perform an update operation from this point on, use the manifest-dev-tool update command (instead of manifest-dev-tool update-v1):

    manifest-dev-tool update \
                      --payload-path mbed-cloud-client-example_update.bin \
                      --device-id <Device ID> \
                      --wait-for-completion
    

Upgrading device firmware - production flow

  1. Upload the created image to Device Management Portal for your region:

  2. Copy the URL of the image to your configuration file (my.config.yaml).

  3. Create a manifest using the manifest-tool create-v1 command based on the updated configuration file:

    manifest-tool create-v1 \
                  --config my.config.yaml \
                  --key my.priv.key.pem \
                  --update-certificate my.x509.certificate.der \
                  --fw-migrate-ver 1.2.3 \
                  --output my.manifest.bin
    
    • Use the same private key and public key certificate you used with your legacy firmware.
    • --fw-migrate-ver is the candidate firmware version in SemVer format and can be between 0.0.1 and 999.999.999.
  4. Upload the created manifest to Device Management Portal for your region:

  5. Create a campaign using the uploaded manifest through the Device Management Portal for your region:

  1. Choose a campaign type, select a device and start the campaign.

  2. During the update flow, the client tracing log shows:

    Firmware download requested
    Authorization granted
    Downloading: [++++++++++++++++++++++++++++++++++++++++++++++++++] 100 %
    Download completed
    Firmware install requested
    Authorization granted
    

    After this, the device reboots automatically and registers to Device Management.

    To create a manifest from this point on, use the manifest-tool create command instead of manifest-tool create-v1:

    manifest-tool create \
                  --config my.config.yaml \
                  --key my.priv.key.pem \
                  --fw-version 1.2.4 \
                  --output my.manifest.bin
    

For the full provision and update flow, see the Factory provisioning to update campaigns tutorial.