Embassy crates released and Rust stable support
January 22, 2024The Embassy HAL, USB, networking, Bluetooth and bootloader crates have now been released to crates.io! Read on to learn about this major milestone for the Embassy project.
Following the recent releases of embedded-hal crates and Rust 1.75, the Embassy HALs for Nordic nRF, STM32 and Raspberry Pi RP2040 have now been released to crates.io (What is a HAL?).
This is a major milestone with contributions from a lot of people: thank you for all the contributions over the years! At the time of writing, 255 contributors have made changes to the Embassy code base in one way or the other.
The most time has probably been spent on the embassy-stm32
STM32 HAL, which has taken a different approach than other STM32 HALs. It's built upon the stm32-data project, which provides machine-readable metadata about all STM32 chips. embassy-stm32
is generated from this data for all 1400+ supported chips. This allows precise coverage of all STM32 families, quick support for newly released chips, and a unified API making it easy to port code between families and chips.
Something for everyone
A common source of confusion is that you have to buy into the entire Embassy ecosystem to use an Embassy HAL. However, the Embassy HAL crates all support both blocking and async operation in most cases, and you can use them without any runtime, or using another runtime such as RTIC. This way there should be very few cases where you can not use Embassy in one way or the other. The existence of the esp-hal which works with the Embassy executor shows that it goes both ways.
HAL traits
Embassy HALs implement the traits from embedded-hal
(both blocking and async). With the release of embedded-hal
1.0, embedded Rust applications now have a stable API with semantic versioning that they can rely on for their applications. This improves maintainability for the applications themselves but also makes it easier to write drivers that will remain working for a long time.
Stable compiler
Starting with Rust 1.75, Embassy can now be compiled with a stable Rust compiler. This removes a roadblock for many who have reservations against using a nightly compiler. This will also improve the situation where different crates have different compiler support and put another hurdle for compiler regressions to impact Embassy applications.
USB
In addition to the HALs, the Embassy USB stack has also been released (embassy-usb and embassy-usb-driver). The USB stack is a fully async USB stack that works with all the Embassy HALs.
There are also some generic functionality in Embassy using it such as embassy-usb-logger
and embassy-usb-dfu
.
Networking
In addition to the existing embassy-net
crate, there are now multiple network drivers released:
- cyw43 - WiFi driver for the Raspberry Pi Pico W
- embassy-net-esp-hosted
- embassy-net-wiznet
- embassy-net-adin1110
- embassy-net-enc28j60
- embassy-net-tuntap
- embassy-net-ppp
These drivers integrate ethernet and WiFi chips with the embassy-net
networking stack (Embassy-net is an async layer on top of smoltcp TCP/IP stack).
Bootloader
Embassy Boot is a lightweight bootloader supporting firmware updates in a power-fail-safe way, with trial boots and rollbacks. With the release of Embassy HALs, the chip specific libraries can also be released: embassy-boot-nrf
, embassy-boot-stm32
and embassy-boot-rp
.
nrf-softdevice
The nrf-softdevice
crates provide an idiomatic Rust API wrapping Nordic's Softdevice bluetooth stack for nRF52 series microcontrollers. Together with embassy-nrf
, you can use it to build low-power applications that act as Bluetooth Low Energy central or peripheral devices.
The future
With all that out of the way, what is the way forward? As with all software, Embassy will still have bugs that needs fixing, new features that needs adding, so little will change in that regard. We will regularly release new versions of the crates to crates.io
with the latest improvements and features.
Now that crates no longer need to be built from git, board support crates and anything requiring a dependency on the HAL can now also be released, and it will be interesting to see what developers will built in the coming year.
Clearly, 2024 will be the year of Rust on embedded. Help us spread the word by showing, demoing and talking about Embassy as well as Embedded Rust!
Thanks
Thanks to the Rust Foundation for sponsoring Dario Nieuwenhuis (@dirbaio)'s work on Embassy through the Fellowship grants program.
Also, many thanks to all contributors to helped make this release possible!
- 28Smiles (@28Smiles)
- 9names (@9names)
- Aaron Tsui (@overheat)
- Adam Greig (@adamgreig)
- Adam Rizkalla (@ARizzo35)
- AdinAck (@AdinAck)
- Aidan Temple (@aidant)
- Alec C (@avlec)
- Aleksandr Krotov (@AzazKamaz)
- Alessandro Pezzato (@alepez)
- alexferro (@alexferro)
- Alex Martens (@newAM)
- Alex Moon (@alexmoon)
- Alpha3__0
- Antoine Mugnier
- Andres Hurtado Lopez
- Andres O. Vela (@andresovela)
- Andres Vahter (@andresv)
- Andrew Ealovega (@andyblarblar)
- Ardelean Călin (@Ardelean-Calin)
- arturkow2000 (@arturkow2000)
- arturkow2 (@arturkow2)
- Aurélien Jacobs (@aurelj)
- Badr Bouslikhin (@badrbouslikhin)
- Barnaby Walters (@barnabywalters)
- bartekkowalski (@bartekkowalski)
- Ben Gamari (@bgamari)
- Benjamin Ward (@WardBenjamin)
- Ben Schattinger (@lights0123)
- Ben Simms (@simmsb)
- Ben V. Brown (@Ralim)
- Björn Quentin (@bjoernQ)
- Bob McWhirter (@bobmcwhirter)
- bofh (@bofh)
- bors[bot] (@bors[bot])
- Brandon Ros (@brandonros)
- Brendon (@Weshnaw)
- brian horakh
- Brooks Rady (@TheLostLambda)
- Caleb Jamison (@CBJamo)
- Cameron Harris (@ilikepi63)
- Carlos Barrales (@cbruiz)
- Carl St-Laurent (@cstlaurent)
- Catherine (@whitequark)
- chrenderle (@chrenderle)
- Chris Price (@chrisprice)
- Christopher Hunt (@huntc)
- Christopher N. Hesse (@raymanfx)
- Chris Zen (@chris-zen)
- chrysn (@chrysn)
- Chuck Davis (@ceekdee)
- Côme (@numero-744)
- Corey Schuhen
- Cristian Eigel (@ceigel)
- cumthugo (@cumthugo)
- Daehyeok Mun (@daehyeok)
- dalegaard (@dalegaard)
- Daniel Berlin (@dberlin)
- Daniel Bevenius (@danbev)
- Dániel Buga (@bugadani)
- Daniel Franklin (@dzfranklin)
- Daniel Larsen (@daniel-larsen)
- Dave Hylands (@dhylands)
- David Andersen (@dave-andersen)
- Davide Della Giustina (@davidedellagiustina)
- David Kleingeld (@dvdsk)
- David Lenfesty (@davidlenfesty)
- David Purser (@davidpurser)
- Derek Hageman (@Sizurka)
- dev-guruprasath (@dev-guruprasath)
- Dietrich Beck
- Dion Dokter (@diondokter)
- Dirk Stolle (@striezel)
- Dominic Clifton (@hydra)
- Dominik Boehi (@Tiwalun)
- Dominik Sliwa (@randomplum)
- Don Reilly (@dreilly1982)
- dstric-aqueduct (@dstric-aqueduct)
- Emil Fresk (@korken89)
- Eric Yanush (@ericyanush)
- exoticorn (@exoticorn)
- eZio Pan (@eZioPan)
- Fabian Kunze (@fakusb)
- Folkert de Vries (@folkertdev)
- F_Punk (@fnafnio)
- Frederik
- Frostie314159 (@Frostie314159)
- ftilde (@ftilde)
- Gabriel Górski (@glaeqen)
- Gabriel Smith (@yodaldevoid)
- gak (@gak)
- GeorgeSoton (@georgeSoton)
- Ghaith Oueslati (@OueslatiGhaith)
- Glenn Dirkx (@Juravenator)
- GrantM11235 (@GrantM11235)
- Guillaume MICHEL (@guillaume-michel)
- Hailey Somerville (@haileys)
- Hannes (@umgefahren)
- Harry Brooke (@ExplodingWaffle)
- Henk Oordt (@hdoordt)
- Henrik Alsér (@kalkyl)
- Henrik Berg (@henrikberg)
- Ian McIntyre (@mciantyre)
- Ilya Epifanov (@ilya-epifanov)
- Imran K (@imrank03)
- ivmarkov (@ivmarkov)
- Jaap Prickartz (@jp99)
- Jacob Davis-Hansson (@jakewins)
- Jacob Rosenthal (@jacobrosenthal)
- Jake Swensen (@jdswensen)
- James Munns (@jamesmunns)
- James Waples (@jamwaffles)
- jan (@aspizu)
- Jan Christoph Bernack (@JcBernack)
- Jan Niehusmann (@jannic)
- jaxter184 (@jaxter184)
- Jeremy Fitzhardinge (@jsgf)
- Jesse Braham (@jessebraham)
- Joakim Hulthe (@hulthe)
- johannes (@johannesneyer)
- Johann Tuffe (@tafia)
- Jomer (@JomerDev)
- Jonathan Dickinson (@jcdickinson)
- Joonas Javanainen (@Gekkio)
- Josh Mcguigan (@JoshMcguigan)
- Joshua Salzedo (@theunkn0wn1)
- Julian (@JuliDi)
- Jurgis (@chemicstry)
- Justin Beaurivage (@jbeaurivage)
- Kai Bleeke (@kbleeke)
- Kaitlyn Kenwell (@Redrield)
- Kaspar Schleiser (@kaspar030)
- Kevin Lannen (@kevswims)
- KingCol13 (@KingCol13)
- Lachezar Lechev (@elpiel)
- Liam Murphy (@Liamolucko)
- Liigo Zhuang (@liigo)
- Linus Harberg
- Lixou (@DasLixou)
- Loïc Damien (@dzamlo)
- lonesometraveler (@lonesometraveler)
- loris libralato (@lorislibralato)
- Luca Barbato (@lu-zero)
- Lucas Granberg (@lucasgranberg)
- Lucas Kent (@rukai)
- Lukas Joeressen (@kext)
- Lukas Krejci (@metlos)
- luveti (@luveti)
- m5p3nc3r (@m5p3nc3r)
- Maja Piechotka (@uzytkownik)
- Marco Pastrello
- Mateusz Butkiewicz (@Mirror0)
- Mateusz (@dragonnn)
- Mathias Koch (@MathiasKoch)
- Mathieu Dupont (@m-dupont)
- Matous Hybl (@matoushybl)
- Matthias Devlamynck (@mdevlamynck)
- mattiasgronlund (@mattiasgronlund)
- Matt Ickstadt (@mattico)
- Matt Johnston (@mkj)
- Max (@mxdbck)
- mbrieske (@mbrieske)
- Mehmet Ali Anil (@mehmetalianil)
- Mia (@miathedev)
- Michael van Niekerk (@mvniekerk)
- Michal Srb (@michalsrb)
- Mick van Gelderen (@mickvangelderen)
- Mike Beaumont (@michaelbeaumont)
- mryndzionek (@mryndzionek)
- msamsonoff (@msamsonoff)
- Nicolas Viennot (@nviennot)
- Nigecat (@Nigecat)
- Nils Fitinghoff (@nilfit)
- ⭐️NINIKA⭐️ (@DCNick3)
- nitroxis (@nitroxis)
- Oliver Rockstedt (@sourcebox)
- Olivier Monnom (@papyDoctor)
- Olle Sandberg (@oll3)
- olofwalker (@olofwalker)
- Patricio Whittingslow (@soypat)
- Patrick Oppenlander (@pattop)
- Paweł Czochański (@czocher)
- Pawel Rawski (@itdiuna)
- pbert519 (@pbert519)
- Pedro Ferreira (@pferreir)
- pennae (@pennae)
- Peter Gibson (@petegibson)
- Peter Hansen (@peter9477)
- Peter Krull (@peterkrull)
- Philip A Reimer (@ant32)
- Phil Markgraf (@ShakenCodes)
- Piotr Esden-Tempski (@esden)
- Polly (@FuzzyLitchi)
- Priit Laes (@plaes)
- Qix (@Qix-)
- Quentin Smith (@quentinmit)
- Rafael Bachmann (@barafael)
- Ralf (@jr-oss)
- Randipa Gunathilake (@HelloWorldTeraByte)
- Rasmus Melchior Jacobsen (@rmja)
- Rasmus Pedersen (@rasmuspeders1)
- René van Dorst (@vDorst)
- Richard Dodd (dodj) (@derekdreery)
- Riley Williams (@riley-williams)
- Robert T Dowling (@RobertTDowling)
- Roman Isaikin (@romixlab)
- Roman Valls Guimera (@brainstorm)
- Roy Buitenhuis (@royb3)
- Ruben De Smet (@rubdos)
- Russ Hewgill
- Sam Lakerveld (@darkwater)
- Sam Mason (@CaptainMaso)
- Samuel Čavoj (@sammko)
- Samuel Tardieu (@samueltardieu)
- Satoshi Tanaka (@tana)
- sawi97 (@sawi97)
- schphil (@schphil)
- Scott Mabin (@MabezDev)
- Scott Mansell (@phire)
- Sebastian Goll (@sgoll)
- SekoiaTree (@SekoiaTree)
- Simon Berg (@fluffware)
- Sjoerd Simons (@sjoerdsimons)
- Slushee (@Slushee-a)
- smeenka (@smeenka)
- sodo (@djdisodo)
- Stephan Wolski (@Slowki)
- Swanand Mulay (@swanandx)
- swolix (@swolix)
- T-Bakker (@T-Bakker)
- Ted Feng (@artisdom)
- Thales (@thalesfragoso)
- Thierry Fleury (@TFleury)
- Thomas Shufps (@shufps)
- Til Blechschmidt (@TilBlechschmidt)
- Timo Kröger (@timokroeger)
- Timo (@t-moe)
- Tobias Breitwieser (@tarfu)
- Tobias Pisani
- Torin Cooper-Bennun (@tcbennun)
- Tshepang Mbambo (@tshepang)
- Tyler (@tyler-gilbert)
- Ulf Lilleengen (@lulf)
- Vadim Kaushan (@Disasm)
- Val Packett (@valpackett)
- Vasanthakumar Vijayasekaran (@VasanthakumarV)
- vasilNnikolov (@vasilNnikolov)
- Vincent Stakenburg (@FrozenDroid)
- Wilfried Chauveau (@ithinuel)
- Will Farrell (@wkf)
- Will Glynn (@willglynn)
- Will Yager (@wyager)
- xoviat (@xoviat)
- Zoey Riordan (@ZoeyR)