copyright 2018 amazon web services · that new image is ready application activates when it is...

40
Copyright 2018 Amazon Web Services

Upload: others

Post on 03-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

Copyright 2018 Amazon Web Services

Page 2: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

Copyright 2018 Amazon Web Services

Richard Barry Founder – FreeRTOS Project

Principal Engineer – Amazon Web Services

Page 3: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

Copyright 2018 Amazon Web Services

The FreeRTOS kernel, and Traditional Use Cases

Design Goals

Differences from General Purpose Operating Systems

IoT Relevant AWS Cloud Services

Amazon FreeRTOS Libraries

Amazon FreeRTOS, Connected Use Cases

Page 4: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

Copyright 2018 Amazon Web Services

It is a kernel, or scheduler, or RTOS, depending who you ask

15 Year Heritage

MIT Licensed C Code and Pre-configured Projects

Page 5: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

Copyright 2018 Amazon Web Services

Real Time Linux

Processor power

μCLinux, eCOS

No Scheduler FreeRTOS

Ap

plic

abili

ty

10s of K of RAM 100s of K of Flash

Page 6: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

Rapid Support

Windows Host

Visible Activity

Leadership Documentation

Demonstrable Code Quality

Customer Obsession

Knowledgeable Support

Paid Options

Robustness

No IP Infringement

Enterprise Friendly Licensing Copyright 2018 Amazon Web Services

Page 7: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

Copyright 2018 Amazon Web Services

Month

0

2,000

4,000

6,000

8,000

10,000

12,000

14,000

Do

wn

load

s

Page 8: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

Copyright 2018 Amazon Web Services 8

Source File Downloads

FreeRTOS.org

SVN

aws.amazon.com/FreeRTOS

GitHub

Page 9: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

Copyright 2018 Amazon Web Services

Blocked Task 2

Top of Stack for Task

Rn Copy

R1 Copy

R0 Copy

Status Register

Program Counter Copy

Stack Variable

Stack Variable

Return Address

Empty Stack Space

Empty Stack Space

Blocked Task 1

Top of Stack for Task

Rn Copy

R1 Copy

R0 Copy

Status Register

Program Counter Copy

Stack Variable

Stack Variable

Return Address

Empty Stack Space

Empty Stack Space

Ready Task 1

Top of Stack for Task

Rn Copy

R1 Copy

R0 Copy

Status Register

Program Counter Copy

Stack Variable

Stack Variable

Return Address

Empty Stack Space

Empty Stack Space

Rn

R1

R0

Stack Pointer

Program Counter

Running Task

Top of Stack for Task

Empty Stack Space

Empty Stack Space

Empty Stack Space

Empty Stack Space

Empty Stack Space

Empty Stack Space

Stack Variable

Stack Variable

Return Address

Empty Stack Space

Empty Stack Space

Page 10: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

Copyright 2018 Amazon Web Services

User (Application) Code

Vendor Supplied Libraries

Hardware

FreeRTOS

Kernel

[Middleware Libraries]

Page 11: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

Copyright 2018 Amazon Web Services

Page 12: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

Copyright 2018 Amazon Web Services

Page 13: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

Copyright 2018 Amazon Web Services

Page 14: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

Copyright 2018 Amazon Web Services

Depends on the application, but generally:

Meet real time requirements!

Maximize responsiveness

Use as little CPU/Power as possible

Maximize maintainability

Maximize portability (hardware change)

Simplicity!

Fast to market

Meet requirements with minimum expenditure

Page 15: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

Copyright 2018 Amazon Web Services

LCD

Alarm Annunciator ADC Input

Keypad Input

Timer

Motor Position

CAN Request

Commutation

/Control Motor

Formatting Flash Disk

CAN Driver/

Protocol

CAN Response

Convert and

Display

Page 16: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

Copyright 2018 Amazon Web Services

ISR

ISR

Page 17: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

Function1_Run();

Function4_Run();

Function3_Run();

Function2_Run();

Copyright 2018 Amazon Web Services

Page 18: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

ISR

ISR

Copyright 2018 Amazon Web Services

Page 19: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

DoSomething()

A Task

xStreamBufferReceive()

ProcessBytes()

DoSomething()

An Interrupt

xStreamBufferSendFromISR()

Stream Buffer

Copyright 2018 Amazon Web Service

Page 20: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

Copyright 2018 Amazon Web Services

Page 21: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

xStreamBufferReceive()

Copyright 2018 Amazon Web Services 21

Suspended

Blocked

Ready Running

Tick event if timeout / Trigger level hit if no timeout

Page 22: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

Copyright 2018 Amazon Web Services

Page 23: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

On-demand delivery of compute power, databases, applications, etc. via the internet, >125 services

Pay-as-you-go pricing

Copyright 2018 Amazon Web Services

Page 24: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

Copyright 2018 Amazon Web Services

Fleet onboarding, management and

SW updates

Fleet audit and protection

IoT data analytics and intelligence

Cloud

Storage & Compute

Intelligence

Insights & Logic → Action

Secure device connectivity

and messaging

Page 25: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

Copyright 2018 Amazon Web Services

Endpoints

Fleet onboarding, management and

SW updates

Fleet audit and protection

IoT data analytics and intelligence

Gateway

Things

Sense & Act

Cloud

Storage & Compute

Secure local triggers, actions,

and data sync

Intelligence

Insights & Logic → Action

Secure device connectivity

and messaging

Page 26: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

Copyright 2018 Amazon Web Services

Page 27: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

Copyright 2018 Amazon Web Services

Functionality

Communications

Stack

Security Stack

Key Management

OTA

Bootloader

Page 28: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

User (Application) Code

Vendor Supplied Libraries

Hardware

FreeRTOS

Kernel

Copyright 2018 Amazon Web Services

Page 29: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

MQTT I/O Port Key

Manage-

ment

MQTT

User (Application) Code

Amazon FreeRTOS Libraries

Secure

Storage

Vendor Supplied Libraries

Hardware

Wi-Fi TLS Library

TCP/IP FreeRTOS

Kernel

Copyright 2018 Amazon Web Services

Page 30: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

Copyright 2018 Amazon Web Services

ISR

ISR

ISR

ISR

Page 31: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

Copyright 2018 Amazon Web Services

Developer authors update

Upload to cloud and sign image

Schedule an update job

Notify device update is available

Page 32: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

Copyright 2018 Amazon Web Services

Developer authors update

Upload to cloud and sign image

Schedule an update job

Notify device update is available

Device downloads image (or streams

over MQTT) Write image to flash

Close file and verify signature

Notify application that new image is

ready

Application activates when it is ready (set boot flags and reset)

Page 33: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

Copyright 2018 Amazon Web Services

Developer authors update

Upload to cloud and sign image

Schedule an update job

Notify device update is available

Device downloads image (or streams

over MQTT) Write image to flash

Close file and verify signature

Notify application that new image is

ready

Application activates when it is ready (set boot flags and reset)

Verify image at boot Initialize OTA agent and confirm current

image is latest

Hand control to application for self

test

On passing self test, commit new image

Update cloud status to completed.

Page 34: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

MQTT I/O Port Key

Manage-

ment

MQTT

User (Application) Code

Amazon FreeRTOS Libraries

Secure

Storage

Vendor Supplied Libraries

Hardware

Wi-Fi TLS Library

TCP/IP FreeRTOS

Kernel

Copyright 2018 Amazon Web Services

Page 35: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

Copyright 2018 Amazon Web Services

ISR

ISR

ISR

ISR

Page 36: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

User (Application) Code

Vendor Supplied Libraries

Hardware

FreeRTOS

Kernel

MQTT Agent OTA Agent Greengrass Discovery

Copyright 2018 Amazon Web Services

Amazon FreeRTOS Libraries

Page 37: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

Copyright 2018 Amazon Web Services

Detect Anomalies to Predict Pump Failure

Page 39: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

Copyright 2018 Amazon Web Services

Predict Crop Quality

Page 40: Copyright 2018 Amazon Web Services · that new image is ready Application activates when it is ready (set boot flags and reset) Verify image at boot Initialize OTA agent and confirm

Copyright 2018 Amazon Web Services

Global Mining Company Minimizes Unexpected Downtime