© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Opening the IoT with FreeRTOS
Richard Barry
I O T 3 4 0
Principal Engineer
Amazon Web Services
Agenda
The MIT licensed FreeRTOS kernel
Traditional use cases
Internet of things (IoT) use cases
Challenges of developing universal software
Developer support from our ecosystem
Open-source everything
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is the FreeRTOS kernel?
The FreeRTOS kernel is a small C
code library that implements
multithreading
RTO: kernel or scheduler?
RTOS
Executive
Scheduler
Small footprint
No scheduler
Ap
pli
cab
ilit
y
Processor power
Tens of thousands of RAM, hundreds of thousands of flash
≈40 architectures, ≈20 compilers
FreeRTOS
μCLinux, eCOS
Linux
Library that implements multithreading
Application design goals• 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
ISR
ISR
ISR
ISR
FreeRTOS downloads per month over 15 years
0
2,000
4,000
6,000
8,000
10,000
12,000
14,000
Do
wn
loa
ds
Date
Provide a free product that
surpasses the quality and service
of commercial alternatives
Enterprise-
friendly licensingUser obsession Rapid support
Robustness DocumentationWindows hosts
too
LeadershipKnowledgeable
supportControlled IP
Paid optionsDemonstrable
code qualityVibrant activity
FreeRTOS: Open-source, real-time kernel
Use cases
FreeRTOS kernel
User (application) code
Vendor-supplied libraries
Hardware
FreeRTOS
kernel
Third-party libraries
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Recent trends: IoT
Fleet onboarding,
management, and SW updates
Fleet audit and protection
IoT data analytics and intelligence
Secure device connectivity
and messaging
Internet connected
Functionality
Communications stack
Secure storage
Security stack
Bootloader
Over-the-air (OTA) update
Application without connectivity
User (application) code
Vendor-supplied libraries
Hardware
Application with secure connectivity
User (application) code
TLSKey
manage-
ment
MQTT
TCP/IP
Secure
storage
Vendor-supplied libraries
Hardware
Wi-fi
Provisioning OTA
Application view with FreeRTOS library integrations
User (application) code
Vendor-supplied libraries
Hardware
FreeRTOS
kernel
MQTT agent OTA agentAWS IoT Greengrass discovery
Middleware libraries
Simplified user experience
Evolving use cases: Wider applicability
Amazon
Cognito
AWS IoT
MQTT/HTTP/Websocket
Android/iOS SDKs
MQTT over Bluetooth
Low Energy
Android/iOS SDKs
Wi-fi provisioning over
Bluetooth Low Energy
MCU
MCU
MCU
MCU
Evolving software architecture
• Decoupled, standalone libraries
• Transport agnostic
• Multiple transports in a single application
• Working to making porting layers thinner
• Add to preexisting projects
• Add to autogenerated projects
Use cases: Common starting point
User (application) code
TCP/IP
Vendor-supplied libraries
Hardware
FreeRTOS
kernel
Use cases: Basic (often TCP/IP is offloaded)
User (application) code
TCP/IP
MQTT
Vendor-supplied libraries
Hardware
FreeRTOS
kernel
Use cases: All in Wi-fi
User (application) code
TLS
Key
manage-
ment
TCP/IP
MQTT
Secure
storage
Vendor-supplied libraries
Hardware
Wi-fi
Provisioning OTA
FreeRTOS
kernel
Use cases: All in Bluetooth Low Energy
User (application) code
TLS
Key
manage-
ment
TCP/IP
MQTT
Secure
storage
Vendor-supplied libraries
Hardware
Bluetooth Low
Energy
Provisioning OTA
FreeRTOS
kernel
Flexible user experience
Abstracted flexible user experience
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
FreeRTOS+Trace/Tracealyzer
• Shows real-time behavior of FreeRTOS systems
• Task scheduling
• FreeRTOS kernel calls
• Application events and data
• Interrupt handlers
• Commercially licensed
• Provided by Percepio AB
FreeRTOS+Trace/Tracealyzer
SEGGER SystemView
Threadspy
IAR thread aware and StateViewer plugins
OpenRTOS and SafeRTOS
• Provided by our strategic partner WITTENSTEIN high integrity systems, a global engineering company with more than 1,500 employees
• OPENRTOS is FreeRTOS but is distributed under standard commercial license terms
• The TÜV SÜD–certified SAFERTOS is derived from FreeRTOS but has been reengineered with safety as its primary objective
• Dedicated and private ticketed support
• Legal indemnification
• Commercial middleware
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Open-source kernel
• FreeRTOS
• Security & connectivity
Preconfigured
examples for
approximately 40
architectures and
20 tool chains,
not all of which
are open source
Open-source kernel, tools
• FreeRTOS
• Security & connectivity
• Eclipse based
• GCC
• LLVM
Open-source kernel, tools, emulators
• FreeRTOS
• Security & connectivity
• Eclipse based
• GCC
• LLVM
• Renode
• QEMU
Open-source kernel, tools, emulators, ISA, & hardware
• FreeRTOS
• Security & connectivity
• Eclipse based
• GCC
• LLVM
• Renode
• QEMU
• RISC-V
• PULP RI5KY
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
2018
2017
2016
Open source at Amazon
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
25+ additional free digital courses cover topics related to IoT, including:
Take the free digital curriculum, Internet of Things (IoT) Foundation Series, to build IoT skills and work through common scenarios
Learn IoT with AWS Training and Certification
• AWS IoT Core
• AWS IoT Greengrass
• AWS IoT Analytics
• AWS IoT Device Management
• AWS IoT Events
Visit the Learning Library at https://aws.training
Resources created by the experts at AWS to help you build IoT skills
Thank you!
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Richard Barry
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.