HNHacker News
TopNewBestAskShowJobs

eldruin

134 karma · joined April 7, 2020

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

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

submissionscomments
eldruin··on Playing audio files in a Pi Pico without a DAC
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...

eldruin··on The E-Ink Badge
Looks great! Once you publish the code, please submit it to the Rust Embedded Showcase :)

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

eldruin··on The Adoption of Rust in Business
For those getting a 404, here the article in MarkDown: https://github.com/RustMagazine/rustmagazine/blob/main/conte...
eldruin··on Introducing multitasking to Arduino
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...

eldruin··on Introducing multitasking to Arduino
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.

eldruin··on Introducing multitasking to Arduino
You can have a look at https://embassy.dev Rust+async on embedded
eldruin··on Rust embedded device driver examples for bluepill, and other boards
Here a whole bunch of example programs for hardware device drivers written in Rust for use in embedded.
eldruin··on Ask HN: Share your personal site
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.
eldruin··on This Year in Embedded Rust
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

eldruin··on This Year in Embedded Rust
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

eldruin··on This Year in Embedded Rust
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

eldruin··on This Year in Embedded Rust
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

eldruin··on This Year in Embedded Rust
It depends on your target architecture. For example, embedded development on ARM with stable Rust has been possible since 2018 (Rust 1.31)
eldruin··on This Year in Embedded Rust
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/
eldruin··on Show HN: CCS811 indoor air quality sensor driver in Rust
My platform-agnostic CCS811 air quality sensor is now complete.
eldruin··on Ask HN: What is your blog and why should I read it?
Mine is: https://blog.eldruin.com I write mostly about device drivers I write in Rust for use in embedded.