FreeRTOS on RISC-V …and Open Source @ Amazon

Richard Barry Founder, FreeRTOS Project Principal Engineer, AWS IoT

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Agenda

The FreeRTOS Kernel Open Source at Amazon Running FreeRTOS on RISC-V

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. FreeRTOS—Open source real time kernel

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Small footprint

Linux 10s of K of ram 100s of K of flash μCLinux, eCOS

FreeRTOS Applicability

No Scheduler

Processor power

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Library that implements multithreading

Application Design Goals:

• Meet real time requirements!

• Maximize responsiveness ISR • Use as little CPU/Power as possible • Maximize maintainability ISR • Maximize portability (hardware change) • Simplicity! • Fast to market • Meet requirements with minimum expenditure

ISR

ISR

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Provide a free product that surpasses the quality and service of commercial alternatives.

Enterprise User obsession Rapid support friendly licensing Windows hosts Robustness Documentation too Knowledgeable Leadership Controlled IP support Demonstrable Paid options Vibrant activity code quality

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. FreeRTOS downloads per month over 15 years

14,000

12,000

10,000

8,000

6,000

Downloads 4,000

2,000

0

Date

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Use Cases

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS in the cloud and at the edge

Things Cloud Sense & Act Storage & Compute

Secure local Secure device Fleet Fleet IoT data triggers, actions, connectivity onboarding, audit and analytics and and data sync and messaging management protection intelligence Endpoints and SW updates Gateway

Intelligence Insights & Logic → Action

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Open Source @ Amazon

© 2019,2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark gerrit-check scapy

gradle fast align apache phoenix lombok tez

2016 capybara cbmc pygresql cmock dovecot appium libarchive esp-open-rtos jcommander zipper hue mariadb-connector-j github-plugin mysql workbench libsoup eclipse paho little proxy little cnn w o devkit iot aws californium pyzmq cocoapods rails elastalert redis appium-gulp-plugin street address street xcpretty google guava wing apache hive fabric apache joshua catwatch libfuse webdriveragent sync debugger remote appium wycheproof

grpc appium-chromedriver django-debug-toolbar oci-fetch yubico ansible gulp-typescript yarn mqtt boto 3 uml-utilities ldns bixie pig

ec aeag picker react daterange scikit-fuzzy react-hot-loader mshadow spark apache appium-android-bootstrap libgxps safe-eval postgresql presto iu kernel linux glib rosette wordpress apache commons dbutils grpc-go joshua decoder parquet-mr lantram akka glib-networking dynamic-object chromium vim appiumadb docker fop presto hadoop apache 2 -webkit-debug-proxy gvsbuild assertj-core statsd backend apache commons lang dynamodb-milkhatx java qemu

apache pig apache word segmentation goa

logstash-input-udp ruby-simple-queue

immutables.org mvel databind jackson hana openfire tupl moses nginx iputils netty

tsung treeextra chromium s3_file

wired tiger httpclient httpcomponents aeokwbrvragent webdriver facebook red red hat -retry filequeue go-dockerclient aws-scala beanstalker sentry apache mxnet leveldb xen troposphere apache oozie

containerd pkg errors go-winio dpdk celery dynamodb backend apache zeppelin elephas

bandit gpyopt go lang kinesalite go-statsd-client apache commons io apache bigtop yield-java open fire elasticsearch cloud-init

kenlm ews java api rebouncer botoflow parquet-python apache ant haproxy mqtt js glisten apache tomcat apache

exoplayer tooltips angular appium-dot-exe airflow apache hbase sys-proctable -bigstore ultipart-parser p5-protocol-http2 dtcoretext cmis_5 react-native

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. tslint-eslint-rules gbm java apache (http server) cerebro glib alks-cli oss-attribution-generator gerrit-check incubator mxnet web socket sharp rollbar linux (kvm) hue rgp netlink jgi cni scapy tabular json11 fast align postcss-extract-animations r509-ocsp-responder flink tez emscripten lmdbjava gucumber security security monkey

linux-nvme-cli t licensee lombok dovecot smack

aalto-xml homebrew pygresql

nodejs gpy 2017 wing slight.alexa gpyoptapache phoenix libarchive capybara jcommander tslint appium little proxy little typescript-fsa zipper moby cmock gradle cbmc esp-open-rtos github-plugin elastalert libsoup mariadb-connector-j kappa irate mysql workbench plantuml-syntax eclipse paho pyzmq cnn cocoapods cmis_5

flask-sqlalchemy devkit iot aws tensorboard

git lfs git rails fortune fortune server 389ds appium-gulp-plugin californium pkcs7pad wycheproof sockeye google guava redis xcpretty address street wing goa

tinyxml12 xenbits openjdk phoenix open mpi

catwatch sync plus tacacs apache hive fabric libfuse sqoop webdriveragent

yubico chart.js

s2n libc django-debug-toolbar yarn apache joshua

apache spark astrum ex_aws oci-fetch moto

ansible debugger remote appium yarn picker react daterange

grpc appium-chromedriver apache beam wycheproof

boto 3 uml-utilities mysql scikit-fuzzy bixie react-hot-loader mshadow keras pig gulp-typescript

safe-eval FreeRTOS ompi libgxps ldns mqtt grpc-go dmlc kernel linux appium-android-bootstrap apache commons dbutils joshua decoder lantram ublockorigin apache hadoop parquet-mr presto typescript-json-schema

a a boogieman bam bam react-native-swipeout glib geckodriver glib-openssl linux (pm) linux xfs counterfeiter dynamic-object libjson akka peewee appiumadb glib-networking rosette firefox chromium vim fop assertj-core gvsbuild docker presto hadoop apache 2 ios-webkit-debug-proxy lang go qemu statsd backend tercom

word segmentation (nvme) linux dynamodb-milkhatx wordpress

apache pig apache mvel apache ant apache nginx libmoon apache commons lang openfire gsettings-test eslint dpdk immutables.org logstash-input-udp moses iputils tsung ruby-simple-queue hana webhooks netty

chromium s3_file wired tiger wingtk tupl databind jackson bencode-go multi-module-maven-release-plugin treeextra liblouis aws-scala curator sentry rspec-retry filequeue ts-test go-btrfs gpyopt parsimonious kotlin httpclient httpcomponents agent webdriver facebook autovpn beanstalker

libkv cmake

linux-pci leveldb go-dockerclient rust sequel apache mxnet pyaad corenlp xen troposphere pidgin react-int ntpsec apache oozie open fire

containerd celery dynamodb backend glisten cairo

apache zeppelin rigor gtk+ allure linux (xen drivers) (xen linux mqtt js pynamodb

apache bigtop emrun airlift apache tomcat apache red red hat deniswernert/udev kinesalite nginx go-statsd-client elephas bandit lombok

rdoc irate apache commons io parquet-python elasticsearch yield-java errors pkg conda git-bigstore linux (fbdev) pcehdo yarn hadoop apache rebouncer immutableassign paramz botoflow kenlm exoplayer mithriljs cloud-init

ews java api graph janus papaparse haproxy gatsby apache lucene containernetworking dynamic-object airflow appium-dot-exe git-lfs sys-proctable macports angular tooltips angular s3fs hypothesis-python jackson-dataformats-binary ultipart-parser behave appium-uiautomator2-server kubernetes apache hbase dtcoretext bro

coreos vowpal wabbit koji bin sparklingml go-winio linux (blkfront) conda-build

definitely typed definitely redux seabios repolinter linux (arch) postgresql intellij-community functional-streams-for-scala wireshark react-native react-spinkit jscolor spark-redshift multi-module-mave spring framework pydeepgp p5-protocol-http2 deep visualization toolbox mxnet notebooks react-draft-wysiwyg

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. gbm java apache (http server) cerebro alks-cli oss-attribution-generator libfabric xen devel cryptography tslint-eslint-rules cynical glib incubator mxnet jruby arrow rollbar linux (kvm) hue rgp netlink gerrit-check

web socket sharp cni jgi scapy tabular diaporama packer json11 postcss-extract-animations authenticator fast align tez emscripten lmdbjava gucumber security security monkey

linux-nvme-cli t licensee lombok dovecot smack aalto-xml homebrew nodejs pygresql amphtml flink gpy wing slight.alexa

2018 cldr unicode gpyoptapache phoenix libarchive capybara jcommander tslint appium little proxy little typescript-fsa

kotlinpoet zipper moby go-git cmock

plantuml-syntax esp-open-rtos gradle kuromoji github-plugin cbmc elastalert libsoup eclipse paho mariadb-connector-j kappa

irate mysql workbench pyzmq cnn r509-ocsp-responder cocoapods cmis_5

flask-sqlalchemy devkit iot aws tensorboard

git lfs git rails fortune fortune server 389ds

quicktype appium-gulp-plugin californium

redis pkcs7pad wycheproof sockeye google guava spack xcpretty address street wing irqbalance goa

tinyxml12 open mpi pyinvestigate pysnmp openjdk miniredis graphql-java tinycorelinux kcov convolutional-pose-machines-tensorflow catwatch sync tacacs_plus plus tacacs fabric apache spark apache

libfuse apache hive focus-android sqoop teleport webdriveragent

yubico chart.js notebook s2n libc django-debug-toolbar astrum oci-fetch yarn apache joshua ex_aws mosquito llvm scipy moto

bundler debugger remote appium

yarn picker react daterange

grpc appium-chromedriver apache beam wycheproof

boto 3 uml-utilities jawk mysql scikit-fuzzy bixie react-hot-loader ansible keras pig

gulp-typescript ompi

ubuntu mshadow libgxps apache jena safe-eval FreeRTOS

ldns mqtt hypothesis tvm oauth2 dmlc grpc-go appium-android-bootstrap apache commons dbutils kpatch graal boogieman bam bam joshua decoder lantram typescript-json-schema cargo-kcov ublockorigin apache hadoop nimbus-jose-jwt

parquet-mr presto react-native-swipeout glib-openssl iu kernel linux clearlydefined peewee linux (pm) linux xfs counterfeiter libjson geckodriver akka xcode-install gvsbuild libuavcan dynamic-object firefox jupyter notebook appiumadb glib-networking rosette protobuf chromium fop assertj-core chromium vim glib docker presto hadoop apache 2 ios-webkit-debug-proxy lang go liboqs ndbench qemu statsd backend tercom

word segmentation (nvme) linux dynamodb-milkhatx wordpress

apache pig apache mvel apache ant apache nnvm nginx libmoon

logstash-input-udp apache commons lang

openfire gsettings-test eslint open quantum safe dpdk immutables.org ffmpeg netty

moses iputils tsung ruby-simple-queue hana webhooks s3_file wingtk apache activemq jest wired tiger tupl databind jackson bencode-go multi-module-maven-release-plugin treeextra xenbits liblouis curator

swaggercodegen aws-scala go-btrfs sentry rspec-retry filequeue ts-test txthings linux-fsdevel lsp-intellij-spacemacs parsimonious sparkmagic jetty.project kotlin httpclient httpcomponents agent webdriver facebook autovpn phoenix xen (devel) gpyopt beanstalker go-dockerclient libkv apache mxnet openssl apache httpcomponents core cmake

linux-pci leveldb pyaad rust xen sequel corenlp troposphere apache commons-compress netty reactive streams packr cyrus-sasl pidgin react-int ntpsec apache oozie seunjeon open fire containerd badssl.com pynamodb celery dynamodb backend glisten cairo

apache zeppelin rigor gtk+

allure mqtt js

apache bigtop emrun airlift apache tomcat apache red red hat deniswernert/udev kinesalite goleveldb nginx go-statsd-client elephas bandit

iu (xendrivers) linux lombok

rdoc irate apache commons io parquet-python elasticsearch yield-java conda errors pkg git-bigstore linux (fbdev) pcehdo yarn hadoop apache

rebouncer boringssl exoplayer immutableassign paramz botoflow kenlm mithriljs cloud-init

ews java api graph janus papaparse haproxy

apache lucene containernetworking dynamic-object

airflow gatsby sys-proctable appium-dot-exe git-lfs macports angular tooltips angular s3fs linux kexec jose hypothesis-python behave jackson-dataformats-binary ultipart-parser appium-uiautomator2-server kubernetes dtcoretext bro

apache hbase coreos sparklingml vowpal wabbit koji bin go-winio linux (blkfront) conda-build repolinter typed definitely redux seabiosrusqlite recrud linux (arch) retool postgresql intellij-community openjml wireshark react-native jdk react-spinkit jscolor spark-redshift webkit multi-module-mave functional-streams-for-scala foolbox goics jepsen glide selenium jedis apache solr istio pydeepgp

spring framework apache incubator airflow graphql-go p5-protocol-http2 deep visualization toolbox gdk-pixbuf mxnet notebooks react-draft-wysiwyg

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. gbm java apache (http server) cerebro alks-cli oss-attribution-generator libfabric xen devel cryptography tslint-eslint-rules cynical glib incubator mxnet jruby arrow rollbar linux (kvm) hue rgp netlink gerrit-check

web socket sharp cni jgi scapy tabular diaporama packer json11 postcss-extract-animations authenticator fast align tez emscripten lmdbjava gucumber security security monkey

linux-nvme-cli t licensee lombok dovecot smack aalto-xml homebrew nodejs pygresql amphtml flink gpy wing slight.alexa

2018 cldr unicode gpyoptapache phoenix libarchive capybara jcommander tslint appium little proxy little typescript-fsa

kotlinpoet zipper moby go-git cmock

plantuml-syntax esp-open-rtos gradle kuromoji github-plugin cbmc elastalert libsoup eclipse paho mariadb-connector-j kappa

irate mysql workbench pyzmq cnn r509-ocsp-responder cocoapods cmis_5

flask-sqlalchemy devkit iot aws tensorboard

git lfs git rails fortune fortune server 389ds

quicktype appium-gulp-plugin californium

redis pkcs7pad wycheproof sockeye google guava spack xcpretty address street wing irqbalance goa

tinyxml12 open mpi pyinvestigate pysnmp openjdk miniredis graphql-java tinycorelinux kcov convolutional-pose-machines-tensorflow catwatch sync tacacs_plus plus tacacs fabric apache spark apache

libfuse apache hive focus-android sqoop teleport webdriveragent

yubico chart.js notebook s2n libc django-debug-toolbar astrum oci-fetch yarn apache joshua ex_aws mosquito llvm scipy moto

bundler debugger remote appium

yarn picker react daterange

grpc appium-chromedriver apache beam wycheproof

boto 3 uml-utilities jawk mysql scikit-fuzzy bixie react-hot-loader ansible keras pig

gulp-typescript ompi

ubuntu mshadow libgxps apache jena safe-eval FreeRTOS

ldns mqtt hypothesis tvm oauth2 dmlc grpc-go appium-android-bootstrap apache commons dbutils kpatch graal boogieman bam bam joshua decoder lantram typescript-json-schema cargo-kcov ublockorigin apache hadoop nimbus-jose-jwt

parquet-mr presto react-native-swipeout glib-openssl iu kernel linux clearlydefined peewee linux (pm) linux xfs counterfeiter libjson geckodriver akka xcode-install gvsbuild libuavcan dynamic-object firefox jupyter notebook appiumadb glib-networking rosette protobuf chromium fop assertj-core chromium vim glib docker presto hadoop apache 2 ios-webkit-debug-proxy lang go liboqs ndbench qemu statsd backend tercom

word segmentation (nvme) linux dynamodb-milkhatx wordpress

apache pig apache mvel apache ant apache nnvm nginx libmoon

logstash-input-udp apache commons lang

openfire gsettings-test eslint open quantum safe dpdk immutables.org ffmpeg netty

moses iputils tsung ruby-simple-queue hana webhooks s3_file wingtk apache activemq jest wired tiger tupl databind jackson bencode-go multi-module-maven-release-plugin treeextra xenbits liblouis curator

swaggercodegen aws-scala go-btrfs sentry rspec-retry filequeue ts-test txthings linux-fsdevel lsp-intellij-spacemacs parsimonious sparkmagic jetty.project kotlin httpclient httpcomponents agent webdriver facebook autovpn phoenix xen (devel) gpyopt beanstalker go-dockerclient libkv apache mxnet openssl apache httpcomponents core cmake

linux-pci leveldb pyaad rust xen sequel corenlp troposphere apache commons-compress netty reactive streams packr cyrus-sasl pidgin react-int ntpsec apache oozie seunjeon open fire containerd badssl.com pynamodb celery dynamodb backend glisten cairo

apache zeppelin rigor gtk+

allure mqtt js

apache bigtop emrun airlift apache tomcat apache red red hat deniswernert/udev kinesalite goleveldb nginx go-statsd-client elephas bandit

iu (xendrivers) linux lombok

rdoc irate apache commons io parquet-python elasticsearch yield-java conda errors pkg git-bigstore linux (fbdev) pcehdo yarn hadoop apache

rebouncer boringssl exoplayer immutableassign paramz botoflow kenlm mithriljs cloud-init

ews java api graph janus papaparse haproxy

apache lucene containernetworking dynamic-object

airflow gatsby sys-proctable appium-dot-exe git-lfs macports angular tooltips angular s3fs linux kexec jose hypothesis-python behave jackson-dataformats-binary ultipart-parser appium-uiautomator2-server kubernetes dtcoretext bro

apache hbase coreos sparklingml vowpal wabbit koji bin go-winio linux (blkfront) conda-build repolinter typed definitely redux seabiosrusqlite recrud linux (arch) retool postgresql intellij-community openjml wireshark react-native jdk react-spinkit jscolor spark-redshift webkit multi-module-mave functional-streams-for-scala foolbox goics jepsen glide selenium jedis apache solr istio pydeepgp

spring framework apache incubator airflow graphql-go p5-protocol-http2 deep visualization toolbox gdk-pixbuf mxnet notebooks react-draft-wysiwyg

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. FreeRTOS on RISC-V

© 2019,2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Common source files and a port layer

Blocked Task 2

Top of Stack for Task Running Task StackBlocked Variable Task 1 Stack Variable Top of Stack for Task Top of Stack for Task Return Address Stack Variable StackReady Variable Task 1 Program Counter Program Counter Copy Stack Variable Stack Variable StatusTop Register of Stack for Task Stack Pointer Return Address Return Address R0 CopyStack Variable Empty Stack Space Program Counter Copy R0 R1 CopyStack Variable Empty Stack Space Status Register …Return Address R1 Empty Stack Space R0 Copy Empty Stack Space RnProgram Copy Counter Copy … R1 Copy Empty StackStatus Space Register Empty Stack Space … Rn R0 Copy Empty Stack Space Empty StackRn CopySpace Empty Stack Space R1 Copy Empty Stack Space Empty Stack Space … Empty Stack Space Rn Copy Empty Stack Space Empty Stack Space

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. MIT Licensed C Source Code

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. MIT Licensed C Source Code

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Demonstrate Renode and Vegaboard projects

• Including the source files • Setting the assembler’s include file • Set configCLINT_BASE_ADDRESS • #define portasmHANDLE_INTERRUPT • Install the FreeRTOS trap hander

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Defining the interrupt stack

Task 3 Task 3 Top ofTask Stack 2 Max Task Max Task Task 2 for Task Stack Stack Top ofTask Stack 1 Top ofTask Stack 1 MaxforTop Task Task of Stack MaxforTop Task Task of Stack Stack StackMaxfor Task Task Maxfor Task Task Stack Stack Max Task Max IRQ Stack Max Task Stack Stack mptyMax Stack IRQ Stack Space Max Task Stack Max IRQ Stack Max Task Max IRQ Stack Stack

Max IRQ Stack Max Task Max IRQ Stack Stack

Max Task Stack Max IRQ Stack

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Max IRQ Stack Thank You!

Download, share and support

opensource.amazon.com/enterprise-oss-book

@AWSOpen | opensource.amazon.com | aws.github.io

© 2019,2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.