Embedded Rust in 2018

January 21, 2018

This is my #Rust2018 blog post. These are some things I think the Rust team needs to address this year to make Rust a (more) viable alternative to C/C++ in the area of bare metal (i.e. no_std) embedded applications. Stability Here’s a list of breakage / regressions I encountered (i.e. that I had to work around / fix) during 2017: Changes in target specification files broke compilation of no_std projects that use custom targets. ... Read more

Brave new I/O

January 18, 2018

Hey there! It’s been a while. I’ve been working on some cool stuff for you. Now that’s in more or less good shape I can blog about it! This blog post introduces our new approach to I/O in embedded contexts. Overview: The register model First some background information In microcontrollers all external I/O requires interacting with peripherals. Peripherals are additional pieces of electronics that sit in the same chip / package as the core processor. ... Read more

RTFM v2: simpler, less overhead and more device support

July 29, 2017

Hiya folks! It’s been a while. Today I’m pleased to present the next version of the Real Time For the Masses framework: cortex-m-rtfm v0.2.0 or just v2, which is how I like to call it. Here’s the executive summary of the changes: v2 is simpler. v1 used a bunch of tokens – ceiling tokens, priority tokens, preemption threshold tokens and task tokens – for memory safety; this made the API rather boilerplatery. ... Read more

A CPU usage monitor for the RTFM framework

June 4, 2017

We have used the RTFM framework in the previous posts but put most of the application logic in tasks, and always sent the processor to sleep in the idle function. In this post we’ll put the idle function to better use and build a CPU usage monitor there. Idle The main logic of the CPU usage monitor will be in the idle function. Let’s see how it works: // RESOURCES peripherals! ... Read more

The ITM and the quest for faster logging

May 31, 2017

In this post we’ll explore the different alternatives one has to log data from a microcontroller to some host machine. Be it for printf style debugging or for logging sensor data. The Blue Pill This time I’ll use a different development board: the Blue Pill. On the center the Blue Pill development board. On the left side a UART to USB adapter based on the CH340G. On the right side an SWD programmer: a Chinese clone of the ST-LINK. ... Read more

Overhead analysis of the RTFM framework

May 23, 2017

In the last post I introduced the RTFM framework, and made several claims about it being highly efficient both in memory usage and runtime overhead. In this post I’ll analyze all the RTFM concurrency primitives to back up those claims. To do that I’ll first introduce a non-invasive timing method that’s accurate to a single clock cycle, which is the time the processor spends to execute one of the simplest instructions. ... Read more

Fearless concurrency in your microcontroller

May 9, 2017

I want to start by thanking all the people that has sent improvements and comments to all the crates and tools I presented in the last blog post. The Rust community rocks! Last time I showed you how to easily develop Rust programs for pretty much any ARM Cortex-M microcontroller. In this post I’ll show you one way of doing memory safe concurrency. It’s important to note that the Rust language doesn’t impose a single concurrency model. ... Read more

Rust your ARM microcontroller!

April 28, 2017

IMPORTANT! READ THIS! Hello there! This article is outdated and following it will only confuse you. Check out the embedded Rust book and the rest of the embedded WG bookshelf for up to date and maintained documentation on embedded Rust development. If you still want to read this post, for historical reasons and what now, scroll down. Want to program your microcontroller in Rust but your microcontroller vendor doesn’t provide a Rust HAL / SDK? ... Read more

Hello, world!

April 24, 2017

Hey there! Welcome to my blog, where I’ll be writing about Rust and embedded systems-y stuff – that’s it, mainly about programming ARM Cortex-M microcontrollers as that’s what Rust best supports today 1. But, I’m interested in anything that has a #![no_std] attribute in it 2 so I may cover some other stuff as well. That being said, this first post is neither about Rust or embedded stuff as it’s mainly for testing my blogging setup; so, why not write about that instead? ... Read more

Creative Commons License
Jorge Aparicio