I'm trying to understand how to run rust code on my nano 33 ble sense. I'm new to rust and fairly familiar with arduino.
I found this post, which led me to the ArduinoCore-mbed library for the nano33ble, but it doesn't tell me more about how to setup any of the toolchain for rust.
Otherwise, I found the avr-hal by Rahix project, but it doesn't seem to support the nano33ble (different micro-controller, no mention of mbed).
Any help would be appreciated. A link to some code that deploys rust code to the nano33ble would be very nice!
Thanks for your reply, but that article doesn't really help. It's a relatively old article and back then everything was geared to getting rust code running on AVR. The nano33ble, however, has a nRF52840 chip, which isn't AVR, as far as I understand.
Basically, I think I need to understand how to use this code with rust:
Interesting question. I have not seen questions related to Rust in this forum.
May I ask, why you are interested in using Rust on the Arduino Nano 33 BLE? Do you hope to solve an issue you cannot solve otherwise? And do you know whether Rust is useful in an environment where the OS (mbedOS) and most of the system code (e.g., ArduinoBLE library) is not written in Rust?
I'm building a flight logger. Actually, the nano 33 ble sense is the board of choice, as it comes not only with 6 axis inertial measurements, but also magnetic field and altitude pressure sensors, which is exactly what I need.
I could of course program it with C/C++ and I've done arduino projects before, so I mostly know what I'm doing. However, I've been looking to do a project with rust for a longer time now, as I find the language very interesting. It seems well suited for embedded systems, too.
I'm planning to make a bigger write-up of the whole thing at some point, but maybe I'll summarize the current state of my research briefly:
I found that I needed to get a deeper understanding of rust on embedded systems, so I read the rust-embedded book. It's a great resource and it's not that long. In the book, they're using a similar chip as the one on the nano 33 ble.
An implementation of the hardware abstraction layer (HAL, github:nrf-rs/nrf-hal/tree/master/nrf52840-hal) already exists, which does a lot of the heavy lifting. (I believe there are also rust libraries for BLE on this chip.)
Here's a guide on integrating arduino libraries in rust code for arduino. This is done using the arduino uno, but I hope that it'll help me to get my build-pipeline up to speed. Getting the arduino libraries to work is my highest priority at the moment, as I definitely do not want to implement the mag field and altitude drivers by hand.
So yeah, I'm pretty excited about this. Happy to discuss any question around this, just fire away. =)
Some time ago I wrote this: Adventures in tinkering, or how I jailbroke my BLE Sense · nebelgrau and I've been thinking about some follow up regarding the use of on-board sensors, updating the bootloader to include SoftDevice S140 v.7.3.0, and use BLE. Hopefully will happen at some point!