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
-
Device running Device Management Client 4.7.1 or lower.
-
Mbed OS application configured based on
Device Management Client example
version 4.7.1 or lower. -
manifest-tool
v2.2.0 or higher.To upgrade from
manifest tool
v1.5.2 or lower, please see the documentation in the manifest tool repository.
Upgrading Device Management Client
- Update
mbed-cloud-client.lib
, on your application root folder, with the latest release hash from Device Management Client release. - Pull latest sources:
mbed deploy
Building the new client firmware image
-
Enable
FOTA
, our upgraded update client, by adding"fota.enable" : true
to your target configuration in yourmbed_app.json
file. -
Add the
MBED_CLOUD_CLIENT_SUPPORT_UPDATE
macro to yourmbed_app.json
file. -
If you are using developer mode, make sure to build with the same
update_default_resources.c
file you used for your legacy firmware. -
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. -
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
-
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 withmanifest-dev-tool init
for your legacy firmware. -
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 ofmanifest-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
-
Upload the created image to Device Management Portal for your region:
-
Copy the URL of the image to your configuration file (
my.config.yaml
). -
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.
-
Upload the created manifest to Device Management Portal for your region:
-
Create a campaign using the uploaded manifest through the Device Management Portal for your region:
-
Choose a campaign type, select a device and start the campaign.
-
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 ofmanifest-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.