Introduction
Inspired by James Munns's call, and as 2023 is coming to an end, I figure it's a good opportunity to reflect and look forward to 2024. It's been a bit over 1.5 years since I embarked on my embedded Rust journey and it's been nothing less than exciting since. So here it goes.
The Beginnings ๐ถ
It all started through a habit I have of reading job descriptions, particularly in the embedded space, to understand market trends. Back in 2021, alongside the usual suspects of C and C++, I recall seeing Rust as a preferred skill and having no clue what it was. After that, the more I got into Rust, the more I figured that it makes the most sense for embedded going forward.
Rust is stereotyped as a language that is hard to learn. My perspective is that what makes it feel hard is that it requires an adapted mindset. Because the thing is, once you get used to Rust, you start feeling that it's easier to deal with compared to other languages. For me, at this point, I find it hard sometimes to adapt my mindset back to languages like C. Though regardless, huge strides have been made in teaching the language. At this point, there is no shortage of free and paid educational material, and resources are only increasing. This is also impacted by the sheer number of people adopting Rust.
In the embedded Rust space, things were (and still are somewhat) a bit reversed. What I mean by this is that it is harder to get started with embedded Rust than Rust itself, yet, there probably isn't nearly as much guidance/resources. There is a growing gap between the quickly evolving ecosystem and the limited educational resources. There is a good number of options/combinations to get started with from choices of HALs, PACs, Embassy, RTIC, std, no-std....etc. This is apart from existing challenges for embedded beginners like identifying a controller/dev board and setting up a toolchain. Many ways to get started, without necessarily a clear path add intimidation and confusion factors. This can be an obstacle to increased adoption which is needed to facilitate more (and thus faster) growth.
I might be naive in thinking this, but the formula in my mind is simple; easy access leads to faster adoption. For a newbie, comparing Rust to embedded Rust, it's two contrasting experiences. It literally takes a few seconds to get started with Rust while with embedded, well, it varies. It varies with the level of experience and platform, but it probably ranges from seconds to hours.
The Gaps ๐ณ๏ธ
I subscribe to the belief that increasing educational resources is a crucial part of increased adoption. As a result, after gaining some footing I set out myself with a focus on embedded Rust education. Some of the gaps I realized included:
Material Focus: Many educational resources take the approach of focusing on what Rust brings to embedded, rather than how embedded works with Rust. For example, if you grab any traditional embedded book, the material assumes knowledge of C/C++ and explains embedded concepts with C as a tool. This is not something that I found to be the case with Rust-embedded material (but was an expectation of mine). This might not be ideal for one starting with embedded and Rust. Why? because embedded context is assumed to exist. I felt at the time there was somewhat of a community mindset focused on convincing familiar users that Rust is good for embedded. Now though I think the evolving mindset needs to be that Rust is here to stay and this is how embedded is done using Rust.ย Thinking of it, one who knows how good Rust is would only want to try it in a different context. This made it one of my goals to get more non-embedded Rustaceans into the field.
Incomplete Documentation: Going through existing resources at the time, I always had thoughts of "what about if I wanted to do x or y?". For that, existing learning material only would give a flavor. So I dived into the world of embedded crate documentation and a long dive it was. I recall how navigating and interpreting documentation was quite a challenging experience at the start. Also while there were many abstractions there were several methods without descriptions. Some methods were self-explanatory, others were not. I often had to dig into the source to figure out certain things. A reverse engineering task. I even published several posts since trying to address this gap. Also while the documentation part remains an issue, I feel it is recognized within the community.
Missing Context: Code examples are great, which many HAL repositories include, though I don't think raw examples are beginner material. The biggest issue is that many of the examples miss context or explanation. As a result, figuring out what the example does becomes another reverse engineering task. I recall instances that I had to figure out from the code example what particular device/sensor is being interacted with. The examples might have not targeted beginners, but they must do so with time. Maybe supplemented with more comments or associated with explanatory material.
Unnoticed Work: There are a lot of great contributions done by the Rust community that I felt might be going unnoticed. Many members have invested incredible time in contributing toward different projects and creating material but I felt they might not have gotten the deserved exposure.
2023 Reflections ๐ช
In the content I've been producing and the contributions I make, my goal was always and still is to address the gaps I mentioned earlier. A big part of it is to attract first-time embedded curious users who love Rust. At least in the educational space, there's a lot of ground to cover, and I had hoped to do much more, but I am doing this mostly in my spare time. However, at least in 2023, here are some of the milestones I reached and accomplishments I achieved:
-
โ๏ธ 88 Blog Posts: These blog posts have been mostly Rust-embedded tutorials that I publish weekly. The idea or focus was to help beginners get started with tutorial posts. Each post is also associated with a template project to provide a starting point. Out of the 88 Posts, there were focused series including the following:
๐ฐ The Embedded Rustacean Newsletter: This was an effort I established to help bring more focus on different parts of embedded Rust. The space is moving fast and having a resource summarizing activities periodically helps community members stay up to date. This includes; highlighting projects, educational material, industry trends, Rust adoptions, and jobs among others. Since launching the newsletter, several individuals have expressed how there is much more going on in embedded Rust than they perceived.
๐ฐ๏ธ AeroRust Space Conference: Part of this conference was a 1-day workshop on embedded Rust that I contributed to. The workshop material targets embedded space enthusiasts who want to build with Rust. The workshop included the building of a pseudo-nano satellite platform using Embassy and ESP. For the interested, the material is all open-sourced here. The learners got to tinker with real hardware building a small nanosatellite and also programming it.
๐ Embedded Electronics Book: While this is not embedded Rust-focused, it was inspired by community beginner struggles. Many new learners get lost in the early electronic configurations of microcontrollers. I figured a resource like this would help fill in some gaps.
A Look Forward to 2024 ๐ฎ
What I Have in Plan
A Book on Embedded Rust: The electronics book was actually a distraction from another book project I was working on. This new book aligns with filling one of the earlier gaps mentioned; A book with material that covers embedded foundations with Rust.
More & More Blog Posts: With upcoming posts, I hope to fill in more educational gaps. I notice there is a lot of interest within the community in Embassy. I have also gotten notes for creating tutorials on additional devices like the Raspberry Pi Pico and the nRF series of devices. I'd personally also like to highlight exciting projects like Shuttle and Ockam that I find have a lot of potential. Even work with several driver crates.
Expand Embedded Rust Reach: I hope to do this by expanding the reach of the newsletter. Highlight embedded trends and opportunities as they come along. Also, keep the community informed of activities that are going on and give exposure to the work that is being done. This would be hopefully a vehicle to attract more embedded enthusiasts into the Rust space as well.
What I'd Hope to See
These are things that are probably better suited as community efforts:
Plug and Play: This goes to the goal of being able to get started with embedded Rust in seconds. A self-contained solution including hardware with a preconfigured toolchain and a project template to get started developing embedded Rust in a jiffy. Maybe the best way to explain this is to have an Arduino-like model. This includes embedded Rust-branded development boards integrating controllers that the community identifies/adopts. Along with a VSCode extension like PlatformIO or even a lightweight IDE like Arduino to spawn preconfigured projects quickly. All this can bring more community focus on developing examples and crates around the Rust boards. Having boards also answer a beginner's big question of "What hardware should I buy?". I would say from my viewpoint that the current effort that looks closest to this is the ecosystem Espressif is building around ESPs with Rust.
More Wokwi Integration: Wokwi is an amazing embedded simulator and is great for getting started quickly. For a learner, there's no need for toolchain setup or even the purchase of hardware. There are many features as well that make it quite a flexible tool supporting a lot of features right from the browser. Users can also vote for more features. Still maybe at some point, one might want to tinker with physical hardware. However, at that point, they would have gained some confidence first. Currently, only ESP boards are supported with Rust on Wokwi. I hope for the variety to expand soon.
Acknowledgments ๐
None of this work would have been possible without community support. I always thought that even had Rust sucked, I would probably stick around because of the community. I would like to give special thanks to the following people:
Juraj Michalek and Sergio Gasquez of Espressif Systems for embracing my work, helping integrate me into community meetings, proofreading my book, and offering different means of support.
Aissata Maiga of Ferrous Systems in her support proofreading my book and providing invaluable input. Also as one of the community members to recognize my work early on.
Lachezar Lechev of AeroRust for inviting me to become part of the AeroRust space conference. Also for being a great host during my time at the conference.
Jeremy Lempereur of Apollo GraphQL for sponsoring my trip to the AeroRust space conference.
Conclusion
I think that a core driver to accelerated Embedded Rust adoption is the production of more educational material. Those interested in embedded Rust do not all necessarily come from an embedded background. Creating educational material comes with the challenge of simplifying concepts and providing a quick way to start. It's easy for a regular practitioner to get caught up with what they think is easy though it's different for a beginner. Strides have been made in this context for embedded Rust but more work remains. 2023 was an exciting year for embedded Rust in that regard, I only look forward to what's to come in 2024.
Top comments (3)
As a student new to Rust, I find your thoughts really inspiring! I ran into some of the same issues, especially with limited resources for built-in Rust. Trying to figure out where to start and what tools to use can be overwhelming. I totally agree that having more accessible learning materials would help a lot of newbies like me. By the way, I recently found the site EduBirdie which helped me a lot to organize my studies and manage my time better. Sometimes there are too many tasks and similar resources help to better balance the busy ones. Looking forward to more great content from you!
Hi Omar, thanks for all the materials youโve put out! Iโve done some rust for hobby projects (the only kind I do) like web services, and recently got interested in the language for an Adafruit feather I couldnโt get working with the arduino libraries. Youโve hit the nail on the head on the gaps that are out thereโIโm really looking forward to your book explaining embedded fundamentals through Rust because thatโs exactly the book I wish I could read now! Also totally agree that an analogue to arduino would be amazing! Iโd love it if using rust in this area were that easy!
Hi there @chuckberrypi ! I truly appreciate your kind words and enthusiasm for my work. It's fantastic to hear about your experiences with Rust and your interest in using it for embedded development. The comments and feedback like yours that I have been receiving contribute a huge deal in my excitement.
I'm thrilled that you resonate with the gaps I've mentioned. Your feedback reinforces the need for accessible materials that bridge the gaps in embedded Rust education. I'm committed to keep on creating resources simplifying embedded fundamentals through Rust, making it more approachable to anybody interested. The Arduino-like approach is something I really would like to see happen. The simplicity and ease of use that the Arduino platform provides have been instrumental in onboarding countless enthusiasts, and it's a model I believe could work wonders for Rust in the embedded space.
Thank you again for your comment and support, I can't wait to share more insights and knowledge with you and the community through my upcoming material. If you have any specific topics or features you'd like to see covered, feel free to share your thoughts. Happy coding!