MBed
Mbed is a platform and operating system for internet-connected IOT devices based on 32-bit ARM Cortex-M microcontrollers. It includes all the features needed to develop a connected product based on an Arm Cortex-M microcontroller, including security, connectivity, an RTOS(M, and drivers for sensors and I/O devices.
Applications for the Mbed platform can be developed using the Mbed online IDE, a free online code editor and compiler.
// Code Sample
#include "mbed.h"
DigitalOut myled(LED1);
int main() {
while(1) {
myled = 1;
wait(0.2);
myled = 0;
wait(0.2);
}
}
Code compilation:
The compilation process prints out information related to memory layout of the compiled code.
The executable code, constants and other read-only data get put in a section called "RO" (for read-only), which is stored in the FLASH memory of the device. Initialised static and global variables go into a section called "RW" (read-write), and the uninitialised ones in to one called "ZI" (Zero Initialise). These segments reside in the RAM.
The version control for the code is done using distributed Mercurial version control which is integrated with the IDE.
There are various hardware demo-boards for the Mbed platform, with the default being the original Mbed Microcontroller board. The Mbed Microcontroller Board (marketed as the "mbed NXP LPC1768") is a demo-board based on an NXP microcontroller, which has an ARM Cortex M3 core, running at 96 MHz, with 512 KB flash, 64 KB RAM, as well as several interfaces including Ethernet, USB Device, CAN, SPI, I²C and other I/O.
The target board for the code is displayed at the top right corner : LPC1768 in our case. Clicking on the board opens up a description for the board including the pinout details.
We can use "Add Board" or "Add Module" to add additional supported board/module to our IDE. For example:
List of Modules supported:
-- Advantech WISE 1570
-- Advantech WISE 1530
-- Advantech WISE 1510
-- uBlox ODIN W2
-- uBlox NINA B1
-- Multitech DragonFly
-- Multitech xDOT
Examples of boards supported include:
-- mbed LPC 11U24
-- NXP LPC 800 MAX
-- mbed LPC 1114FN28
-- EFM32 WONDER Gecko
-- GR PEACH
-- NUCLEO F334R8
Code once developed can be exported for the target board / toolchain using the export option as shown below.
This will generate a .bin file which in turn can be deployed to the physical board for validation.
The IOT device on which the software is deployed can be managed using ARM Pelian Device Management platform.