<<

Intel® Quark™ Software (® QMSI)

Malcolm Prinn,

October 2016 Intel® QMSI quick facts

. Hardware Abstraction Layer written in

. ~100k LoC

. Supports most Intel® Quark™ MCU SoCs

. Small code size / stack usage

. Low power functionality

Optimization Notice Copyright © 2016, Intel Corporation. All rights reserved. 2 *Other names and brands may be claimed as the property of others. Customer Apps

Intel® system studio for

Zephyr OS (Comms. Stacks)

Libs TinyCrypt IPPM

Intel® QMSI

Intel® Quark™ Microcontrollers (MCUs) D2000 C1000

Optimization Notice Copyright © 2016, Intel Corporation. All rights reserved. 3 *Other names and brands may be claimed as the property of others. Intel® Quark™ MCU family

Optimization Notice Copyright © 2016, Intel Corporation. All rights reserved. 4 *Other names and brands may be claimed as the property of others. Intel® Quark™ microcontroller D2000 Intel® Quark™ SoC Power Lakemont- ULP @32MHz Interfaces Subsystem . Ultra low power, Entry Level UART PWM / 8k SRAM Pwr. Supply & Distr. . 32MHz, 32-bit Microcontroller, 32kB Flash, 8kB SRAM I2C SPI (M/S) 8k OTP Battery Mgmt. GPIO . Scalable Kit, with ADC sample apps and libraries 32k Intg. Power Mgmt. Flash Comparator RTC

. Pre-validated comms and modules Memory Memory Subsystem 2 ch DMA WDT JTAG & Debug Support

. Full Intel® x86 instruction set architecture for compatibility and scalability

Optimization Notice Copyright © 2016, Intel Corporation. All rights reserved. 5 *Other names and brands may be claimed as the property of others. InteL® Quark™ SE microcontroller C1000 Intel® Quark™ SoC Peripheral Interfaces Power Lakemont- ULP UART Pattern Matching Engine Subsystem . High-efficiency power consumption @32MHz ARC PWM / I2C (M/S) GPIO Pwr. Supply & Distr. . 32MHz, 32-bit x86 Microcontroller @32MHz Timer . 384Kb Flash, 80kB SRAM SPI (M/S) I2S Mailbox 80k SRAM Battery Mgmt. . Scalable Software Development Kit, with sample apps and libraries WDT RTC AON GPIO 8k OTP Power Mgmt. . Pre-validated comms and sensor modules USB 1.1 Comparator 2x 192kB Intg. Flash Sensor SubSystem . Full Intel® x86 instruction set architecture for compatibility and scalability

Memory Memory Subsystem 8 ch DMA ADC GPIO I2C SPI JTAG & Debug Support

. Always sensing: always-listening Internal Sensor Hub

. Intelligent: Pattern Matching Engine

Optimization Notice Copyright © 2016, Intel Corporation. All rights reserved. 6 *Other names and brands may be claimed as the property of others. Customer Apps

Intel® system studio for Microcontrollers

Zephyr OS (Comms. Stacks)

Libs TinyCrypt IPPM

Intel® QMSI

Intel® Quark™ MCUs D2000 C1000

Optimization Notice Copyright © 2016, Intel Corporation. All rights reserved. 7 *Other names and brands may be claimed as the property of others. Intel® Quark™ Microcontroller Software Interface

. Intel® Quark™ Microcontrollers Hardware Abstraction Layer (HAL)

. APIs provide a standard interface to all functionality in Intel® Quark™ microcontrollers.

. APIs are consistent across the Intel® Quark™ microcontroller family of devices.

. Included with this API are a collection of sample applications to enable users to get started quickly.

. Embedded devices with a limited amount of memory, . Object code size & stack size minimization is a primary design objective. . Everything accessed as MMIO. . Nothing is dynamic, all the heavy work is done at compile time. . Garbage collection on unused functionality.

Optimization Notice Copyright © 2016, Intel Corporation. All rights reserved. 8 *Other names and brands may be claimed as the property of others. Intel® QMSI

Firmware Mailbox DMA ADC RTC Upgrade

InterruptInterrupt Boot loader AON Pin muxing WDT managementmanagement

AONAON Periodic ARC support Power states I2C GPIO Timer

X86 support Flash Comparators SPI

Memory SoC support IdentificationIdentification UART PWM protection

Optimization Notice Copyright © 2016, Intel Corporation. All rights reserved. 9 *Other names and brands may be claimed as the property of others. Bootloader / ROM

. Bootstrap

. TRIM code calculation

. update management . Host tools also provided (fork of DFU utils)

. Un-brick me

Optimization Notice Copyright © 2016, Intel Corporation. All rights reserved. 10 *Other names and brands may be claimed as the property of others. Boot flow Reset

Assembly Start-up

Primary peripherals

Un-brick me

Secondary Flash Start ARC peripherals controllers

Start Sanitize Lakemont bootloader

Power Firmware down mgmt.

Optimization Notice Copyright © 2016, Intel Corporation. All rights reserved. 11 *Other names and brands may be claimed as the property of others. Clocking Crystal Oscillator 32 MHz Crystal determines I2C Enable accuracy ~4mA

Silicon Oscillator Selector Prescaler I2C 4/8/16/32 MHz System clock +/- 20000ppm accuracy source 450uA@32MHz Prescaler SPI

RTC oscillator Prescaler RTC 32768 Hz AON Periodic Prescaler Timer RTC clock source Prescaler WDT

Optimization Notice Copyright © 2016, Intel Corporation. All rights reserved. 12 *Other names and brands may be claimed as the property of others. Power states - D2000

RST_N

Active Wake Event Wake

Halt Deep Sleep

Optimization Notice Copyright © 2016, Intel Corporation. All rights reserved. 13 *Other names and brands may be claimed as the property of others. Power states - C1000

Optimization Notice Copyright © 2016, Intel Corporation. All rights reserved. 14 *Other names and brands may be claimed as the property of others. Sample Real Time Clock driver usage

RTC configuration structure

Register / request

Enable clocking to RTC

Set configuration and start RTC

Optimization Notice Copyright © 2016, Intel Corporation. All rights reserved. 15 *Other names and brands may be claimed as the property of others. Customer Apps

Intel® system studio for Microcontrollers

Zephyr OS (Comms. Stacks)

Libs TinyCrypt IPPM

Intel® QMSI

Intel® Quark™ MCUs D2000 C1000

Optimization Notice Copyright © 2016, Intel Corporation. All rights reserved. 16 *Other names and brands may be claimed as the property of others. Newlib syscalls

. Pico printf . Modular, support for formats can be disabled at compile time . Supports ‘d’, ‘u’, ‘x’, ‘X’ and ‘s’

. Puts

. Malloc / free

. Assert

Optimization Notice Copyright © 2016, Intel Corporation. All rights reserved. 17 *Other names and brands may be claimed as the property of others. Toolchain

GDB

OpenOCD based GCC ARC GCC JTAG

Bare metal / RTOS code

Intel® Quark™ microcontroller-based systems

https://software.intel.com/en-us/articles/issm-toolchain-only-download

Optimization Notice Copyright © 2016, Intel Corporation. All rights reserved. 18 *Other names and brands may be claimed as the property of others. Customer Apps

Intel® system studio for Microcontrollers

Zephyr OS (Comms. Stacks)

Libs TinyCrypt IPPM

Intel® QMSI

Intel® Quark™ MCUs D2000 C1000

Optimization Notice Copyright © 2016, Intel Corporation. All rights reserved. 19 *Other names and brands may be claimed as the property of others. TinyCrypt Library

. The TinyCrypt Library provides an implementation for constrained devices of a minimal set of standard cryptography primitives.

TinyCrypt HMAC- SHA-256 AES-128 ECC-DH SHA256

HMAC- AES-CBC AES-CTR ECC-DSA PRNG mode mode

AES- CMAC AES-CCM CTR- mode mode PRNG

Optimization Notice Copyright © 2016, Intel Corporation. All rights reserved. 20 *Other names and brands may be claimed as the property of others. Customer Apps

Intel® system studio for Microcontrollers

Zephyr OS (Comms. Stacks)

Libs TinyCrypt IPPM

Intel® QMSI

Intel® Quark™ MCUs D2000 C1000

Optimization Notice Copyright © 2016, Intel Corporation. All rights reserved. 21 *Other names and brands may be claimed as the property of others. Intel® Performance Primitives for Microcontrollers

. Supported data types Functional Groups . Fixed point: q15, q31 . Floating point: 32f (using Basic floating point ) Fast Math Complex Math Math . Optimization criteria . Size (~1 KB per function) . Performance Statistical Filtering Transform . Accuracy Functions Functions Functions . Power consumption

Interpolatio Matrix Controllers n Functions Functions Functions

Optimization Notice Copyright © 2016, Intel Corporation. All rights reserved. 22 *Other names and brands may be claimed as the property of others. Floating Point Library

. Only applicable to Intel® Quark™ Lakemont cores

. Floating Point . The Floating Point Library emulates floating point operations with hardware integer instructions. . Compatible with the Intel® MCU Architecture ; supports Intel® ® processor instruction set minus instructions for floating point unit. . Fixed point data format . Intel® IPP for Microcontrollers functions operate on fixed-point data in Qn format. . Example : X in the Q15 format is X*2-15, with the range of supported values for the Ipp16s data type equal to [-1, 1-2-15].

Optimization Notice Copyright © 2016, Intel Corporation. All rights reserved. 23 *Other names and brands may be claimed as the property of others. Customer Apps

Intel® system studio for Microcontrollers

Zephyr OS (Comms. Stacks)

Libs TinyCrypt IPPM

Intel® QMSI

Intel® Quark™ MCUs D2000 C1000

Optimization Notice Copyright © 2016, Intel Corporation. All rights reserved. 24 *Other names and brands may be claimed as the property of others. Zephyr Applications

CoAP, MQTT, HTTP, LWM2M

DTLS, TLS, ..

UDP, TCP Low Energy

IPv4, IPv6 6LowPAN

Power Management Device Management

Device Drivers

QMSI

Microkernel

Nanokernel

Optimization Notice Copyright © 2016, Intel Corporation. All rights reserved. 25 *Other names and brands may be claimed as the property of others. Customer Apps

Intel® system studio for Microcontrollers

Zephyr OS (Comms. Stacks)

Libs TinyCrypt IPPM

Intel® QMSI

Intel® Quark™ MCUs D2000 C1000

Optimization Notice Copyright © 2016, Intel Corporation. All rights reserved. 26 *Other names and brands may be claimed as the property of others. Intel® System Studio for Microcontrollers

. Bundles components into a Software Development Kit (SDK) . Integrated Development Environment (IDE) . Based on Eclipse . Intel® System Studio for Microcontrollers plugins . SoC integration . Windows USB Driver for: . Intel® Quark™ Microcontroller D2000 Development Board . Intel® Quark™ SE C1000 Development Board

Optimization Notice Copyright © 2016, Intel Corporation. All rights reserved. 27 *Other names and brands may be claimed as the property of others. Intel® system studio for Microcontrollers in action

Disassembly Code

Registers

Optimization Notice Copyright © 2016, Intel Corporation. All rights reserved. 28 *Other names and brands may be claimed as the property of others. Customer Apps

Intel® system studio for Microcontrollers

Zephyr OS (comms. Stacks)

Libs TinyCrypt IPPM

Intel® QMSI

Intel® Quark™ MCUs D2000 C1000

Optimization Notice Copyright © 2016, Intel Corporation. All rights reserved. 29 *Other names and brands may be claimed as the property of others. Build upon already existing example applications

Accelerometer CryptographyMailbox DMA PWMADC VersionRTC

Always-on Interrupt DMA AON I2CCounter Pin RTCmuxing GroveWDT Shields Counters management

AON Periodic Blinky PowerFlash Access states Identifaction I2CSPI D2000GPIO Power Timer

Clib FlashGPIO Mailbox TimersSPI C1000Timers Power

Clock Memory Hello World IdentificationPIC Timer UART GyroscopePWM Divisors protection

Optimization Notice Copyright © 2016, Intel Corporation. All rights reserved. 30 *Other names and brands may be claimed as the property of others. Where to get Intel® QMSI™

Intel® Developer Zone: https://software.intel.com/en-us/intel-system-studio-microcontrollers

Optimization Notice Copyright © 2016, Intel Corporation. All rights reserved. 31 *Other names and brands may be claimed as the property of others. Github.com/quark-mcu

Optimization Notice Copyright © 2016, Intel Corporation. All rights reserved. 32 *Other names and brands may be claimed as the property of others. Intel® Community

Intel® Quark™ Microcontroller Forum: https://communities.intel.com/community/tech/microcontrollers

Optimization Notice Copyright © 2016, Intel Corporation. All rights reserved. 33 *Other names and brands may be claimed as the property of others. Legal Disclaimer & Optimization Notice

INFORMATION IN THIS DOCUMENT IS PROVIDED “AS IS”. NO LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS DOCUMENT. INTEL ASSUMES NO LIABILITY WHATSOEVER AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO THIS INFORMATION INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT.

Software and workloads used in performance tests may have been optimized for performance only on Intel . Performance tests, such as SYSmark and MobileMark, are measured using specific systems, components, software, operations and functions. Any change to any of those factors may cause the results to vary. You should consult other information and performance tests to assist you in fully evaluating your contemplated purchases, including the performance of that product when combined with other products.

Copyright © 2016, Intel Corporation. All rights reserved. Intel, Pentium, , , Core, VTune, Cilk, and the Intel logo are trademarks of Intel Corporation in the U.S. and other countries.

Optimization Notice Intel’s may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. -dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice. Notice revision #20110804

Optimization Notice Copyright © 2016, Intel Corporation. All rights reserved. 34 *Other names and brands may be claimed as the property of others. 35