Top Banner
An open source platform for IoT Bogdan Marinescu mbed
26

An open source platform for IoT Bogdan Marinescu mbed.

Dec 15, 2015

Download

Documents

Iyanna Owsley
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: An open source platform for IoT Bogdan Marinescu mbed.

An open source platform for IoT

Bogdan Marinescu

mbed

Page 2: An open source platform for IoT Bogdan Marinescu mbed.

What is mbed? mbed is an open source platform for developing

embedded systems based on ARM Cortex®-M microprocessor

Page 3: An open source platform for IoT Bogdan Marinescu mbed.

Microcontroller and Toolchain PortabilityHardware Abstraction Layer C Libraries and project exports

Starting at £8.24

Page 4: An open source platform for IoT Bogdan Marinescu mbed.

Components Libraries Write a component library once and get supported on

multiple mbed platforms. Implement the mbed HAL once and immediately

support thousands of components.

Page 5: An open source platform for IoT Bogdan Marinescu mbed.

Example ApplicationLIS302 Accelerometer

Simple user friendly C++ for the user

Component-based approach The implementation does not

reference any MCU register, but only the mbed API

Page 6: An open source platform for IoT Bogdan Marinescu mbed.

Open Source Project

41 Contributors (github stats track only its users)

149 Pull Requests 112 Followers 108 mailing list members

Open sourced Feb. 2013, already getting momentum

Page 7: An open source platform for IoT Bogdan Marinescu mbed.

Developer Community 50,023 users 6,358 public code

repositories 75% of questions receive an

answer

Page 8: An open source platform for IoT Bogdan Marinescu mbed.

CMSIS-DAP Standardized access to the Coresight Debug Access

Port (DAP) of an ARM Cortex microcontroller via USB HID (no drivers).

>>> from pyOCD.board import MbedBoard>>> target = MbedBoard.chooseBoard().target0 => MBED MBED CMSIS-DAP (0xd28, 0x204) [lpc1768]>>> target.halt()>>> target.readCoreRegister("pc")1392>>> target.step()>>> target.readCoreRegister("pc")1394

https://github.com/mbedmicro/pyOCD

Page 9: An open source platform for IoT Bogdan Marinescu mbed.

SDK Architecture

Page 10: An open source platform for IoT Bogdan Marinescu mbed.

C++ in the SDK

Lightweight, runs on small targets No exceptions/RTTI Put OOP to good use Minimal impact on speed

Page 11: An open source platform for IoT Bogdan Marinescu mbed.

C++ in the SDK

Lightweight wrapper

Concise Stable API 14.2k flash / 0.5k

RAM

Verbose Harder to understand API may change 11.1k flash / 0.4k

RAM

Page 12: An open source platform for IoT Bogdan Marinescu mbed.

Using the Compiler - Online

Page 13: An open source platform for IoT Bogdan Marinescu mbed.

Using the Compiler – Offline Export from online IDE Use offline IDE/command line tools (make) Supported: uVision, IAR, make (various), CodeRed

c:\work\temp> unzip ~/Downloads/blinky_gccarm_lpc1768.zip inflating: blinky/main.cpp inflating: blinky/.hgignore inflating: blinky/Makefile………

c:\work\temp> cd blinky\

[hg:default] c:\work\temp\blinky> makearm-none-eabi-g++ -mcpu=cortex-m3 -mthumb -c -Os -fno-common -fmessage-length=0 -Wall -fno-exceptions -ffunction-sections -fdata-sections -DTARGET_LPC1768 -DTARGET_M3 ………………arm-none-eabi-objcopy -O binary blinky.elf blinky.bin

[hg:default] c:\work\temp\blinky> move blinky.bin e:

Page 14: An open source platform for IoT Bogdan Marinescu mbed.

What makes the IoT tick Specific protocols

Low overhead Interoperability

Security Low power Different transports

Radio (2.4Ghz) Radio (sub GHz) WiFi Cellular Wired

Page 15: An open source platform for IoT Bogdan Marinescu mbed.

mbed network stack

Page 16: An open source platform for IoT Bogdan Marinescu mbed.

Example network application - eth#include "mbed.h"

#include "EthernetInterface.h"

int main() {

EthernetInterface eth;

eth.init(); //Use DHCP

eth.connect();

printf("IP Address is %s\n", eth.getIPAddress());

TCPSocketConnection sock;

sock.connect("mbed.org", 80);

char http_cmd[] = "GET /media/uploads/mbed_official/hello.txt HTTP/1.0\n\n";

sock.send_all(http_cmd, sizeof(http_cmd)-1);

char buffer[300];

int ret;

while (true) {

ret = sock.receive(buffer, sizeof(buffer)-1);

if (ret <= 0)

break;

buffer[ret] = '\0';

printf("Received %d chars from server:\n%s\n", ret, buffer);

}

sock.close();

eth.disconnect();

}

Page 17: An open source platform for IoT Bogdan Marinescu mbed.

Example network application - WiFi#include "mbed.h"

#include “WiflyInterface.h"

int main() {

WiflyInterface wifly(p28, p27, p26, p25, "myssid", "mypassword", WPA);

wifly.init(); //Use DHCP

while (!wifly.connect()); // join the network

printf("IP Address is %s\n", wifly.getIPAddress());

TCPSocketConnection sock;

sock.connect("mbed.org", 80);

char http_cmd[] = "GET /media/uploads/mbed_official/hello.txt HTTP/1.0\n\n";

sock.send_all(http_cmd, sizeof(http_cmd)-1);

char buffer[300];

int ret;

while (true) {

ret = sock.receive(buffer, sizeof(buffer)-1);

if (ret <= 0)

break;

buffer[ret] = '\0';

printf("Received %d chars from server:\n%s\n", ret, buffer);

}

sock.close();

wifly.disconnect();

}

Page 18: An open source platform for IoT Bogdan Marinescu mbed.

mbed IoT components

Page 19: An open source platform for IoT Bogdan Marinescu mbed.

mbed IoT protocolsSource: https://mbed.org/handbook/TCP-IP-protocols-and-APIs

• NanoService: https://mbed.org/components/Nanoservice/• mqtt: https://mbed.org/cookbook/mbed_Client_for_MQTT• BTLE: https://mbed.org/teams/Bluetooth-Low-Energy/

Page 20: An open source platform for IoT Bogdan Marinescu mbed.

MBED Cloud API Integrations

AT&T Sprint Telenor

Page 21: An open source platform for IoT Bogdan Marinescu mbed.

Roadmap: IoT

Page 22: An open source platform for IoT Bogdan Marinescu mbed.

Roadmap: 6LoWPAN / 802.15.4 Support for 6LoWPAN and 802.15.4 stacks on the mbed SDK.

Addition of reference hardware platforms for quickly experimenting with Wireless Sensor Networks.

Page 23: An open source platform for IoT Bogdan Marinescu mbed.

Roadmap: security

Page 24: An open source platform for IoT Bogdan Marinescu mbed.

Roadmap: Test Infrastructure Provide Test Infrastructure as a service to mbed.org

users Make TDD/UT/CI a standard part of embedded

community

Page 25: An open source platform for IoT Bogdan Marinescu mbed.

Roadmap: the rest Powerful command line

tools Better debugging Grow list of platforms Integrated IoT solution

Low power Built in security More protocols