Application development flow
Preparing your device
Tip: For a list of supported devices, see our hardware requirements.
MBL applications are not compiled together with the MBL codebase or with any Pelion Device Management credentials (unlike Mbed OS, where the codebase, credentials, and application form a single binary). This method allows you to deploy and manage multiple applications on a single device, but it requires some preparation. To install applications on the device, first install MBL and provision Device Management credentials on that device.
If you have a device with MBL already installed and provisioned, please:
- Install MBL CLI, which you will also use when developing applications.
Note: If you have MBL CLI 1.x installed, please uninstall it, and install 2.0 instead. Use
- Set up a developer (USB) connection to your device, so you can work with MBL CLI.
If your device does not have MBL, please install an image on it.
MBL applications run as containers from images prepared with Docker. A container has:
- Your application's executable files and scripts.
config.jsonfile that lists the device resources, such as hardware or persistent memory, the application container can access. It also carries instructions for the device on how to run the application.
Tip: More information about containers and packages is available in our Reference section.
There are many ways to create applications that can be packaged in the IPK format so that the MBL application framework can install and run them. This example application uses a Docker cross-compiling tool, dockcross, which has a standard image with everything needed to compile C and C++ applications for Linux on ARMv7. An additional layer on top of the standard dockcross image includes the tools to create an IPK package (
opkg-utils). The resulting cross-compilation docker image, referred to here as
mbl-dockcross, takes a standard MakeFile and builds according to its instructions:
- Builds the application using
- Creates an
.ocibundle, the container, which combines our built application and our configuration file.
- Creates an
.ipkfile. This is the file format the MBL's package manager, which installs applications, can handle.
- Put your
.tar, to match the requirements of the Device Management Update service.
The Hello World C application is entirely self contained. It has just one file to build -
hello_world.c - and a
config.json defining how to run the application on the device. The
config.json doesn't give the application any special access to the device's software or hardware resources; the application doesn't even use the device's C runtime library, as it is statically compiled. It uses a MakeFile and
mbl-dockcross to cross-compile.
More information about containers is available in the application FAQ.