Copyright 2018 Amazon Web Services
Copyright 2018 Amazon Web Services
Copyright 2018 Amazon Web Services
Richard Barry Founder – FreeRTOS Project
Principal Engineer – Amazon Web Services
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
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
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
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
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
Copyright 2018 Amazon Web Services 8
Source File Downloads
FreeRTOS.org
SVN
aws.amazon.com/FreeRTOS
GitHub
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
Copyright 2018 Amazon Web Services
User (Application) Code
Vendor Supplied Libraries
Hardware
FreeRTOS
Kernel
[Middleware Libraries]
Copyright 2018 Amazon Web Services
Copyright 2018 Amazon Web Services
Copyright 2018 Amazon Web Services
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
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
Copyright 2018 Amazon Web Services
ISR
ISR
Function1_Run();
Function4_Run();
Function3_Run();
Function2_Run();
Copyright 2018 Amazon Web Services
ISR
ISR
Copyright 2018 Amazon Web Services
DoSomething()
A Task
xStreamBufferReceive()
ProcessBytes()
DoSomething()
An Interrupt
xStreamBufferSendFromISR()
Stream Buffer
Copyright 2018 Amazon Web Service
Copyright 2018 Amazon Web Services
xStreamBufferReceive()
Copyright 2018 Amazon Web Services 21
Suspended
Blocked
Ready Running
Tick event if timeout / Trigger level hit if no timeout
Copyright 2018 Amazon Web Services
On-demand delivery of compute power, databases, applications, etc. via the internet, >125 services
Pay-as-you-go pricing
Copyright 2018 Amazon Web Services
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
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
Copyright 2018 Amazon Web Services
Copyright 2018 Amazon Web Services
Functionality
Communications
Stack
Security Stack
Key Management
OTA
Bootloader
User (Application) Code
Vendor Supplied Libraries
Hardware
FreeRTOS
Kernel
Copyright 2018 Amazon Web Services
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
Copyright 2018 Amazon Web Services
ISR
ISR
ISR
ISR
Copyright 2018 Amazon Web Services
Developer authors update
Upload to cloud and sign image
Schedule an update job
Notify device update is available
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)
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.
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
Copyright 2018 Amazon Web Services
ISR
ISR
ISR
ISR
User (Application) Code
Vendor Supplied Libraries
Hardware
FreeRTOS
Kernel
MQTT Agent OTA Agent Greengrass Discovery
Copyright 2018 Amazon Web Services
Amazon FreeRTOS Libraries
Copyright 2018 Amazon Web Services
Detect Anomalies to Predict Pump Failure
https://www.FreeRTOS.org
https://freertos.org/FreeRTOS-quick-start-guide.html
https://www.freertos.org/Documentation/RTOS_book.html
https://aws.amazon.com/freertos
Copyright 2018 Amazon Web Services
Copyright 2018 Amazon Web Services
Predict Crop Quality
Copyright 2018 Amazon Web Services
Global Mining Company Minimizes Unexpected Downtime