Mistake on this page? Email us

Command-line tutorial for NXP MCUXpresso SDK with Pelion

This tutorial shows you how to securely connect and update an NXP LPC54628 device to Device Management built with NXP Xpresso SDK over an IP connection.

The tutorial uses MCUXpresso SDK version 2.7.0 and the LPCXpresso54628 development board, as well as a Linux PC (64-bit Ubuntu/XUbuntu OS desktop environment).

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


  • Configure MACRO for compiler:
    export ARMGCC_DIR=/usr/local/gcc-arm-none-eabi-6-2017-q1-update
  • Ensure that the development board has DAPlink installed. See the instructions for updating the LPCXresso firmware.
  • An API key with Administrators group privileges for your Device Management account.

Note: The earlier revisions of LPCXpresso 546XX have different QSPI chip than the some of the later revisions. The application must specify at compile-time which it supports. Select the correct QSPI chip in the board configuration file (define_NXP_LPC54628.txt). This depends on the board revision.

For all other requirements, see the tools and accounts section. See also instructions for Mbed CLI.

Configuring Device Management Client

  1. Open a terminal, and import the example repository to a convenient location in your development environment:

    mbed import
  2. Download the developer certificate:

    1. Log in to Device Management Portal.
    2. Go to Device identity > Certificates.
    3. Click Actions > Create a developer certificate.
    4. Add a name and optional description for the certificate, and click Create certificate.
    5. Click Download Developer C file to download the file mbed_cloud_dev_credentials.c.
  3. Copy mbed_cloud_dev_credentials.c to the example application root folder.

  4. Initialize update-specific resources. Replace <API key> with the API key you generated in the requirements step:

    manifest-tool init -a <API key> -d -m example-app --force -q
  5. Download the NXP SDK for the target board. This example uses NXP MCUXpresso LPC54628:

    1. Go to NXP MCUXpresso SDK Builder. Registration and login are required.
    2. Click Select Development Board.
    3. In the SDK Builder, use Search by Name to find and select LPCXpresso54628.
    4. Click Build MCUXpresso SDK.
    5. Select the SDK Version: 2.7.0 2019-12-19.
    6. Select Toolchain: GCC ARM Embedded.
    7. Select Host OS: Linux.
    8. Select the features Amazon FreeRTOS, sdmcc stack, mbedtls and lwIP.
    9. Click Download SDK.
  6. Create a new folder SDK_LPCXpresso54628 under ~/mbed-cloud-client-example/pal-platform/SDK/LPCXpresso54628/.

  7. Unpack the SDK under SDK_LPCXpresso54628:

    tar -xzvf SDK_2.7.0_LPCXpresso54628.tar.gz -C mbed-cloud-client-example/pal-platform/SDK/LPCXpresso54628/SDK_LPCXpresso54628
  8. Deploy remaining dependencies and configuration:

    python pal-platform/ deploy --target=LPC54628_NXP generate

Compiling and flashing Device Management Client

  1. Run CMake and Make to compile the application:

    cd __LPC54628_NXP
    cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=./../pal-platform/SDK/LPCXpresso54628/SDK_LPCXpresso54628/tools/cmake_toolchain_files/armgcc.cmake -DEXTERNAL_DEFINE_FILE=./../define_NXP_LPC54628_update.txt -DUPDATE_LINKING=1
    make mbedCloudClientExample.elf
    cd ..
  2. Combine the image with a bootloader. This command runs in the repository root-folder:

    python pal-platform/SDK/LPCXpresso54628/tools/ -b pal-platform/SDK/LPCXpresso54628/tools/mbed-bootloader.bin -a __LPC54628_NXP/Release/mbedCloudClientExample.bin -o mbedCloudClientExample_combined.bin -c 0x8400 -d 0x8000
  3. Connect your board to your PC over USB. It appears in your file browser.

  4. Copy the application file mbedCloudClientExample_combined.bin to the board. Flash the image combined with the bootloader (_combined.bin), not the one generated by Make:

Connecting and performing a firmware update on your device

  1. Open a serial terminal with the COM port that Device Management uses and 115200 baud rate with no flow control. Reset the board.

When the client has successfully connected, the terminal shows:

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

To verify the connection with Device Management Portal:

  1. Log in to Device Management Portal.
  2. Select Device directory from the menu on the left.
  3. When your device is listed on the Devices page, it is connected and available.

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

Updating the firmware

To update the firmware on your device:

manifest-tool update device -p __LPC54628_NXP/Release/mbedCloudClientExample.bin -D <Device ID>

When the update starts, 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.