applications development on the arm® cortex™-m0+€¦ · arrow cloud connect: applications...

Post on 20-May-2020

13 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Applications Development on theARM® Cortex™-M0+

Free On-line Development Tools

Presented by William Antunes

Agenda

– Cortex M0+ architecture

– Introduction to Kinetis L

– Freedom board

– Arrow Cloud Connect

– Internet of Things introduction

– iDigi cloud services overview

– First IoT application

– Customer dashboard development

2

ARM® Cortex™-M0+

3

Reasons to migrate to 32-bit core?

• “I need more performance.”

• “I need more connectivity”

• “I need more memory”

Reasons not to migrate to 32-bit core?

• “I need low power”

• “I need low cost”

The Cortex-M0+ was designed to provide all the benefits of a 32-bit core at 8-bit/16-bit power and cost.

ARM® Cortex™ M0+

ARM® Cortex™-M0+ Bus Architecture

5

ARM® Cortex™-M0+ Low Latency I/O Interface

6

I/O Interface provides “Harvard-like” access to peripherals

Improves overall cycle efficiency for I/O access

ARM® Cortex™-M0+ Performance

7

Pipeline

Cortex-M4

3

Harvard

ISA Thumb-2

DMIPS/MHz 1.25

MPU Optional

Bus Arch.

ARM7

3

Arm/Thumb

0.95/0.70

No

Von Neumann

Cortex-M0

Von Neumann

Thumb(wT2)

0.84

No

3

Cortex-M0+

Von Neumann

Thumb(wT2)

0.93

Optional

2

Interrupts 1 - 2402 1-32 1-32

Area 0.17 mm20.34 mm2 0.04 mm2 0.04 mm2

Power 33 µW/MHz70µW/MHz 16 µW/MHz 11 µW/MHz

ARM® Cortex™-M0+

8

So what does this really mean for 8 and 16-bit cores?

ARM Cortex-M0+ Memory Map

9

No paging, swapping, or instruction set extensions common in 8 & 16 bit architectures

32-bit registers means 4GB address space

ARM Cortex-M0+ Instruction Efficiency

10

This means better memory usage and fewer clock cycles

32-bit means instruction set efficiency

ARM Cortex-M0+ vs common 8/16 bit cores

11

ARM Cortex-M0+ Summary

12

Shorter pipeline optimized for energy efficiency

Fetch Decode Execute

code ExeFetch De

More Options

New

Fast I/O Port

Micro Trace Buffer (MTB)

Re-locatable Vector Table

Memory Protection Unit (MPU)

From Cortex-M3

Full ARMv6-M compatible

More for less

Freescale Kinetis L

Kinetis Portfolio

Kinetis K-Series to Kinetis L-Series Migration

Kinetis L Superset Block Diagram

Kinetis L Bit Manipulation Engine

PeripheralsBMECore Accesses

Bit Manipulation Engine (BME) Decorated Stores

● AND, OR, XOR and Bit field insert (BFI)

Decorated Loads● Load and clear one bit (LAC1),

Load and Set one bit (LAS1), Unsigned bit field extract (UBFX)

Task Normal C Code Size BME Code Size Improvement

Logical XOR operation 12Bytes 6Bytes 50%

GPIOA_PDOR ^= 0x02; // Logical XOR

0000005E 0x.... LDR R0,??DataTable6_5 ;; 0x400ff00000000060 0x6800 LDR R0,[R0, #+0]00000062 0x2102 MOVS R1,#+200000064 0x4041 EORS R1,R1,R000000066 0x.... LDR R0,??DataTable6_5 ;; 0x400ff00000000068 0x6001 STR R1,[R0, #+0]

Uses 12 Bytes

// Macro used to generate hardcoded XOR address#define BME_XOR_ADDR(ADDR) (*(volatile uint32_t *)(((uint32_t)ADDR) | (3<<26))) BME_XOR_ADDR(&GPIOA_PDOR) = 0x02;

00000014 0x.... LDR R0,??DataTable6_6 ;; 0x4c0ff00000000016 0x2102 MOVS R1,#+200000018 0x6001 STR R1,[R0, #+0]

Uses 6 Bytes

Freedom Board

Freedom Board Overview

19

http://arw.io/37Ux

OpenSDA – Serial Debug Adapter

20

OpenSDA Circuit

GPIO

OpenSDA – Serial Debug Adapter

21

K20

Kinetis-L

SWD

UART0

Reset

D4

USB Host

OpenSDA

GPIO

USB

UART

SPI

MSD Bootloader

OpenSDAApplication

SW1

Lab 0 – Loading OpenSDA Applications

22

Verify OpenSDA Application

0 Unplug USB Cable if attached

1 Press and hold the reset button(SW1)

2Plug in USB cable to the OpenSDA USB connector labeled “SDA”

3 Release the reset button

4Open the removable drive labeled “BOOTLOADER”

Load OpenSDA Application

5 Double click on the file fsl_web.htm

6 Download and unzip the FRDM-KL25Z Quick Start Package

7Copy and Paste MSD-FRDM-KL25Z_Pemicro_v105.SDA to the “BOOTLOADER” removable drive

8

Unplug USB Cable and plug in again to the same USB connecter labeled “SDA”. This time do not press the reset button.

9You are now running the latest version of the OpenSDA MSD Application

This same basic procedure can be repeated to load other OpenSDA applications

Lab 0 – Loading OpenSDA Applications

23

Verify Current OpenSDA Application

10 Open the removable drive labeled FRDM-KL25Z

11 Double click on the file SDA_INFO.HTM

12 Allow to run blocked script if prompted

13 Web page will display OpenSDA application

Power Options

24

5V

5V

P5-9V_VIN

P3V3 CR

2032

Using the Freedom Board as a debugger?

25

Power Profiling

26

IJET-ARM

arw.io/37V0

Expansion Headers and Shields

27

D1D0

D2D3D4D5D6D7

D8D9

D10D11D12

D13GNDAREFD14D15

A5

A4A3A2A1A0

P5-9V_VIN

GNDGND

P5V_USBP3V3

RESETP3V3

SDA_PTD5

The outer rows of expansion pins are compatible with many shields on the market

Tri-Color LED

28

Tri-Color LED

29

CLV1A-FKB-CJ1M1F1BB7R4S3

Series & Options

Binning

Kinetis-L

LED

Cree and the Cree logo are registered trademarks of Cree, Inc.

PTB18

PTB19

PTD1(D13)

R

G

B

http://arw.io/37Uv

Capacitive Touch Slider

30

Kinetis-L

TSI0_CH09

TSI0_CH10

SPI FLASH Memory

31

Kinetis-LOpenSDA

SPIFlash

MMA8451Q Accelerometer

32

3-Axis 14-bit/8-bit Digital Accelerometer

Kinetis-LMMA8451Q

I2C0

INT1INT2

PTA14

PTA15

I2C

http://arw.io/37Uw

Introducing Arrow Cloud Connect

Lab 1 – My first Arrow Cloud Connect Project

34

0 Browse to arrow.transim.com/designweb

Lab 1 – My first Arrow Cloud Connect Project

35

1 Use Design Web to start to Arrow Cloud Connect arrow.transim.com/arrowcloudconnect

Lab 1 – My first Arrow Cloud Connect Project

36

2 Click the “Getting Started” icon from the tool bar

3 Register for your free account

Knowledge Base

37

Discussion Forums

38

Code Library

39

Accounts

40

Integrated Development Environment

41

42

Cont’d

4

5

6 Build Application

7 Save .s19 file to FRDM-LK25Z removable drive*

Click the “IDE/Compiler” icon from the toolbar

Lab 1 – My first Arrow Cloud Connect Project

8 If successful, the tri-color LED should be flashing in sequence

The Internet of (many) Things

44

Internet

So how big is the Internet of Things?

What is the Internet of Things(IoT)?

Billions and Billions and Billions!

So how does the Internet of Things actually work?

46

Internet

Ubiquitous device networks will require low cost and low power solutions

How to connect to the Internet?

Device Gateway

47

Internet

How are we going to connect today?

?

Lab 2 – Install Serial Driver

48

0

1Open “Device Manger” and locate the “PEMicro/Freescale – CDC Serial Port” device

2Right click on “PEMicro/Freescale – CDC Serial Port” deviceand select “Update Driver Software” *

Plug in USB cable to the OpenSDA USB connector labeled “SDA”

3 Choose to locate and install driver software manually.

4Browse and select “FRDM-KL25Z” has the drive location for search.

5When driver installation is complete you should see a device entry corresponding to the Freedom board serial port

49

Internet

What are we going to do with the data?

?

50

Internet

Client Server?

?

This is not a very scalable IoT application architecture

51

Internet

Set up a server?

?

How about “Cloud Computing”

52

Internet

What is Cloud Computing?

?

53

Cloud Computing Stack

Cloud Computing Stack

Application as a Service(AaaS)

Infrastructure as a Service(IaaS)

Platform as a Service(PaaS)

Cellular

Wired SatelliteServers

Storage

Data Center

Network Operations

Google App Engine

Arrow Cloud Connect

54

Internet of Things Stack

IoT Stack

Application as a Service(AaaS)

Device Network

Platform as a Service(PaaS)

Arrow Cloud Connect

Infrastructure as a Service(IaaS)

Thing

Device Gateway

Wireless Network

Connect Core i.MX53

55

Internet of Things with Arrow Cloud Connect

Lab 3 – Get Started with the iDigi Device Cloud

56

0

1

2

Select the “Make a Thing for the Internet” Wizard

Click the “Getting Started” icon from the tool bar

IMPORTANT: The iDigi registration process will send you a confirmation email to validate your account. Make sure you use an email address that you have access to right now!

If you already have an iDigi account you may skip this step.

57

3

4

5

Save to a readily available location on your computer

Install the iDigi Software Gateway and run

Lab 3 – Get Started with the iDigi Device Cloud

58

6

7

8

Log In to iDigi Software Gateway using iDigi account credentials

Verify that the iDigi Software Gateway is detected

Download and program application to Freedom Board(right-click, save as…)

Lab 3 – Get Started with the iDigi Device Cloud

59

9

10

Add device to iDigi Software Gateway

Select COM port of Freedom board and provide a descriptive name

Lab 3 – Get Started with the iDigi Device Cloud

60

11 Freedom board will Identify and Connect.

Verify that Freedom Board is detected

You may have to press reset button

12

13 You are now ready to create your IoT Application. Click to Go to the IDE.

Lab 3 – Get Started with the iDigi Device Cloud

Arrow Cloud Connect Dashboard Editor

61

Lab 4 – My First IoT Application

62

0

1

Click the “IDE/Compiler” icon from the toolbar

2 Build Application

3 Save .s19 file to FRDM-LK25Z removable drive*

Lab 4 – My First IoT Application

63

4

5 Configure Dashboard Devices

If successful, you should see messages from the Freedom Board displayed in the iDigi Software Gateway Message Log

Lab 4 – My First IoT Application

64

6

7 Name Dashboard

Build Dashboard(right click)

Lab 4 – My First IoT Application

65

8

9 Show the compiled Dashboard

Click on “Dashboards” icon on the toolbar

Lab 4 – My First IoT Application

66

10 Congratulations! Your first iDigi IoT device application is now on the air

Summary

Arrow Cloud Connect SummaryEnabling the Internet of Things

– Comprehensive end-to-end development platform

– Online GNU GCC compiler for Cortex M0+

– Dashboards tools

– Code libraries for rapid development

– Collaboration tools for development efficiency

– Hassle free activation

68

www.arrow.com/arrowcloudconnect

Questions?

william.antunes@arrowbrasil.com.br

top related