Search posts, tags, users, and pages
Alex K
rust esp32
Thank you Alex! Actually, an update is also coming out really soon (within days) to accommodate the latest crates versions and changes.
Regarding your question, one thing you can do is check each global GPIO button wrapper individually with if statements in the GPIO handler. This means that just like there is a clear_interrupt method being used on G_BUTTON, ' there is also anis_interrupt_set` method you can use that tells you if this particular GPIO was the one firing the interrupt. So, when entering the handler, you would check each button individually to determine the source of the interrupt. Within the if statement body, you would associate the code for each button.
First of all, thank you for reading and reacting to feedback. This is rare and highly appreciated.
I would like to share some thoughts... .
First of all, I would like to suggest to add an additional mentoring subscription, to allow office hours or short video-calls. I understand this will require additional time from you, but it would be beneficial to developers, like myself, who are facing problems, which are serious bottlenecks. I am not talking about solving our problems for us, but more like mentoring and pointing out directions.
I for one, would be prepared to pay a subscription of USD75 to USD100 per month, to get a direct line to you as a mentor, during my learning process. I think this would require 2 to 4 - 15mins mentoring interventions per month. I am open to your suggestions as well.
I don't know about other people learning Rust embedded and what issues they face, but in my situation I see the following:
the Rust embedded eco-system is changing at a fast pace, and code and examples, are outdated almost immediately. (as an example I have an esp32s3, and the examples don't work ... and I have been **ing to get embassy to simply compile:). In the end I just ordered a esp32c3 to simply try.
too many books and tutorials focus on explaining libraries, instead of teaching patterns, though-processes and giving you the tools to build libraries yourself.
You already have a few blogs where you go deeper into developing your own pac, hal, ... . Although this is more advanced, this is what I am looking for the most. Because by understanding how to build a hal-driver, you can actually get the skills to deeply understand Rust embedded.
I also think that debugging using probe-rs and gdb are essential skills, needed for embedded. At this moment the information and docs about that, is really lacking. I use neovim with probe-rs, gdb, and it's been hell to make this work:(.
Another suggestion is to create a 3rd book, debugging embedded rust apps. I for one would be happy to pay an additional subscription for that.
Apart from additional income, this would also enable you to improve the books on Rust, and make them state-of-art teaching ressources.
Kind regards, Alex K
Alex K I really appreciate the detailed feedback!
You are absolutely right. I see where you are coming from, as I faced many of the same issues. To address your points, starting with the mentoring, I promise to consider it, but I'd have to look into how I'd be able to fit it into my schedule. It would be quite challenging with everything else I have going on.
Regarding the ecosystem, yes, it is changing fast, and I am having difficulty keeping up with it myself. In fact, I created an updated version of the book I was about to release last Friday. While putting in the last touches, a crate update dropped on me, prompting me to change significant parts again. The good news is that the new release will be coming out this Friday. Also, with the latest book release, I provide working examples for all other versions of the ESP boards supported by Wokwi, including the S3.
Regarding debugging and patterns, I totally agree. There's much needed there, but it also depends on the hardware. Ultimately, I plan to create a complete path solution under a single subscription where learners can propagate through the Rust-embedded learning steps in an ordered manner. I still honestly do not have a timeline on that. I started a new job recently, and it's taking significant time.
Omar Hiari

Hello Omar, thank you for your book. Just got it. It's really the only book right now that helps someone getting into embedded with Rust to hit the ground running.
I have a question about interrupts. All examples including yours, works with one interrupt being set for one button.
What happens if you have two buttons, or say 3 buttons. If you set the interrupt to be launched on GPIO level, how does the critical section distinguish which button launched the interrupt.
I am trying to launch an interrupt with a button that ads 1 to a number, and another button which substracts one from a number.
Help would be appreciated! Alex