Better HN
topnewbestaskshowjobs
Log inSign up

eldruin

134 karma · joined Apr 7, 2020 (6y ago) · 20 submissions

Computer Engineer. https://github.com/eldruin

I blog mostly about Rust on embedded: https://blog.eldruin.com

Submissions

comment 2y ago · link · parent

A couple of years ago I wrote a MIDI player with a bluepill board (STM32F1 microcontroller) and a waveform generator (AD9833) in Rust. It was actually quite simple and a lot of fun to write (and hear!).

Video: [1]

Source code: [2]

[1]: https://blog.eldruin.com/ad983x-waveform-generator-dds-drive...

[2]: https://github.com/eldruin/driver-examples/blob/master/stm32...

comment 3y ago · link · parent

Looks great! Once you publish the code, please submit it to the Rust Embedded Showcase :)

https://showcase.rust-embedded.org/

comment 3y ago · link · parent

For those getting a 404, here the article in MarkDown: https://github.com/RustMagazine/rustmagazine/blob/main/conte...

comment 4y ago · link · parent

There are several microcontroller architectures within the Arduino family officially as well as compatible ones that are also called Arduino-something.

The classic (and oldest) are the AVR microcontrollers (ATmega), which are not supported by embassy nor rtic at the moment AFAIK. They are supported by Rust, though. see: https://github.com/rahix/avr-hal.

However, there are several other Arduino microcontrollers that are supported. For example the Arduino Nano RP2040, Arduino Nano 33 BLE (nRF), the Arduino MKR ones as well as the STM32duino (STM32F103, the one in the hugely popular $2 blue-pill boards) are all based on the ARM cortex-m architecture, which is supported by both embassy as well as rtic.

For espressif chips (like the esp32), support is being worked on by the manufacturer itself: https://github.com/embassy-rs/embassy/issues/745

Here an overview of microcontrollers in the (official) Arduino family: https://www.makeuseof.com/exploring-different-types-of-ardui...

comment 4y ago · link · parent

In Rust there is https://embassy.dev which is an async Rust framework for embedded. It has been shipping in products for years. Can be made real-time (for some definitions of it).

There is also RTIC https://rtic.rs which is a concurrency framework for real-time systems using interrupts. IIRC the car industry is interested in it.

comment 4y ago · link · parent

You can have a look at https://embassy.dev Rust+async on embedded

comment 4y ago · link · parent

Here a whole bunch of example programs for hardware device drivers written in Rust for use in embedded.

8.

Rust embedded device driver examples for bluepill, and other boards(github.com ↗)

3 points · by eldruin · 4y ago · 1 comment

comment 4y ago · link · parent

https://blog.eldruin.com I blog mostly about embedded Rust device drivers. It is a static blog made with Hexo and deployed to GitHub pages.

comment 4y ago · link · parent

Are you looking specifically at AVR? ARM works out-of-the-box with stable Rust.

I can really recommend getting a micro:bit board and following the discovery book [1].

There are a few other books in the embedded Rust bookshelf [2].

Otherwise, I wrote a bunch of sensor drivers and simple examples for several boards: [3]

[1]: https://docs.rust-embedded.org/discovery/index.html

[2]: https://docs.rust-embedded.org/

[3]: https://github.com/eldruin/driver-examples

comment 4y ago · link · parent

You may have started getting deprecation warnings because some methods in the `Error` trait have been deprecated [1] in favor of a different mechanism.

Then, you may have configured warnings to result in compilation errors in your build/project, however, I would argue this situation is not what most people would understand as "code not compiling due to a compiler update".

[1]: https://doc.rust-lang.org/std/error/trait.Error.html

comment 4y ago · link · parent

That's a way to avoid complicated coordinated upgrades across the ecosystem if certain conditions are met. It's called the "semver-trick" [1].

[1]: https://github.com/dtolnay/semver-trick

comment 4y ago · link · parent

This issue is on nightly Rust, not stable. A stable Rust compiler update should never break code.

See: https://doc.rust-lang.org/book/appendix-07-nightly-rust.html

comment 4y ago · link · parent

It depends on your target architecture. For example, embedded development on ARM with stable Rust has been possible since 2018 (Rust 1.31)

comment 4y ago · link · parent

Espressif (the makers of the hugely popular ESP32/ESP8266/... microcontrollers) hired an embedded Rust community member to work full time on Rust support for their chips: https://mabez.dev/blog/posts/esp-rust-espressif/

16.

This Year in Embedded Rust(blog.rust-embedded.org ↗)

144 points · by eldruin · 4y ago · 63 comments

comment 6y ago · link · parent

My platform-agnostic CCS811 air quality sensor is now complete.

18.

Show HN: CCS811 indoor air quality sensor driver in Rust(blog.eldruin.com ↗)

6 points · by eldruin · 6y ago · 1 comment

19.

Tips for hobby embedded development beginners(blog.eldruin.com ↗)

2 points · by eldruin · 6y ago · discuss

comment 6y ago · link · parent

Mine is: https://blog.eldruin.com I write mostly about device drivers I write in Rust for use in embedded.