Applications Development on the ARM 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
ARM Cortex -M0+ 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
ARM Cortex -M0+ Low Latency I/O Interface I/O Interface provides Harvardlike access to peripherals Improves overall cycle efficiency for I/O access
ARM Cortex -M0+ Performance ARM7 Cortex-M4 Cortex-M0 Cortex-M0+ Pipeline 3 3 3 2 Bus Arch. Von Neumann Harvard ISA Arm/Thumb Thumb-2 Thumb(wT2) Thumb(wT2) DMIPS/MHz 0.95/0.70 1.25 0.84 0.93 MPU No Optional No Optional Interrupts 2 1-240 1-32 1-32 Area 0.34 mm2 0.17 mm2 0.04 mm2 0.04 mm2 Power 70µW/MHz 33 µw/mhz 16 µw/mhz 11 µw/mhz Von Neumann Von Neumann
ARM Cortex -M0+ So what does this really mean for 8 and 16-bit cores?
ARM Cortex-M0+ Memory Map 32-bit registers means 4GB address space No paging, swapping, or instruction set extensions common in 8 & 16 bit architectures
ARM Cortex-M0+ Instruction Efficiency 32-bit means instruction set efficiency This means better memory usage and fewer clock cycles
ARM Cortex-M0+ vs common 8/16 bit cores
ARM Cortex-M0+ Summary Fetch Decode Execute Fetch De code Exe Shorter pipeline optimized for energy efficiency From Cortex-M3 Re-locatable Vector Table Memory Protection Unit (MPU) New Fast I/O Port Micro Trace Buffer (MTB) Full ARMv6-M compatible More Options 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 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) GPIOA_PDOR ^= 0x02; BME Task Normal C Code Size Logical XOR operation 12Bytes // Logical XOR 0000005E 0x... LDR DataTable6_5 ;; 0x400ff000 00000060 0x6800 LDR 00000062 0x2102 MOVS 00000064 0x4041 EORS 00000066 0x... LDR DataTable6_5 ;; 0x400ff000 00000068 0x6001 STR Uses 12 Bytes Core Accesses R0,?? R0,[R0, #+0] R1,#+2 R1,R1,R0 R0,?? Peripherals BME Code Size Improvement 6Bytes 50% // 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... DataTable6_6 ;; 0x4c0ff000 00000016 0x2102 00000018 0x6001 R1,[R0, #+0] Uses 6 Bytes LDR R0,?? MOVS STR R1,#+2 R1,[R0, #+0]
Freedom Board
Freedom Board Overview http://arw.io/37ux
OpenSDA Serial Debug Adapter OpenSDA Circuit
OpenSDA Serial Debug Adapter GPIO MSD Bootloader D4 USB Host K20 GPIO UART USB OpenSDA Application OpenSDA Kinetis-L SW1 SPI Reset UART0 SWD
Lab 0 Loading OpenSDA Applications Verify OpenSDA Application Load OpenSDA Application 0 Unplug USB Cable if attached 5 Double click on the file fsl_web.htm 1 Press and hold the reset button(sw1) 6 Download and unzip the FRDM-KL25Z Quick Start Package 2 Plug in USB cable to the OpenSDA USB connector labeled SDA 7 3 Release the reset button Copy 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. 9 You are now running the latest version of the OpenSDA MSD Application 4 Open the removable drive labeled BOOTLOADER This same basic procedure can be repeated to load other OpenSDA applications
Lab 0 Loading OpenSDA Applications 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 5 V 5 V P 3 V 3 P59V_VI N CR 203 2
Using the Freedom Board as a debugger?
Power Profiling IJET-ARM arw.io/37v0
Expansion Headers and Shields SDA_PTD 5 P3V 3 RESET P3V 3 P5V_USB GND GND P5-9V_VIN A0 A1 A2 A3 A4 A5 D15 D14 AREF GND D13 D12 D11 D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0 The outer rows of expansion pins are compatible with many shields on the market
Tri-Color LED
Tri-Color LED CLV1A-FKB-CJ1M1F1BB7R4S3 Series & Options Binning Kinetis-L LED R PTB18 G PTB19 B PTD1(D13) Cree and the Cree logo are registered trademarks of Cree, Inc. http://arw.io/37uv
Capacitive Touch Slider Kinetis-L TSI0_CH09 TSI0_CH10
SPI FLASH Memory OpenSDA Kinetis-L SPI Flash
MMA8451Q Accelerometer 3-Axis 14-bit/8-bit Digital Accelerometer MMA8451Q I2C INT1 INT2 Kinetis-L I2C0 PTA14 PTA15 http://arw.io/37uw
Introducing Arrow Cloud Connect
Lab 1 My first Arrow Cloud Connect Project 0 Browse to arrow.transim.com/designweb
Lab 1 My first Arrow Cloud Connect Project 1 Use Design Web to start to Arrow Cloud Connect arrow.transim.com/arrowcloudconnect
Lab 1 My first Arrow Cloud Connect Project 2 Click the Getting Started icon from the tool bar 3 Register for your free account
Knowledge Base
Discussion Forums
Code Library
Accounts
Integrated Development Environment
Lab 1 My first Arrow Cloud Connect Project Cont d 4 Click the IDE/Compiler icon from the toolbar 5 6 Build Application 7 Save.s19 file to FRDM-LK25Z removable drive* 8 If successful, the tri-color LED should be flashing in sequence
The Internet of (many) Things
What is the Internet of Things(IoT)? Internet So how big is the Internet of Things?
Billions and Billions and Billions! So how does the Internet of Things actually work?
How to connect to the Internet? Internet Device Gateway Ubiquitous device networks will require low cost and low power solutions
How are we going to connect today?? Internet
Lab 2 Install Serial Driver 0 Plug in USB cable to the OpenSDA USB connector labeled SDA 1 Open Device Manger and locate the PEMicro/Freescale CDC Serial Port device 2 Right click on PEMicro/Freescale CDC Serial Port device and select Update Driver Software * 3 Choose to locate and install driver software manually. 4 Browse and select FRDM-KL25Z has the drive location for search. 5 When driver installation is complete you should see a device entry corresponding to the Freedom board serial port
What are we going to do with the data?? Internet
Client Server?? Internet This is not a very scalable IoT application architecture
Set up a server?? Internet How about Cloud Computing
What is Cloud Computing?? Internet
Cloud Computing Stack Cloud Computing Stack Application as a Service (AaaS) Arrow Cloud Connect Platform as a Service (PaaS) Google App Engine Wired Satellite Cellular Infrastructure as a Service (IaaS) Servers Data Center Storage Network Operations
Internet of Things Stack IoT Stack Application as a Service (AaaS) Arrow Cloud Connect Platform as a Service (PaaS) Device Gateway Infrastructure as a Service (IaaS) Wireless Network Device Network Thing Connect Core i.mx53
Internet of Things with Arrow Cloud Connect
Lab 3 Get Started with the idigi Device Cloud 0 Click the Getting Started icon from the tool bar 1 Select the Make a Thing for the Internet Wizard 2 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.
Lab 3 Get Started with the idigi Device Cloud 3 4 Save to a readily available location on your computer 5 Install the idigi Software Gateway and run
Lab 3 Get Started with the idigi Device Cloud 6 Log In to idigi Software Gateway using idigi account credentials 7 Verify that the idigi Software Gateway is detected 8 Download and program application to Freedom Board(right-click, save as )
Lab 3 Get Started with the idigi Device Cloud 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 11 Freedom board will Identify and Connect. You may have to press reset button 12 Verify that Freedom Board is detected 13 You are now ready to create your IoT Application. Click to Go to the IDE.
Arrow Cloud Connect Dashboard Editor
Lab 4 My First IoT Application 0 Click the IDE/Compiler icon from the toolbar 1 2 Build Application 3 Save.s19 file to FRDM-LK25Z removable drive*
Lab 4 My First IoT Application 4 If successful, you should see messages from the Freedom Board displayed in the idigi Software Gateway Message Log 5 Configure Dashboard Devices
Lab 4 My First IoT Application 6 Build Dashboard(right click) 7 Name Dashboard
Lab 4 My First IoT Application 8 Click on Dashboards icon on the toolbar 9 Show the compiled Dashboard
Lab 4 My First IoT Application 10 Congratulations! Your first idigi IoT device application is now on the air
Summary
Arrow Cloud Connect Summary Enabling 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 www.arrow.com/arrowcloudconnect
Questions? william.antunes@arrowbrasil.com.br