SlideShare una empresa de Scribd logo
1 de 35
Descargar para leer sin conexión
Rust Embedded Development
on ESP32
and basics
of Async with Embassy
2023-02-08
Rust CZ/SK Meetup - Brno
Juraj Michálek, Juraj Sadel - Espressif Systems
ESP-RS organisation https://github.com/esp-rs
Rust ESP32 Community meeting
Regular meeting every two weeks
https://github.com/esp-rs/rust/discussions/
Community based effort to make Rust better
The Rust on ESP Book - https://esp-rs.github.io/book/
Awesome ESP Rust - https://github.com/esp-rs/awesome-esp-rust
- submit your project :-)
Designing Open Hardware - esp-rust-board
KiCad templates
https://github.com/esp-rs/esp-rust-board
ESP32-C3-DevKit-RUST-1 (available at Mouser, AliExpress)
https://www.espressif.com/en/products/devkits
wokwi.com/rust
Contribute: https://github.com/wokwi
EDC22 Day 1 Talk 9: Your browser is
ESP32 - Wokwi -
https://youtu.be/TKe4MgD6O8o
GitPod.io + Wokwi.com
https://github.com/playfulFence/esp-clock#dev-containers
Exploring what’s possible with Rust
Bare Metal: https://github.com/esp-rs/esp-hal
- ESP32 - esp32-hal/examples - Xtensa
- ESP32-C2 - esp32c2-hal/examples - RISC-V
- ESP32-C3 - esp32c3-hal/examples - RISC-V
- ESP32-S2 - esp32s2-hal/examples - Xtensa
- ESP32-S3 - esp32s3-hal/examples - RISC-V
STD: https://github.com/esp-rs/esp-idf-hal/tree/master/examples
Create new project Rust project
Bare metal:
cargo generate https://github.com/esp-rs/esp-template
STD with ESP-IDF:
cargo generate --vcs none --git https://github.com/esp-rs/esp-idf-template cargo
Multi-target project (PoC) - ESP32 Spooky Maze
https://github.com/georgik/esp32-spooky-maze-game
Idea: sharing business logic in Rust between
multiple targets
Targets: ESP32, ESP32-S2, ESP32-S3, ESP32-C3, M5Stack, Wasm and Desktop
Article: https://georgik.rocks/rust-bare-metal-application-for-esp32-desktop-android-and-ios/
https://github.com/espressif/esp-box
Wokwi - VS Code Plugin
Add wokwi.toml and diagram.json
to your project
cd m5stack-fire
cargo build --release --no-default-features --features "wokwi"
CTRL+Shift+P - Wokwi: Start Simulator
Async with Embassy
Embassy: https://github.com/embassy-rs/embassy
Examples of Embassy on ESP32:
- https://github.com/esp-rs/esp-hal/blob/main/esp32-hal/examples/embassy_hello_world.rs
- https://github.com/esp-rs/esp-hal/blob/main/esp32-hal/examples/embassy_spi.rs
- https://github.com/esp-rs/esp-hal/blob/main/esp32-hal/examples/embassy_wait.rs
Development options
- Local
- bootstrap whole env with “espup install” - https://github.com/esp-rs/espup#installation (written in Rust)
- Windows Online idf-installer - https://github.com/espressif/idf-installer/releases/tag/online-2.20 (includes VC
Tools)
- bootstrap with sh/pwsh (older method) - https://github.com/esp-rs/rust-build#download-installer
- Local in container
- Podman, Docker, Lima
- with VS Code Remote Container extension
- Cloud in GitPod.io or CodeSpaces
- EDC22 Day 2 Talk 11 Just Few dot files in Repo or Paradigm Shift to Cloud-based Embedded Development -
https://youtu.be/WAwfRyOy7N8
- Wokwi.com
Busy Looping (not using async)
- Very inefficient, blocking
Interrupts (not using async)
- Driven by hardware
- Pretty complex
Using async
- Don’t have to setting and waiting for interrupt resuming the program
- Async executor can do that for us instead
- Power efficient
async/.await
- Non-blocking operations
- Transforms each async function into future object
- When future blocks I/O it yields -> executor selects different future to execute
- No guessing which future is ready
Embassy (EMBedded ASYnc)
- We need an EXECUTOR to be able to use async
- Controlling which task should run
- Embassy consists of multiple crates (Executor, HALs, Networking,...)
- no_std
- Can be (relatively) easily extendable/configurable with other public crates
- https://embassy.dev
Executor
- Queue of tasks, when created it’s polled (1)
- Executing until gets blocked (awaiting async function) (2)
- Executes other task (3)
Interrupts
- Task is polled and executing (1)
- Task uses a peripheral to perform an operation(2)
- Interrupt occurred while awaiting (3)
- HAL ensures that interrupt signal updates
the peripheral state (4)
- Executor poll the task (5)
Rust language support
Talk: Embedded Rust on ESP32 - Juraj Michálek - Rust Linz November 2022
https://youtu.be/0PPPdqoDBQs
Training Embedded for ESP32-C3 by Ferrous Systems
Training: https://ferrous-systems.com/training/#package-espressif-beginner-training
Material: https://espressif-trainings.ferrous-systems.com/
GitHub: https://github.com/ferrous-systems/espressif-trainings/
Some Inspiration
(not necessary in Rust)
ESP Launchpad - https://espressif.github.io/esp-launchpad/
Many chips, many boards - quick help
https://products.espressif.com/
IDE
Supported by Espressif:
- VS Code with Espressif Extension -
https://docs.espressif.com/projects/esp-idf/en/stable/esp32/get-started/vscode-setup.html
- Espressif IDE - https://dl.espressif.com/dl/esp-idf/
Supported by 3rd party and community:
- Visual Studio with VisualGDB - https://visualgdb.com/
- CLion - https://www.jetbrains.com/clion/
Espressif Developer Conference 2022 - recording
https://www.youtube.com/playlist?list=PLOzvoM7_Knrc6o-n25jYuXRB2T8UKk1NU
OSes and integration
ESP-IDF (OS based on FreeRTOS) - https://github.com/esp-rs/esp-idf-hal (full feature)
no_std a.k.a. bare metal with Rust - https://github.com/esp-rs/esp-hal (minimalistic)
Zephyr - https://zephyrproject.org/
- EDC22 Day 1 Talk 10: Applications of Asymmetric Multiprocessing with ESP32 Devices -
including Rust on one core - https://youtu.be/oble9ObAqxM
NuttX - https://nuttx.apache.org/ (as app, Linux-like OS)
SVD files: https://github.com/espressif/svd
Further languages and frameworks
Arduino - Maker choice
- warning: limitation on production due to licenses!
VM based:
- CircuitPython and MicroPython - Python-like language
- Toit - Toit language
- Nanoframework - C# language
- Mongoose OS
- downside: bigger VM
- upside: more robust, comes with OTA and monitoring
CTAG-TBD
CTAG TBD >>to be determined<< an extendible
open source Eurorack sound module
https://github.com/ctag-fh-kiel/ctag-tbd
Wearables
The Ultimate Guide to Informed Wearable Technology
- book: https://packt.link/01VBv
Time-O-Mat - built at summer camp
https://github.com/vedatori/Time-O-Mat
Grafana
https://grafana.com/blog/2020/06/17/how-to-monitor-a-sourdough-starter-with-grafana/
https://github.com/grafana/diy-iot - Arduino now. We’re not Rust yet :)
Embedded World 2023
Meet us in Nuremberg, Germany
Visit us in Brno
Espressif Systems (Czech) s.r.o.
Přízova 3, 602 00 Brno
Czechia, Europe
See you in Linz in 2023. We’re planning ESP32 Rust Workshop ;-)

Más contenido relacionado

La actualidad más candente

Visual studio code
Visual studio codeVisual studio code
Visual studio codefizmhd
 
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)Nanik Tolaram
 
Android Storage - Vold
Android Storage - VoldAndroid Storage - Vold
Android Storage - VoldWilliam Lee
 
Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequenceHoucheng Lin
 
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime RipardKernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime RipardAnne Nicolas
 
ROS 2 Foxy with Eclipse Cyclone DDS | Philly ROS Meetup July 20th 2020
ROS 2 Foxy with Eclipse Cyclone DDS | Philly ROS Meetup July 20th 2020ROS 2 Foxy with Eclipse Cyclone DDS | Philly ROS Meetup July 20th 2020
ROS 2 Foxy with Eclipse Cyclone DDS | Philly ROS Meetup July 20th 2020Joe Speed
 
Printing with cups (linux)
Printing with cups (linux)Printing with cups (linux)
Printing with cups (linux)Raghu nath
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in AndroidOpersys inc.
 
Introduction to Flutter - truly crossplatform, amazingly fast
Introduction to Flutter - truly crossplatform, amazingly fastIntroduction to Flutter - truly crossplatform, amazingly fast
Introduction to Flutter - truly crossplatform, amazingly fastBartosz Kosarzycki
 
Flutter vs. MAUI - Techorama BE 2022
Flutter vs. MAUI - Techorama BE 2022Flutter vs. MAUI - Techorama BE 2022
Flutter vs. MAUI - Techorama BE 2022Tobias Hoppenthaler
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoCMacpaul Lin
 
Solaris Linux Performance, Tools and Tuning
Solaris Linux Performance, Tools and TuningSolaris Linux Performance, Tools and Tuning
Solaris Linux Performance, Tools and TuningAdrian Cockcroft
 
From Android NDK To AOSP
From Android NDK To AOSPFrom Android NDK To AOSP
From Android NDK To AOSPMin-Yih Hsu
 
Android Logging System
Android Logging SystemAndroid Logging System
Android Logging SystemWilliam Lee
 
Some basic unix commands
Some basic unix commandsSome basic unix commands
Some basic unix commandsaaj_sarkar06
 
Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013Wave Digitech
 

La actualidad más candente (20)

Visual studio code
Visual studio codeVisual studio code
Visual studio code
 
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
 
Android Storage - Vold
Android Storage - VoldAndroid Storage - Vold
Android Storage - Vold
 
Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequence
 
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime RipardKernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
 
ROS 2 Foxy with Eclipse Cyclone DDS | Philly ROS Meetup July 20th 2020
ROS 2 Foxy with Eclipse Cyclone DDS | Philly ROS Meetup July 20th 2020ROS 2 Foxy with Eclipse Cyclone DDS | Philly ROS Meetup July 20th 2020
ROS 2 Foxy with Eclipse Cyclone DDS | Philly ROS Meetup July 20th 2020
 
Printing with cups (linux)
Printing with cups (linux)Printing with cups (linux)
Printing with cups (linux)
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in Android
 
Introduction to Flutter - truly crossplatform, amazingly fast
Introduction to Flutter - truly crossplatform, amazingly fastIntroduction to Flutter - truly crossplatform, amazingly fast
Introduction to Flutter - truly crossplatform, amazingly fast
 
Flutter vs. MAUI - Techorama BE 2022
Flutter vs. MAUI - Techorama BE 2022Flutter vs. MAUI - Techorama BE 2022
Flutter vs. MAUI - Techorama BE 2022
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoC
 
Asterisk sip channel performance
Asterisk sip channel performanceAsterisk sip channel performance
Asterisk sip channel performance
 
Solaris Linux Performance, Tools and Tuning
Solaris Linux Performance, Tools and TuningSolaris Linux Performance, Tools and Tuning
Solaris Linux Performance, Tools and Tuning
 
From Android NDK To AOSP
From Android NDK To AOSPFrom Android NDK To AOSP
From Android NDK To AOSP
 
Android studio ppt
Android studio pptAndroid studio ppt
Android studio ppt
 
Android Logging System
Android Logging SystemAndroid Logging System
Android Logging System
 
Embedded Android : System Development - Part III
Embedded Android : System Development - Part IIIEmbedded Android : System Development - Part III
Embedded Android : System Development - Part III
 
Some basic unix commands
Some basic unix commandsSome basic unix commands
Some basic unix commands
 
Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013
 
Visual studio code
Visual studio codeVisual studio code
Visual studio code
 

Similar a Rust Embedded Development on ESP32 and basics of Async with Embassy

Embedded Development on ESP32 - FEKT VUT - UREL
Embedded Development on ESP32 - FEKT VUT - URELEmbedded Development on ESP32 - FEKT VUT - UREL
Embedded Development on ESP32 - FEKT VUT - URELJuraj Michálek
 
WebSocket on client & server using websocket-sharp & ASP.NET Core
WebSocket on client & server using websocket-sharp & ASP.NET CoreWebSocket on client & server using websocket-sharp & ASP.NET Core
WebSocket on client & server using websocket-sharp & ASP.NET CoreChen Yu Pao
 
A glance at the Rust SWC
A glance at the Rust SWCA glance at the Rust SWC
A glance at the Rust SWCThien Ly
 
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins Mando Stam
 
Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!Codemotion
 
Introduction to ESP32 Programming [Road to RIoT 2017]
Introduction to ESP32 Programming [Road to RIoT 2017]Introduction to ESP32 Programming [Road to RIoT 2017]
Introduction to ESP32 Programming [Road to RIoT 2017]Alwin Arrasyid
 
An Overview of the IHK/McKernel Multi-kernel Operating System
An Overview of the IHK/McKernel Multi-kernel Operating SystemAn Overview of the IHK/McKernel Multi-kernel Operating System
An Overview of the IHK/McKernel Multi-kernel Operating SystemLinaro
 
carrow - Go bindings to Apache Arrow via C++-API
carrow - Go bindings to Apache Arrow via C++-APIcarrow - Go bindings to Apache Arrow via C++-API
carrow - Go bindings to Apache Arrow via C++-APIYoni Davidson
 
Fedora on risc-v_tokyo_30_sep_2019_v4
Fedora on risc-v_tokyo_30_sep_2019_v4Fedora on risc-v_tokyo_30_sep_2019_v4
Fedora on risc-v_tokyo_30_sep_2019_v4Wei Fu
 
Rapid IoT prototyping with mruby
Rapid IoT prototyping with mrubyRapid IoT prototyping with mruby
Rapid IoT prototyping with mruby雅也 山本
 
Apache Bigtop and ARM64 / AArch64 - Empowering Big Data Everywhere
Apache Bigtop and ARM64 / AArch64 - Empowering Big Data EverywhereApache Bigtop and ARM64 / AArch64 - Empowering Big Data Everywhere
Apache Bigtop and ARM64 / AArch64 - Empowering Big Data EverywhereGanesh Raju
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)RuggedBoardGroup
 
OPTEE on QEMU - Build Tutorial
OPTEE on QEMU - Build TutorialOPTEE on QEMU - Build Tutorial
OPTEE on QEMU - Build TutorialDalton Valadares
 
Build Low-Latency Applications in Rust on ScyllaDB
Build Low-Latency Applications in Rust on ScyllaDBBuild Low-Latency Applications in Rust on ScyllaDB
Build Low-Latency Applications in Rust on ScyllaDBScyllaDB
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014biicode
 

Similar a Rust Embedded Development on ESP32 and basics of Async with Embassy (20)

Embedded Development on ESP32 - FEKT VUT - UREL
Embedded Development on ESP32 - FEKT VUT - URELEmbedded Development on ESP32 - FEKT VUT - UREL
Embedded Development on ESP32 - FEKT VUT - UREL
 
WebSocket on client & server using websocket-sharp & ASP.NET Core
WebSocket on client & server using websocket-sharp & ASP.NET CoreWebSocket on client & server using websocket-sharp & ASP.NET Core
WebSocket on client & server using websocket-sharp & ASP.NET Core
 
ESP32_LABVIEW.pdf
ESP32_LABVIEW.pdfESP32_LABVIEW.pdf
ESP32_LABVIEW.pdf
 
A glance at the Rust SWC
A glance at the Rust SWCA glance at the Rust SWC
A glance at the Rust SWC
 
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
 
Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!
 
Introduction to ESP32 Programming [Road to RIoT 2017]
Introduction to ESP32 Programming [Road to RIoT 2017]Introduction to ESP32 Programming [Road to RIoT 2017]
Introduction to ESP32 Programming [Road to RIoT 2017]
 
App container rkt
App container rktApp container rkt
App container rkt
 
An Overview of the IHK/McKernel Multi-kernel Operating System
An Overview of the IHK/McKernel Multi-kernel Operating SystemAn Overview of the IHK/McKernel Multi-kernel Operating System
An Overview of the IHK/McKernel Multi-kernel Operating System
 
carrow - Go bindings to Apache Arrow via C++-API
carrow - Go bindings to Apache Arrow via C++-APIcarrow - Go bindings to Apache Arrow via C++-API
carrow - Go bindings to Apache Arrow via C++-API
 
My ROS Experience
My ROS ExperienceMy ROS Experience
My ROS Experience
 
Fedora on risc-v_tokyo_30_sep_2019_v4
Fedora on risc-v_tokyo_30_sep_2019_v4Fedora on risc-v_tokyo_30_sep_2019_v4
Fedora on risc-v_tokyo_30_sep_2019_v4
 
Rapid IoT prototyping with mruby
Rapid IoT prototyping with mrubyRapid IoT prototyping with mruby
Rapid IoT prototyping with mruby
 
Apache Bigtop and ARM64 / AArch64 - Empowering Big Data Everywhere
Apache Bigtop and ARM64 / AArch64 - Empowering Big Data EverywhereApache Bigtop and ARM64 / AArch64 - Empowering Big Data Everywhere
Apache Bigtop and ARM64 / AArch64 - Empowering Big Data Everywhere
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)
 
OPTEE on QEMU - Build Tutorial
OPTEE on QEMU - Build TutorialOPTEE on QEMU - Build Tutorial
OPTEE on QEMU - Build Tutorial
 
Discovering OpenBSD on AWS
Discovering OpenBSD on AWSDiscovering OpenBSD on AWS
Discovering OpenBSD on AWS
 
Build Low-Latency Applications in Rust on ScyllaDB
Build Low-Latency Applications in Rust on ScyllaDBBuild Low-Latency Applications in Rust on ScyllaDB
Build Low-Latency Applications in Rust on ScyllaDB
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
Ropython-windbg-python-extensions
Ropython-windbg-python-extensionsRopython-windbg-python-extensions
Ropython-windbg-python-extensions
 

Más de Juraj Michálek

C language in our world 2019
C language in our world 2019C language in our world 2019
C language in our world 2019Juraj Michálek
 
C language in our world 2017
C language in our world 2017C language in our world 2017
C language in our world 2017Juraj Michálek
 
Continuous Delivery - FIT VUT
Continuous Delivery - FIT VUTContinuous Delivery - FIT VUT
Continuous Delivery - FIT VUTJuraj Michálek
 
C language in our world 2016
C language in our world 2016C language in our world 2016
C language in our world 2016Juraj Michálek
 
C++ and Software Engineering 2015
C++ and Software Engineering 2015C++ and Software Engineering 2015
C++ and Software Engineering 2015Juraj Michálek
 
C language in our world 2015
C language in our world 2015C language in our world 2015
C language in our world 2015Juraj Michálek
 
Bigger & Better RnD - GeeCON.cz 2014
Bigger & Better RnD - GeeCON.cz 2014Bigger & Better RnD - GeeCON.cz 2014
Bigger & Better RnD - GeeCON.cz 2014Juraj Michálek
 
Gradle and build systems for C language
Gradle and build systems for C languageGradle and build systems for C language
Gradle and build systems for C languageJuraj Michálek
 
The story behind PF2014 - Cordova
The story behind PF2014 - CordovaThe story behind PF2014 - Cordova
The story behind PF2014 - CordovaJuraj Michálek
 
PowerShell from *nix user perspective
PowerShell from *nix user perspectivePowerShell from *nix user perspective
PowerShell from *nix user perspectiveJuraj Michálek
 
Ať se z kódu nepráší! 2013
Ať se z kódu nepráší! 2013Ať se z kódu nepráší! 2013
Ať se z kódu nepráší! 2013Juraj Michálek
 
Libraries and tools for C++
Libraries and tools for C++Libraries and tools for C++
Libraries and tools for C++Juraj Michálek
 
Startup Camp - Git, Python, Django session
Startup Camp - Git, Python, Django sessionStartup Camp - Git, Python, Django session
Startup Camp - Git, Python, Django sessionJuraj Michálek
 
Ať se z kódu nepráší!
Ať se z kódu nepráší!Ať se z kódu nepráší!
Ať se z kódu nepráší!Juraj Michálek
 

Más de Juraj Michálek (20)

C language in our world 2019
C language in our world 2019C language in our world 2019
C language in our world 2019
 
C language in our world 2017
C language in our world 2017C language in our world 2017
C language in our world 2017
 
Continuous Delivery - FIT VUT
Continuous Delivery - FIT VUTContinuous Delivery - FIT VUT
Continuous Delivery - FIT VUT
 
C language in our world 2016
C language in our world 2016C language in our world 2016
C language in our world 2016
 
Story behind PF 2016
Story behind PF 2016Story behind PF 2016
Story behind PF 2016
 
C++ and Software Engineering 2015
C++ and Software Engineering 2015C++ and Software Engineering 2015
C++ and Software Engineering 2015
 
C language in our world 2015
C language in our world 2015C language in our world 2015
C language in our world 2015
 
C++ in our world
C++ in our worldC++ in our world
C++ in our world
 
Bigger & Better RnD - GeeCON.cz 2014
Bigger & Better RnD - GeeCON.cz 2014Bigger & Better RnD - GeeCON.cz 2014
Bigger & Better RnD - GeeCON.cz 2014
 
Gradle and build systems for C language
Gradle and build systems for C languageGradle and build systems for C language
Gradle and build systems for C language
 
The story behind PF2014 - Cordova
The story behind PF2014 - CordovaThe story behind PF2014 - Cordova
The story behind PF2014 - Cordova
 
There is more to C 2013
There is more to C 2013There is more to C 2013
There is more to C 2013
 
PowerShell UIAtomation
PowerShell UIAtomationPowerShell UIAtomation
PowerShell UIAtomation
 
PowerShell from *nix user perspective
PowerShell from *nix user perspectivePowerShell from *nix user perspective
PowerShell from *nix user perspective
 
Ať se z kódu nepráší! 2013
Ať se z kódu nepráší! 2013Ať se z kódu nepráší! 2013
Ať se z kódu nepráší! 2013
 
Libraries and tools for C++
Libraries and tools for C++Libraries and tools for C++
Libraries and tools for C++
 
There is more to C
There is more to CThere is more to C
There is more to C
 
Git, Jenkins & Chuck
Git, Jenkins & ChuckGit, Jenkins & Chuck
Git, Jenkins & Chuck
 
Startup Camp - Git, Python, Django session
Startup Camp - Git, Python, Django sessionStartup Camp - Git, Python, Django session
Startup Camp - Git, Python, Django session
 
Ať se z kódu nepráší!
Ať se z kódu nepráší!Ať se z kódu nepráší!
Ať se z kódu nepráší!
 

Último

Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....ShaimaaMohamedGalal
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 

Último (20)

Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 

Rust Embedded Development on ESP32 and basics of Async with Embassy

  • 1. Rust Embedded Development on ESP32 and basics of Async with Embassy 2023-02-08 Rust CZ/SK Meetup - Brno Juraj Michálek, Juraj Sadel - Espressif Systems
  • 3. Rust ESP32 Community meeting Regular meeting every two weeks https://github.com/esp-rs/rust/discussions/
  • 4. Community based effort to make Rust better The Rust on ESP Book - https://esp-rs.github.io/book/ Awesome ESP Rust - https://github.com/esp-rs/awesome-esp-rust - submit your project :-)
  • 5. Designing Open Hardware - esp-rust-board KiCad templates https://github.com/esp-rs/esp-rust-board ESP32-C3-DevKit-RUST-1 (available at Mouser, AliExpress) https://www.espressif.com/en/products/devkits
  • 6. wokwi.com/rust Contribute: https://github.com/wokwi EDC22 Day 1 Talk 9: Your browser is ESP32 - Wokwi - https://youtu.be/TKe4MgD6O8o
  • 8. Exploring what’s possible with Rust Bare Metal: https://github.com/esp-rs/esp-hal - ESP32 - esp32-hal/examples - Xtensa - ESP32-C2 - esp32c2-hal/examples - RISC-V - ESP32-C3 - esp32c3-hal/examples - RISC-V - ESP32-S2 - esp32s2-hal/examples - Xtensa - ESP32-S3 - esp32s3-hal/examples - RISC-V STD: https://github.com/esp-rs/esp-idf-hal/tree/master/examples
  • 9. Create new project Rust project Bare metal: cargo generate https://github.com/esp-rs/esp-template STD with ESP-IDF: cargo generate --vcs none --git https://github.com/esp-rs/esp-idf-template cargo
  • 10. Multi-target project (PoC) - ESP32 Spooky Maze https://github.com/georgik/esp32-spooky-maze-game Idea: sharing business logic in Rust between multiple targets Targets: ESP32, ESP32-S2, ESP32-S3, ESP32-C3, M5Stack, Wasm and Desktop Article: https://georgik.rocks/rust-bare-metal-application-for-esp32-desktop-android-and-ios/ https://github.com/espressif/esp-box
  • 11. Wokwi - VS Code Plugin Add wokwi.toml and diagram.json to your project cd m5stack-fire cargo build --release --no-default-features --features "wokwi" CTRL+Shift+P - Wokwi: Start Simulator
  • 12. Async with Embassy Embassy: https://github.com/embassy-rs/embassy Examples of Embassy on ESP32: - https://github.com/esp-rs/esp-hal/blob/main/esp32-hal/examples/embassy_hello_world.rs - https://github.com/esp-rs/esp-hal/blob/main/esp32-hal/examples/embassy_spi.rs - https://github.com/esp-rs/esp-hal/blob/main/esp32-hal/examples/embassy_wait.rs
  • 13. Development options - Local - bootstrap whole env with “espup install” - https://github.com/esp-rs/espup#installation (written in Rust) - Windows Online idf-installer - https://github.com/espressif/idf-installer/releases/tag/online-2.20 (includes VC Tools) - bootstrap with sh/pwsh (older method) - https://github.com/esp-rs/rust-build#download-installer - Local in container - Podman, Docker, Lima - with VS Code Remote Container extension - Cloud in GitPod.io or CodeSpaces - EDC22 Day 2 Talk 11 Just Few dot files in Repo or Paradigm Shift to Cloud-based Embedded Development - https://youtu.be/WAwfRyOy7N8 - Wokwi.com
  • 14. Busy Looping (not using async) - Very inefficient, blocking
  • 15. Interrupts (not using async) - Driven by hardware - Pretty complex
  • 16. Using async - Don’t have to setting and waiting for interrupt resuming the program - Async executor can do that for us instead - Power efficient
  • 17. async/.await - Non-blocking operations - Transforms each async function into future object - When future blocks I/O it yields -> executor selects different future to execute - No guessing which future is ready
  • 18. Embassy (EMBedded ASYnc) - We need an EXECUTOR to be able to use async - Controlling which task should run - Embassy consists of multiple crates (Executor, HALs, Networking,...) - no_std - Can be (relatively) easily extendable/configurable with other public crates - https://embassy.dev
  • 19. Executor - Queue of tasks, when created it’s polled (1) - Executing until gets blocked (awaiting async function) (2) - Executes other task (3)
  • 20. Interrupts - Task is polled and executing (1) - Task uses a peripheral to perform an operation(2) - Interrupt occurred while awaiting (3) - HAL ensures that interrupt signal updates the peripheral state (4) - Executor poll the task (5)
  • 21. Rust language support Talk: Embedded Rust on ESP32 - Juraj Michálek - Rust Linz November 2022 https://youtu.be/0PPPdqoDBQs
  • 22. Training Embedded for ESP32-C3 by Ferrous Systems Training: https://ferrous-systems.com/training/#package-espressif-beginner-training Material: https://espressif-trainings.ferrous-systems.com/ GitHub: https://github.com/ferrous-systems/espressif-trainings/
  • 24. ESP Launchpad - https://espressif.github.io/esp-launchpad/
  • 25. Many chips, many boards - quick help https://products.espressif.com/
  • 26. IDE Supported by Espressif: - VS Code with Espressif Extension - https://docs.espressif.com/projects/esp-idf/en/stable/esp32/get-started/vscode-setup.html - Espressif IDE - https://dl.espressif.com/dl/esp-idf/ Supported by 3rd party and community: - Visual Studio with VisualGDB - https://visualgdb.com/ - CLion - https://www.jetbrains.com/clion/
  • 27. Espressif Developer Conference 2022 - recording https://www.youtube.com/playlist?list=PLOzvoM7_Knrc6o-n25jYuXRB2T8UKk1NU
  • 28. OSes and integration ESP-IDF (OS based on FreeRTOS) - https://github.com/esp-rs/esp-idf-hal (full feature) no_std a.k.a. bare metal with Rust - https://github.com/esp-rs/esp-hal (minimalistic) Zephyr - https://zephyrproject.org/ - EDC22 Day 1 Talk 10: Applications of Asymmetric Multiprocessing with ESP32 Devices - including Rust on one core - https://youtu.be/oble9ObAqxM NuttX - https://nuttx.apache.org/ (as app, Linux-like OS) SVD files: https://github.com/espressif/svd
  • 29. Further languages and frameworks Arduino - Maker choice - warning: limitation on production due to licenses! VM based: - CircuitPython and MicroPython - Python-like language - Toit - Toit language - Nanoframework - C# language - Mongoose OS - downside: bigger VM - upside: more robust, comes with OTA and monitoring
  • 30. CTAG-TBD CTAG TBD >>to be determined<< an extendible open source Eurorack sound module https://github.com/ctag-fh-kiel/ctag-tbd
  • 31. Wearables The Ultimate Guide to Informed Wearable Technology - book: https://packt.link/01VBv
  • 32. Time-O-Mat - built at summer camp https://github.com/vedatori/Time-O-Mat
  • 34. Embedded World 2023 Meet us in Nuremberg, Germany
  • 35. Visit us in Brno Espressif Systems (Czech) s.r.o. Přízova 3, 602 00 Brno Czechia, Europe See you in Linz in 2023. We’re planning ESP32 Rust Workshop ;-)