Mistake on this page? Email us

Command line tutorial for Device Management Client with an Mbed OS device

This tutorial covers an end-to-end flow for using the Device Management Client example application:

  1. Configuring Device Management Client.
  2. Compiling and flashing Device Management Client.
  3. Connecting and performing a firmware update on your device.

Versions

The Device Management Client version used for the tutorial is 2.0.0 or later.

Here is how the different Device Management Client example application and Mbed OS versions work together:

Device Management Client 1.5.0 2.0.0
Mbed OS 5.9 Works out-of-box Not compatible
Mbed OS 5.10 Not compatible Works out-of-box

Note: Due to the integration of storage and networking drivers to Mbed OS 5.10 and the introduction of new APIs, the Device Management Client example application 2.0.0 or onwards is not compatible with Mbed OS 5.9 or older.

Supported boards

You can use this tutorial with the following boards:

Board/MCU Default stack DAPLink or STLink
K64F Ethernet DAPLink
K66F Ethernet DAPLink
NUCLEO_F429ZI Ethernet STLink
NUCLEO_F411RE Wi-Fi * STLink
UBLOX_ODIN_EVK_W2 Wi-Fi * STLink

* For Wi-Fi boards, you need to add your SSID and password information to the mbed_app.json file.

Prerequisites

To work with the Device Management Client example application, you need the following:

  • A supported board with a network connection and FAT-formatted SD card attached. (See advanced instructions for boards without internal SD card adapter).
  • Serial connection to your device with open terminal connection (baud rate 115200, 8N1).
  • Mbed CLI pre-installed (Mbed CLI 1.8.0 and Mbed OS 5.10 or later versions).
    • You need to make sure that all the components are in par with the pip package requirements.txt list from Mbed OS.
  • An API key (with Administrators group privilages) for your Device Management account.
  • Updated DAPLink software (version 250 or later), if your board uses DAPLink.

For instructions, see:

Configuring Device Management Client

  1. Clone the embedded application's GitHub repository to your local computer and navigate to the new folder:

    mbed import https://github.com/ARMmbed/mbed-cloud-client-example
    cd mbed-cloud-client-example
    
  2. Configure Mbed CLI to use your Device Management account and board:

    mbed config -G CLOUD_SDK_API_KEY <API_KEY>
    mbed target <MCU>
    mbed toolchain GCC_ARM
    
  3. Use Mbed CLI to download a developer certificate and to create an update-related configuration for your device:

    mbed device-management init -d arm.com --model-name example-app --force -q
    

Compiling and flashing Device Management Client

To compile the example application:

mbed compile

Read more detailed instructions on all the parameters related to Mbed CLI and device-management command.

Flashing the binary to the device

To flash the binary to the device:

  1. Connect the device to your computer over USB. It's listed as a mass storage device.
  2. Drag and drop mbed-cloud-client-example.bin to the device. This flashes the binary to the device. You should see the LED blink rapidly; wait for it to stop.

Connecting and performing a firmware update on your device

Checking the device connection and obtaining the Device ID

  1. Press the Reset button to restart the device.
  2. Obtain your device's Device ID either from device console logs or from the Device Management Portal.

The terminal gives the following information when the Client has successfully connected:

Client registered
Endpoint Name: <Endpoint name>
Device Id: <Device ID>

To check with Device Management Portal:

  1. Open Device Management Portal.
  2. Navigate to Device directory.
  3. When your device is listed, it is connected and available.

Your device is now connected and ready for the firmware update. For development devices, the Endpoint name and Device ID are identical.

Updating the firmware

To update the firmware on your device:

mbed device-management update device -D <Device ID>

When the update starts you can see the following log in Client tracing:

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.

Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.