Rust bindings to nrf52 series

In mid-2017, I came across this project by James Munns. It essentially wraps the C SDK for nRF52 development boards, and provides bindings that can be called from Rust. James gave a talk to the Rust DC Meetup, remotely over video conference. This talk inspired me to buy a couple of nRF52 dev boards.

I'd like to announce that here, in Nordic's official channels, because I'd like more embedded developers to become aware of it. Rust is a language that has the ability to compile down to native code with zero runtime, and no operating system. In other words, Rust can run on bare metal hardware. Today.

My ultimate dream is for hardware manufacturers themselves to provide official support. My understanding is that supporting Rust will be much more akin to supporting C, and not really like providing a special runtime for embedded Python or JavaScript.

Some challenges we will face (you can help!):

  1. We do not have a clear path for upgrading our Nordic SDK. We simply check in the C code, and there's some manual work around collecting all the headers for input to code generation.
  2. Speaking of code generation, bindgen, the tool that takes C header files and generates rust types, has been evolving rapidly. On one occasion the changes to generated code caused breaking changes in our nrf52 bindings library.
  3. We have a few examples to test blinking lights and connecting via bluetooth, but perhaps we might benefit from a more structured list of things to test to ensure we provide working bindings to the whole nrf52 dev kit.
  4. Related to 3, just kick the tires and open issues if you need help!

If you are interested, here are some links to learn more:

Here is a link to the GitHub repository

Here is a link to the full video recording of the DC Meetup talk. It offers a detailed overview of our embedded development workflow.

Finally, here is a recent talk about using "unsafe" code in Rust. This is relevant, because in the embedded context a lot of code involves usage of the unsafe keyword. This talk explains why that's necessary and not as scary as it sounds.

Parents
  • I am really excited to share my thoughts on the project by James Munns that wraps the C SDK for nRF52 development boards and provides Rust bindings. After watching James' talk at the Rust DC Meetup, I was truly inspired and decided to purchase a couple of nRF52 dev boards myself.

    First and foremost, I want to express my support for this project and encourage its promotion through Nordic's official channels. It is crucial for more embedded developers to become aware of the possibilities that Rust brings to the table. Rust's ability to compile down to native code without any runtime or operating system dependency is truly remarkable Qr Code Genertator. With Rust, we can now run code on bare metal hardware, opening up new opportunities for embedded development.

    One of my ultimate dreams is to see hardware manufacturers themselves providing official support for Rust. Fortunately, supporting Rust in embedded systems should be comparable to supporting C, rather than requiring a special runtime for languages like Python or JavaScript. This makes the adoption of Rust in the embedded world more feasible and promising.

Comment
  • I am really excited to share my thoughts on the project by James Munns that wraps the C SDK for nRF52 development boards and provides Rust bindings. After watching James' talk at the Rust DC Meetup, I was truly inspired and decided to purchase a couple of nRF52 dev boards myself.

    First and foremost, I want to express my support for this project and encourage its promotion through Nordic's official channels. It is crucial for more embedded developers to become aware of the possibilities that Rust brings to the table. Rust's ability to compile down to native code without any runtime or operating system dependency is truly remarkable Qr Code Genertator. With Rust, we can now run code on bare metal hardware, opening up new opportunities for embedded development.

    One of my ultimate dreams is to see hardware manufacturers themselves providing official support for Rust. Fortunately, supporting Rust in embedded systems should be comparable to supporting C, rather than requiring a special runtime for languages like Python or JavaScript. This makes the adoption of Rust in the embedded world more feasible and promising.

Children