What exactly is difference of avr-hal vs avr-rust?

Hello everyone first time posting!

been wanting to dive into Rust embedded for a while.
Unfortunately It will be a while until I can get some proper hardware like what is in the rust-embedded book, so until then I am using my 8 bit arduino nano clone that I already have

I came across these 2 repositories avr-hal and avr-rust

Both seem to be popular, which one would you suggest to a beginner? which would have least bugs, more support, etc? and/or is there other alternatives you'd reccomend?

Many thanks!

If you are a beginner you should follow the guidebook from avr-rust: https://book.avr-rust.com/.

avr-hal is an embedded-hal implementation. embedded-hal is a hardware abstraction layer being developed by Rust's embedded devices working group. It is useful if you are familiar with embedded-hal, but you probably aren't.

2 Likes

This does not directly answer your question, but because you mentioned being a beginner I thought I write something on that respect.
I do not know what your background is, but from my personal experience as a seasoned embedded C programmer I would recommend:

  • Learn Rust first (i.e. read the book), make sure you understand the ownership rules
  • Dive into embedded Rust using QEmu (hardware emulator in the embedded Rust book). Ownership rules make it handling peripherals not very intuitive at first (if you are used to C's everything-goes approach).
  • Once you feel comfortable with how things work in embedded Rust, you can have fun with real hardware
1 Like

Thx for advise. I've actually been going through rustlings to compliment the book. Enjoying it a lot

Thanks for clarifying, Indeed I am not familiar with embedded hal. I will continue with avr-rust

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.