Building a firmware image for update on an Mbed OS device
This tutorial explains how to build a firmware image for a supported Mbed OS device that can be updated using the Device Management Update client (if the device is connected to Device Management), and how to flash this image to your device.
This tutorial shows you how to compile, then install, a firmware image, for Mbed OS devices.
There is also a tutorial that provides instructions on how to build a firmware image for the Raspberry Pi 3 device target. For large firmware images on Linux, the multi-part upload process is the same, regardless of target.
You need a supported target running Mbed OS. For a list of all supported targets and configurations, see device requirements.
You should have also:
- Prepared your development environment.
- Integrated the Device Management Update client into your user application or use the
- Be familiar with the process to connect an Mbed OS device to Device Management.
Compile the firmware image
Once you have prepared your environment and integrated the Update client into your user application, the next step is to build this application into an image that can be installed on the device. This firmware image includes the:
- User application.
- Update client.
- Operating system.
Compile the example app for K64F (or change the target accordingly):
mbed compile -m K64F -t GCC_ARM
The above command creates two firmware images:
- The full image, which combines the application with the bootloader and metadata, and is used for the initial programming of the device.
- The update image, which contains only the application and is used for updating the device.
The above example compiles the user application for the K64F target, using the GCC toolchain, and creates the file
mbed-cloud-client-example.bin in your
BUILD directory. You should modify the above command to reference your device and preferred tool chain. This is the firmware image, which contains your application, its metadata, and the bootloader.
Installing the firmware image
Now that you have a firmware image, you can install this on the device. Installing this image on your device enables you to remotely update its firmware.
Note: You only need to install the image on the device if it currently does not have your application and Update client installed. If you have previously installed your application and Update client on the device and connected it to Device Management, then you can update the firmware using a manifest file and an update campaign.
Copy the compiled firmware image to the device as it appears as a mass storage device. For more information on how to program the device, please see Flashing the binary to the device.
After resetting the device and connecting to Device Management, this device is now ready to receive firmware updates remotely.
After the device has finished registering with Device Management, it reports an endpoint name. Make a note of this, as you need this to update the device.
Now that you have a device that can be remotely updated, you can create a manifest file which enables you to deliver updates to remote devices.