ARM mbed is the fastest way of creation and deployment of devices based on ARM microcontroller. It is designed for IoT platforms which provide an operating system, development tools, standard libraries, cloud services etc.

mbed provides an API’s to create your own application on C++ for controlling various hardware and also provides an interface(mbed OS) for developing an embedded device software that runs on various ARM microcontroller.

Figure 1. Mbed-Overview

This article show, the steps to create and build your first mbed application on ZKit-ARM-1769.

Getting started with mbed

To build your first mbed application, you have to setup your build environment of mbed OS. There are various ways to build your mbed application

  • Online Compiler IDE.

  • yotta, command line build tool.

  • gcc4mbed

In this article, we are going to use Online Compiler.

Online Compiler IDE:

Step 1:

To use online compiler for mbed development, first you need to login/signup in https://developer.mbed.org/compiler

Figure 2. Login/Signup

Step 2:

To create a new program click New

Figure 3. Create New Program

Make the following choices in the dialog:

  1. Platform: mbed LPC1768

  2. Template: Blinky LED Hello World

  3. Program Name: mbed_blinky

Note: In this tutorial, we use ZKit-ARM-1769 board which is same as ARM-LPC1768. The only difference is CPU frequencies of LPC1768 is up to 100MHz whereas LPC1769 120MHz.

Step 3:

Now you can find your program on Program Workspace which contains source file and build libraries.

Figure 4. Program Workspace

Blink LED(main.cpp)

#include "mbed.h"

DigitalOut myled(P0_19);

int main() {
    while(1) {
        myled = 1;
        wait(0.2);
        myled = 0;
        wait(0.2);
    }
}

Step 4:

To compile a program click Compile

Figure 5. Compile

After compilation, you will get a binary in your default download directory.

Step 5:

Use FlashMagic or the lpc21isp tool to flash the binary.

On Linux,

 $ lpc21isp -control -bin </path/to/binary-file> /dev/ttyUSB0 115200 12000

On Windows, refer Step 4 to Step 7 from the following link:

Finally, press the reset button on your target board.

Credits

Thanks to mbed.org for the images.

About the Author

Vijay Kumar heads the firmware and application division in Zilogic. He is a technologist and trainer specializing in Linux, Embedded Systems & Python. He has been instrumental in promoting open source software over the past 20 years, by organizing meetups and conferences.

About Us

Zilogic Systems is a product-realization company specializing in embedded technologies. We cater to IoT, Automotive and Wireless industries. We are a single source for hardware, firmware, system software, application software and test automation engineering expertise.

All Rights Reserved © 2021 Zilogic Systems.

Contact Us

Zilogic Systems Pvt. Ltd.

 No.15, IV Main Road,
Kamaraj Nagar,
Thiruvanmiyur,
Chennai – 600 041.

Email & Phone
+91 44 24480505.
sales@zilogic.com

All Rights Reserved © 2021 Zilogic Systems.

Designed by Yulanto Web Creations Pvt Ltd.