The Embedded Working Group Newsletter - 14

This is the fourteenth newsletter of the Embedded WG where we highlight new progress, celebrate cool projects, thank the community, and advertise projects that need help!

This is a special "spotlight" edition of the newsletter, where we look at a few topics in a bit more detail. Let us know what you think of the new format, and if there is anything you'd like to see included in the next newsletter!

Discuss on users.rust-lang.org, on twitter, or on reddit!

Embedded Rust Applications on Stable!


Now that #[panic_handler] is stabilized in 1.30, you can write Cortex-M bare-metal applications with the stable compiler. All our Rust Embedded crates, such as cortex-m, cortex-m-rt and embedded-hal should be ready to use on stable, but please note our two tutorial books Discovery and The Embedded Rust Book still require 1.30 beta or 1.31 beta as they use 2018 edition syntax (which isn't stabilized until the 1.31 release).

If you are able to trial 1.31 beta, you can help us test:

The Newest Embedded WG Team: Cortex-A!


Screenshot of Cortex-A RFC

The Embedded Working Group has launched a Cortex-A team, to focus on supporting developers working on bare-metal, micro kernel, and other low-level tasks using ARM's Cortex-A series of microprocessors.

The team kicked off with four members: @andre-richter, @parched, @raw-bin, and @wizofe, and have already started assembling initial goals for their team.

The Monotron Visits Rust Belt Rust


@thejpster's project, the monotron, travelled to Ann Arbor Michigan for Rust Belt Rust 2018. Since its last conference appearance, it has gained a whole new list of features, including a serial application loader, a 3 channel wave table synthesizer, Atari Joystick support, and more!

Check out the video above for a demo of Snake on the monotron hardware.

Peripheral Ownership Woes? Not With shared-bus!


extern crate shared_bus;

// Create your bus peripheral as usual:
// let i2c = I2c::i2c1(dp.I2C1, (scl, sda), 90.khz(), clocks, &mut rcc.apb1);

let manager = shared_bus::CortexMBusManager::new(i2c);

// You can now acquire bus handles:
let mut handle = manager.acquire();
// handle implements `i2c::{Read, Write, WriteRead}`, depending on the
// implementations of the underlying peripheral

// Now, this works! :+1:
let port_a = Pcf8574(manager.acquire(), 0x39).unwrap();
let port_b = Pcf8574(manager.acquire(), 0x38).unwrap();

In most embedded-hal compatible drivers, the driver takes either ownership or a mutable reference to the peripheral used to interact with a component, such as I2C or SPI. For some protocols, such as I2C, which might have multiple devices connected to the same peripheral, managing ownership can be difficult (see embedded-hal/35 for discussion).

To address this, @Rahix developed shared-bus, a crate which provides safe shared access to these peripherals through the use of a mutex. This allows for access of the underlying peripheral in as many drivers as you need! Check out the release blog post for more details, and for examples on how to use this for your projects.

The Embedded Rust Community is Growing!


As we get closer to our goal of stable embedded development with Rust for the 2018 edition launch, the embedded community is ramping up. We did a quick twitter poll which received hundreds of responses, and heard from developers using or evaluating embedded rust for personal and work projects.

The Embedded WG has also grown, starting off this year with 8 developers on a single team, to a group of 27 developers across 11 teams, each with their own area of focus within the embedded rust space.

Now is a great time to start working with Embedded Rust, and we can't wait to see what the next year brings!

embedded-hal Ecosystem Crates


As part of the Weekly Driver Initiative, crates that are part of the embedded-hal ecosystem are now tracked in the Awesome Embedded Rust repository. Here is a current snapshot of what is available there:

TypeStatusCountDiff
Device Cratesreleased160
HAL Impl Cratesreleased130
Board Support Cratesreleased110
Driver Crates Releasedreleased16+1
Driver Crates WIPWIP46+6
no-std cratesreleased17+3