|
| 1 | ++++ |
| 2 | +title = "The Embedded Working Group Newsletter - 14" |
| 3 | +date = 2018-10-28 |
| 4 | +draft = false |
| 5 | +in_search_index = true |
| 6 | +template = "page.html" |
| 7 | ++++ |
| 8 | + |
| 9 | +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! |
| 10 | + |
| 11 | +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]! |
| 12 | + |
| 13 | +[Embedded WG]: https://github.com/rust-embedded/wg |
| 14 | + |
| 15 | +Discuss on [users.rust-lang.org], [on twitter], or [on reddit]! |
| 16 | + |
| 17 | +[users.rust-lang.org]: # |
| 18 | +[on twitter]: # |
| 19 | +[on reddit]: # |
| 20 | +[the next newsletter]: https://github.com/rust-embedded/blog/issues/22 |
| 21 | + |
| 22 | +<!-- more --> |
| 23 | + |
| 24 | +## Embedded Rust Applications on Stable! |
| 25 | + |
| 26 | +<hr> |
| 27 | + |
| 28 | +<blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr">Rust 1.30 is here! Proc macros, no_std binaries, and a progress bar for cargo! 🎊🎉🦀 <a href="https://t.co/IXm5xFYlhU">https://t.co/IXm5xFYlhU</a></p>— Rust Language (@rustlang) <a href="https://twitter.com/rustlang/status/1055499747056852993?ref_src=twsrc%5Etfw">October 25, 2018</a></blockquote> |
| 29 | +<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> |
| 30 | + |
| 31 | +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). |
| 32 | + |
| 33 | +[1.30]: https://blog.rust-lang.org/2018/10/25/Rust-1.30.0.html |
| 34 | +[Discovery]: https://rust-embedded.github.io/discovery/ |
| 35 | +[The Embedded Rust Book]: https://rust-embedded.github.io/book/ |
| 36 | + |
| 37 | +If you are able to trial 1.31 beta, you can help us test: |
| 38 | + |
| 39 | +* Minimal `const` functions (useful for initializing static variables) |
| 40 | +* 2018 edition syntax (including changes to `use` and `extern crate`) |
| 41 | + |
| 42 | +## The Newest Embedded WG Team: Cortex-A! |
| 43 | + |
| 44 | +<hr> |
| 45 | + |
| 46 | +![Screenshot of Cortex-A RFC][cortex-a-screenshot] |
| 47 | + |
| 48 | +[cortex-a-screenshot]: ../screenshot-cortex-a.png |
| 49 | + |
| 50 | +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. |
| 51 | + |
| 52 | +The team kicked off with four members: [@andre-richter], [@parched], [@raw-bin], and [@wizofe], and have already started assembling initial [goals for their team]. |
| 53 | + |
| 54 | +[goals for their team]: https://github.com/rust-embedded/wg/milestone/5 |
| 55 | +[@andre-richter]: https://github.com/andre-richter |
| 56 | +[@parched]: https://github.com/parched |
| 57 | +[@raw-bin]: https://github.com/raw-bin |
| 58 | +[@wizofe]: https://github.com/wizofe |
| 59 | + |
| 60 | + |
| 61 | +## The Monotron Visits Rust Belt Rust |
| 62 | + |
| 63 | +<hr> |
| 64 | + |
| 65 | +<blockquote class="twitter-tweet" data-conversation="none" data-lang="en"><p lang="en" dir="ltr">Astonishing. Smashed my high score! <a href="https://t.co/WG9FXc8Kao">pic.twitter.com/WG9FXc8Kao</a></p>— Jonathan Pallant (@therealjpster) <a href="https://twitter.com/therealjpster/status/1053698944360951813?ref_src=twsrc%5Etfw">October 20, 2018</a></blockquote> |
| 66 | +<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> |
| 67 | + |
| 68 | +[@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! |
| 69 | + |
| 70 | +Check out the video above for a demo of Snake on the monotron hardware. |
| 71 | + |
| 72 | +[Rust Belt Rust 2018]: https://rust-belt-rust.com/ |
| 73 | +[@thejpster]: https://github.com/thejpster |
| 74 | +[monotron]: https://github.com/thejpster/monotron |
| 75 | +[last conference appearance]: https://www.youtube.com/watch?v=pTEYqpcQ6lg |
| 76 | +[list of features]: https://twitter.com/therealjpster/status/1055187256091332608 |
| 77 | + |
| 78 | +## Peripheral Ownership Woes? Not With `shared-bus`! |
| 79 | + |
| 80 | +<hr> |
| 81 | + |
| 82 | +```rust |
| 83 | +extern crate shared_bus; |
| 84 | + |
| 85 | +// Create your bus peripheral as usual: |
| 86 | +// let i2c = I2c::i2c1(dp.I2C1, (scl, sda), 90.khz(), clocks, &mut rcc.apb1); |
| 87 | + |
| 88 | +let manager = shared_bus::CortexMBusManager::new(i2c); |
| 89 | + |
| 90 | +// You can now acquire bus handles: |
| 91 | +let mut handle = manager.acquire(); |
| 92 | +// handle implements `i2c::{Read, Write, WriteRead}`, depending on the |
| 93 | +// implementations of the underlying peripheral |
| 94 | + |
| 95 | +// Now, this works! :+1: |
| 96 | +let port_a = Pcf8574(manager.acquire(), 0x39).unwrap(); |
| 97 | +let port_b = Pcf8574(manager.acquire(), 0x38).unwrap(); |
| 98 | +``` |
| 99 | + |
| 100 | +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). |
| 101 | + |
| 102 | +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. |
| 103 | + |
| 104 | + |
| 105 | +[@Rahix]: https://github.com/Rahix |
| 106 | +[embedded-hal/35]: https://github.com/rust-embedded/embedded-hal/issues/35 |
| 107 | +[shared-bus]: https://github.com/Rahix/shared-bus |
| 108 | +[release blog post]: https://blog.rahix.de/001-shared-bus/ |
| 109 | + |
| 110 | +## The Embedded Rust Community is Growing! |
| 111 | + |
| 112 | +<hr> |
| 113 | + |
| 114 | +<blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr">Happy Tuesday! Quick poll: What are you using <a href="https://twitter.com/hashtag/embedded?src=hash&ref_src=twsrc%5Etfw">#embedded</a> <a href="https://twitter.com/rustlang?ref_src=twsrc%5Etfw">@rustlang</a> for right now?<br><br>RTs appreciated!</p>— Rust Embedded Working Group (@rustembedded) <a href="https://twitter.com/rustembedded/status/1052189142065405952?ref_src=twsrc%5Etfw">October 16, 2018</a></blockquote> |
| 115 | +<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> |
| 116 | + |
| 117 | +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. |
| 118 | + |
| 119 | +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. |
| 120 | + |
| 121 | +Now is a great time to start working with Embedded Rust, and we can't wait to see what the next year brings! |
| 122 | + |
| 123 | +## `embedded-hal` Ecosystem Crates |
| 124 | + |
| 125 | +<hr> |
| 126 | + |
| 127 | +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: |
| 128 | + |
| 129 | +| Type | Status | Count | Diff | |
| 130 | +| :--- | :----- | :---- | :--- | |
| 131 | +| [Device Crates] | released | 16 | 0 | |
| 132 | +| [HAL Impl Crates] | released | 13 | 0 | |
| 133 | +| [Board Support Crates] | released | 11 | 0 | |
| 134 | +| [Driver Crates Released] | released | 16 | +1 | |
| 135 | +| [Driver Crates WIP] | WIP | 46 | +6 | |
| 136 | +| [no-std crates] | released | 17 | +3 | |
| 137 | + |
| 138 | +[Awesome Embedded Rust]: https://github.com/rust-embedded/awesome-embedded-rust |
| 139 | +[Weekly Driver Initiative]: https://github.com/rust-embedded/wg/issues/39 |
| 140 | +[Device Crates]: https://github.com/rust-embedded/awesome-embedded-rust#device-crates |
| 141 | +[HAL Impl Crates]: https://github.com/rust-embedded/awesome-embedded-rust#hal-implementation-crates |
| 142 | +[Board Support Crates]: https://github.com/rust-embedded/awesome-embedded-rust#board-support-crates |
| 143 | +[Driver Crates Released]: https://github.com/rust-embedded/awesome-embedded-rust#driver-crates |
| 144 | +[Driver Crates WIP]: https://github.com/rust-embedded/awesome-embedded-rust#wip |
| 145 | +[no-std crates]: https://github.com/rust-embedded/awesome-embedded-rust#no-std-crates |
0 commit comments