Skip to content

Commit 7a2bce1

Browse files
authored
Merge pull request #1 from rust-embedded/init-blog
Initialize Blog using Gutenberg
2 parents 1517bc9 + 230d70f commit 7a2bce1

28 files changed

+2524
-0
lines changed

config.toml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# The URL the site will be built for
2+
base_url = "https://blog.rust-embedded.org"
3+
4+
title = "Rust Embedded Working Group"
5+
description = """
6+
Blog of the Embedded Rust Working Group
7+
"""
8+
9+
# Whether to automatically compile all Sass files in the sass directory
10+
compile_sass = true
11+
12+
# Whether to do syntax highlighting
13+
# Theme can be customised by setting the `highlight_theme` variable to a theme supported by Gutenberg
14+
highlight_code = true
15+
16+
# Whether to build a search index to be used later on by a JavaScript library
17+
build_search_index = true
18+
19+
theme = "hyde"
20+
21+
generate_rss = true
22+
23+
[extra]
24+
hyde_links = [
25+
{url = "https://rust-lang.org", name = "The Rust Language"},
26+
{url = "https://github.com/rust-embedded/wg", name = "Embedded WG"},
27+
{url = "https://github.com/rust-embedded/blog", name = "The Blog on GitHub"},
28+
]

content/2018-03-15.md

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
+++
2+
title = "The Embedded Working Group Newsletter - 1"
3+
date = 2018-03-15
4+
draft = false
5+
in_search_index = true
6+
template = "page.html"
7+
+++
8+
9+
This is the first newsletter of the [Embedded WG]! We will be releasing this newsletter on a bi-weekly basis, and we are looking to highlight new progress, celebrate cool projects, thank the community, and advertise projects that need help!
10+
11+
<!-- more -->
12+
13+
If you want to mention something in [the next newsletter], make sure to leave a comment on the issue!
14+
15+
## Highlights
16+
17+
* [Tock-OS] has released the [1.0 of their kernel], gotten the Rust Userspace library back in order, and are working on a [new register interface]
18+
* [Emilgardis], [jamesmunns] and [ryankurte] have become collaborators of the [svd] and [svd2rust] projects.
19+
* [hannobraun], [ilya-epifanov], [thejpster], [therealprof] have become collaborators of the [embedded-hal] project.
20+
* [dvc94ch] has created the [riscv-rust] organization for all your embedded RISCV needs!
21+
* [dylanmckay] has begun [rebasing][avr-rust-rebase] the avr-rust/rust fork onto a recent rust-lang/rust version, bringing in LLVM 6.0 support.
22+
23+
## Embedded Projects
24+
25+
If you have an embedded project or blog post you would like to have featured in the Embedded WG Newsletter, make sure to mention it on the tracking issue for [the next newsletter], we would love to show it off!
26+
27+
### `embedded-hal` drivers
28+
29+
This is a list of recently released drivers that are part of the [Weekly Driver Initiative]. There are currently 5 Released Drivers, 14 WIP Drivers, and lots of TODOs!
30+
31+
* [pcein] has [released][pcein-blog] the third weekly driver for the [`adc-mcp3008`], an 8-channel 10-bit ADC.
32+
* [japaric] has [released][enc-blog] the fourth weekly driver for the [`enc28j60`], an Ethernet controller with SPI interface.
33+
* [dbrgn] has [released][mcp-blog] the fifth weekly driver for the [`mcp3425`], a 16-bit ADC with I2C interface.
34+
35+
## Thanks
36+
37+
* Thanks to everyone who has been commenting on the [Embedded WG Issues], especially for the [Embedded Rust Book] tracking issue!
38+
* [varkor] has fixed a [long standing LLVM bug][gh41315], that artificially increased the binary size of Rust programs, and backported the patch to rustc.
39+
* LLD is now being shipped with the Rust toolchain. [FenrirWolf] [patched Xargo][xargo-lld] so that Xargo users can make use of it too.
40+
41+
## Help Wanted
42+
43+
If you have an embedded project that could use contributors or maintainers, leave a comment for [the next newsletter]!
44+
45+
* We are [pretty close][cortex-m-rt-lld] to being able to use LLD to link Rust programs compiled for ARM Cortex-M but there are some [LLD bugs][lld-issues] that still need to be fixed. Help reporting these bugs upstream would be greatly appreciated!
46+
* Incremental compilation is in the roadmap for this year but it doesn't work with `no_std` binaries due to an [old rustc bug][gh18807] related to linking. Help us fix it! There's a proposed solution [here].
47+
* We want to explore stabilizing some assembly operations in core as an alternative to the unstable asm! macro. We would love some help identifying the assembly operations that need to be provided this way as some can be implemented in external assembly files without losing
48+
semantics. Details in issue [#63].
49+
50+
[#63]: https://github.com/rust-lang-nursery/embedded-wg/issues/63
51+
[1.0 of their kernel]: https://www.tockos.org/blog/2018/talking-tock-35/
52+
[`adc-mcp3008`]: https://crates.io/crates/adc-mcp3008
53+
[`enc28j60`]: https://crates.io/crates/enc28j60
54+
[`mcp3425`]: https://crates.io/crates/mcp3425
55+
[avr-rust-rebase]: https://github.com/avr-rust/rust/pull/91
56+
[cortex-m-rt-lld]: https://github.com/japaric/cortex-m-rt/issues/53
57+
[dbrgn]: https://github.com/dbrgn
58+
[dvc94ch]: https://github.com/dvc94ch
59+
[dylanmckay]: https://github.com/dylanmckay
60+
[Embedded Rust Book]: https://github.com/rust-lang-nursery/embedded-wg/issues/56
61+
[Embedded WG Issues]: https://github.com/rust-lang-nursery/embedded-wg/issues
62+
[Embedded WG]: https://github.com/rust-lang-nursery/embedded-wg
63+
[embedded-hal]: https://github.com/japaric/embedded-hal
64+
[Emilgardis]: https://github.com/Emilgardis
65+
[enc-blog]: http://blog.japaric.io/wd-4-enc28j60/
66+
[FenrirWolf]: https://github.com/FenrirWolf
67+
[gh18807]: https://github.com/rust-lang/rust/issues/18807
68+
[gh41315]: https://github.com/rust-lang/rust/issues/41315
69+
[hannobraun]: https://github.com/hannobraun
70+
[here]: https://github.com/rust-lang/rust/issues/47074#issuecomment-354588718
71+
[ilya-epifanov]: https://github.com/ilya-epifanov
72+
[jamesmunns]: https://github.com/jamesmunns
73+
[japaric]: https://github.com/japaric
74+
[lld-issues]: https://github.com/japaric/cortex-m-rt/issues/53#issuecomment-371972935
75+
[mcp-blog]: https://blog.dbrgn.ch/2018/3/13/rust-mcp3425-driver/
76+
[new register interface]: https://www.tockos.org/blog/2018/talking-tock-36/
77+
[pcein]: https://github.com/pcein
78+
[pcein-blog]: http://pramode.in/2018/02/24/an-introduction-to-writing-embedded-hal-based-drivers-in-rust/
79+
[riscv-rust]: https://github.com/riscv-rust
80+
[ryankurte]: https://github.com/ryankurte
81+
[svd2rust]: https://github.com/japaric/svd2rust
82+
[svd]: https://github.com/japaric/svd
83+
[the next newsletter]: https://github.com/rust-lang-nursery/embedded-wg/issues/65
84+
[thejpster]: https://github.com/thejpster
85+
[therealprof]: https://github.com/therealprof
86+
[Tock-OS]: https://github.com/helena-project/tock
87+
[varkor]: https://github.com/varkor
88+
[Weekly Driver Initiative]: https://github.com/rust-lang-nursery/embedded-wg/issues/39
89+
[xargo-lld]: https://github.com/japaric/xargo/pull/200

content/2018-03-29.md

+224
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,224 @@
1+
+++
2+
title = "The Embedded Working Group Newsletter - 2"
3+
date = 2018-03-29
4+
draft = false
5+
in_search_index = true
6+
template = "page.html"
7+
+++
8+
9+
This is the second bi-weekly newsletter of the [Embedded WG] where we highlight new progress, celebrate cool projects, thank the community, and advertise projects that need help!
10+
11+
<!-- more -->
12+
13+
If you want to mention something in [the next newsletter], make sure to leave a comment on the issue.
14+
15+
[the next newsletter]: https://github.com/rust-lang-nursery/embedded-wg/issues/72
16+
[Embedded WG]: https://github.com/rust-lang-nursery/embedded-wg
17+
18+
## Highlights
19+
20+
* [dbrgn] has kicked off an investigation on how to [mock embedded-hal] to make testing sensors easier
21+
* [emilgardis] and [ryankurte] are busy [refactoring] the [svd-parser] crate
22+
* [japaric], [hannobraun], and [jamesmunns] from the [Embedded WG] attended the 2018 Rust All Hands in Berlin, working on our goal to make [stable embedded rust development] possible in 2018. See the bottom of this post for more details!
23+
24+
[japaric]: https://github.com/japaric
25+
[hannobraun]: https://github.com/hannobraun
26+
[jamesmunns]: https://github.com/jamesmunns
27+
[mock embedded-hal]: https://github.com/rust-lang-nursery/embedded-wg/issues/70
28+
[stable embedded rust development]: https://github.com/rust-lang-nursery/embedded-wg/issues/42
29+
[refactoring]: https://github.com/japaric/svd/issues/46
30+
[svd-parser]: https://github.com/japaric/svd
31+
[ryankurte]: https://github.com/ryankurte
32+
[emilgardis]: https://github.com/Emilgardis
33+
34+
## Embedded Projects
35+
36+
If you have an embedded project or blog post you would like to have featured in the Embedded WG Newsletter, make sure to mention it on the tracking issue for [the next newsletter], we would love to show it off!
37+
38+
### `embedded-hal` drivers
39+
40+
This is a list of recently released drivers that are part of the [Weekly Driver Initiative]. There are currently 5 Released Drivers, 14 WIP Drivers, and lots of TODOs!
41+
42+
* [danielgallagher0] has released their [hts221] humidity and temperature sensor driver
43+
* [MrBuddyCasino] has released their I2C based [mcp9808] temperature sensor driver
44+
* [Ilya Epifanov] has released their I2C based [si5351] CMOS clock generator driver, check out the [si5351 docs] for more info
45+
* [Edwin Amsler] is working on their [axp209] PMIC driver
46+
* [dbrgn] is working on their Sensirion [sgp30] low-power gas sensor driver
47+
* [pcein] has started work on their [pcd8544] for SPI based LCD controllers used in displays like the Nokia 5110
48+
* [nordmoen] is working on their driver for the [hc-sr04] ultrasonic distance sensor
49+
50+
[Weekly Driver Initiative]: https://github.com/rust-lang-nursery/embedded-wg/issues/39
51+
[danielgallagher0]: https://github.com/danielgallagher0
52+
[hts221]: https://medium.com/@pdanielgallagher/hts221-humidity-and-temperature-sensor-88056ea9e5fa
53+
[MrBuddyCasino]: https://github.com/MrBuddyCasino
54+
[mcp9808]: https://crates.io/crates/mcp9808
55+
[Ilya Epifanov]: https://github.com/ilya-epifanov
56+
[si5351]: https://github.com/ilya-epifanov/si5351
57+
[si5351 docs]: https://docs.rs/si5351/0.1.5/si5351/
58+
[Edwin Amsler]: https://github.com/RandomInsano
59+
[axp209]: https://github.com/RandomInsano/axp209-rs
60+
[pcein]: https://github.com/pcein
61+
[pcd8544]: https://github.com/pcein/pcd8544
62+
[dbrgn]: https://github.com/dbrgn
63+
[sgp30]: https://github.com/dbrgn/sgp30-rs
64+
[nordmoen]: https://github.com/nordmoen
65+
[hc-sr04]: https://github.com/nordmoen/hc-sr04
66+
67+
### `embedded-hal` Board/Chip Support Crates
68+
69+
* [DoumanAsh] has started work on their [stm32l4x6-hal] chip support crate
70+
71+
[DoumanAsh]: https://github.com/DoumanAsh
72+
[stm32l4x6-hal]: https://github.com/DoumanAsh/stm32l4x6_hal
73+
74+
## Thanks
75+
76+
* Thanks to all of the Rust Team and Working Group members who took time at the All Hands to tackle some important Embedded Issues
77+
* Thanks to [Alex Chrichton] who pushed a fix to a [linker issue] mentioned in our [last newsletter]
78+
79+
[Alex Chrichton]: https://github.com/alexcrichton
80+
[linker issue]: https://github.com/rust-lang/rust/pull/49316
81+
[last newsletter]: https://github.com/rust-lang-nursery/embedded-wg/blob/master/newsletters/2018-03-15.md
82+
83+
## Help Wanted
84+
85+
* [Simon Sapin] posted some working code for the [DS3234] SPI RTC, and is looking for someone to turn it into a maintained crate!
86+
87+
[Simon Sapin]: https://github.com/SimonSapin
88+
[DS3234]: https://github.com/rust-lang-nursery/embedded-wg/issues/39#issuecomment-375262785
89+
90+
If you have an embedded project that could use contributors or maintainers, leave a comment for [the next newsletter]!
91+
92+
# Special Feature: The Embedded WG at the 2018 Rust All Hands
93+
94+
This week 15 or so Rust teams/working groups met for the Rust All Hands event in Berlin. Some members of the embedded WG were present and we had a chance to talk to the compiler, core and infra teams.
95+
96+
These are the highlights of our talks.
97+
98+
## Embedded Rust on stable
99+
100+
We had previously identified 3 unstable features / issues that tie embedded development to the nightly channel in https://github.com/japaric/stable-embedded-rust. We talked to the other Rust teams about the possibility of addressing these issues in time for the 2018 edition release and the conclusion was that they thought that the timeline was possible. These are the 3 unstable features we are referring to:
101+
102+
### Unstable Feature #1: `xargo`
103+
104+
We'll ship a rust-std component (pre-compiled `core`+`compiler-builtins`) for the `thumb*` and `msp430` targets. This removes the need for `xargo` so people will be able to do something like the following to cross compile to ARM Cortex-M:
105+
106+
```bash
107+
rustup target add thumb7m-none-eabi
108+
cargo build --target thumbv7m-none-eabi
109+
```
110+
111+
**Tracking issue**: [rust-lang/rust#49382].
112+
113+
[rust-lang/rust#49382]: https://github.com/rust-lang/rust/issues/49382
114+
115+
### Unstable Feature #2: `compiler-builtins`
116+
117+
`extern crate compiler_builtins` is unstable to directly use. The fix we have decided on is to inject that as part of the prelude you get from `#![no_std]`.
118+
119+
So, today `#![no_std]` expands to something like this:
120+
121+
``` rust
122+
#![no_std]
123+
extern crate core;
124+
```
125+
126+
With our change the expansion will run like this:
127+
128+
``` rust
129+
#![no_std]
130+
extern crate core;
131+
132+
// but this doesn't #![feature(compiler_builtins_lib)]
133+
extern crate compiler_builtins;
134+
```
135+
136+
In the future we might want to merge `compiler-builtins` into `core` but that requires more effort and can still be done if we do the `#![no_std]` prelude approach right now.
137+
138+
**Tracking issue:** [rust-lang/rust#49380]
139+
140+
[rust-lang/rust#49380]: https://github.com/rust-lang/rust/issues/49380
141+
142+
### Unstable Feature #3: `panic_fmt`
143+
144+
There's an accepted RFC (#2070) for a stable mechanism to select the behavior of `panic!` in `no_std` context, and there's a know issue where the arguments of `panic_fmt` are kept in the binary even when they are unused by the `panic_fmt` implementation (cf. [rust-lang/embedded-wg#41]).
145+
146+
[rust-lang/embedded-wg#41]: https://github.com/rust-lang-nursery/embedded-wg/issues/41
147+
148+
The main concern here was whether we'll be able to fix the binary size problem with the accepted design or if we'll need some new design. The compiler team thinks that this can be fixed with the existing design using MIR only rlibs but it's unlikely this will get fixed in time for the edition release. [nagisa] will likely propose an alternate solution that involves having Cargo select the panic provider crate.
149+
150+
[nagisa]: https://github.com/nagisa
151+
152+
## Non critical unstable features
153+
154+
There are some other unstable features that don't prevent you from doing embedded development, however they come up often when doing no-std development. We had a chat with people on the compiler team about them.
155+
156+
### Unstable Feature #4: `const fn`
157+
158+
This feature has been proposed for stabilization (cf. [rust-lang/rust#24111]).
159+
160+
[rust-lang/rust#24111]: https://github.com/rust-lang/rust/issues/24111#issuecomment-376649804
161+
162+
### Unstable Feature #5: `asm!`
163+
164+
**Background**: Some assembly operations can be implemented as external assembly files that are then called into using FFI; other ops though do need to be inlined into the function from which they are called to prevent losing semantics. Using external assembly file can be done on the stable channel. The second type of operation requires the unstable `asm!` macro.
165+
166+
The compiler team is not 100% sure on whether they want to stabilize inline assembly for the edition release. The embedded WG has proposed an alternative proposal: expose *some* assembly operations that need to be inlined as "Rust intrinsics" -- in a similar fashion to how SIMD is being implemented; these intrinsics would be in the `core::asm::$ARCH` module and they could either be implemented by lowering to a LLVM intrinsic or using inline assembly. For example:
167+
168+
``` rust
169+
pub mod asm {
170+
pub mod arm {
171+
#[inline(always)]
172+
pub fn cpsid() {
173+
unsafe {
174+
asm!("cpsid i" ::: "memory" : "volatile");
175+
}
176+
}
177+
}
178+
}
179+
```
180+
181+
These would be stable APIs with an unstable implementation. If LLVM assembler syntax changes, the implementations of these functions would have to be updated.
182+
183+
The embedded WG will submit an RFC proposing the `asm` module and that will include a list of assembly operations that (a) are common and (b) need to be inlined for different architectures.
184+
185+
### Unstable Feature #6: `#[used]`
186+
187+
This experimental feature has been in the compiler for a while and it's required in some scenarios when using LTO to prevent the compiler from dead-stripping some function / `static` that needs to be in the final binary.
188+
189+
We'll try to get it stabilized by the edition release but it's not a high priority feature.
190+
191+
## Stability of the Embedded Targets
192+
193+
We don't only want to make embedded Rust possible on stable; we also want to make sure the embedded targets don't regress. So we are going to add tests to rust-lang/rust CI to make sure regression block PRs from landing.
194+
195+
That effectively will make some of the embedded targets into the tier 1 platform. The core team is fine with adding the `thumb*` targets (ARM Cortex-M) to tier 1. Less maintained, still in development and not fully mature targets like AVR, MSP430 and RISCV will become tier 2 -- they'll be tested but won't block PRs and rust-std binaries will be produced but it's not guaranteed there will be binaries available for all nightly / beta / stable releases.
196+
197+
We'll open an issue to discuss with the infra team the exact tests we want to add and track progress on that, but have already told them about the kind of tests we want to add and they thought those kind of tests are possible to implement. The kind of tests we discussed were:
198+
199+
- It compiles and links
200+
- Runs the cross compiled binary in QEMU doesn't crash and exits with exit code 0.
201+
- Tracking the binary size of a program compiled with `-Os` / `-Oz` and notify someone or fail the build if the size changes by +/- 5-10% or something.
202+
203+
## LLVM backends that are not yet in rustc
204+
205+
There are two embedded LLVM backends that have not yet been enabled in rustc for different reasons: AVR and RISCV.
206+
207+
In the case of AVR the main reason is that some LLVM codegen bugs prevent you from building core for AVR. These bugs are related to 128-bit integers and formatting floats. The libs team discussed this some time ago and they decided they are fine with landing arch specific `#[cfg]` attributes to remove 128-bit integers and other things like float APIs.
208+
209+
In the case of RISCV the LLVM backend is currently under active development and our current version of LLVM doesn't fully support RISCV. We would have to backport several patches to make RISCV work on our LLVM version. The core team feels OK with backporting those patches as long as they have already landed in upstream LLVM, and are not still under review.
210+
211+
## Tooling
212+
213+
Getting tooling for e.g. binary inspection (e.g. `objdump`) can be hard on some platforms (e.g. Windows) specially for architecture which currently are not too widely used (e.g. RISCV). We can improve the situation here by shipping llvm tools with the Rust toolchain -- with one set of those tools you can inspect all the architectures that Rust supports. These are the thoughts of the core / infra team regarding this:
214+
215+
- We put these tools in the sysroot and have them always shipped with the Rust toolchain so no `rustup component add` required -- this is already the case with `lld`. It might not be possible to provide these tools on all platforms but it's very likely they'll be available on tier 1 platforms.
216+
- We do *not* add these tools to the user `$PATH`. Instead some Cargo subcommand will be created by the embedded WG (e.g. `cargo objdump`) and that subcommand will look for `llvm-objdump` in the sysroot and do the right thing.
217+
- We make no guarantees about the semantics and interface of these tools being preserved over time (e.g. CLI changes, user facing output format changes, etc.).
218+
219+
### The Embedded Rust Book
220+
221+
We decided on an initial audience for the embedded book; we will be targeting people that know some embedded stuff *and* some Rust. The main reason for this is that if someone knows one and not the
222+
other then they can go and read existing Rust documentation or the Discovery book and then read the embedded book. For more details check [rust-lang-nursery/embedded-wg#56].
223+
224+
[rust-lang-nursery/embedded-wg#56]: https://github.com/rust-lang-nursery/embedded-wg/issues/56

0 commit comments

Comments
 (0)