This is a crash course on how to get the Adafruit Feather RP2350 HSTX board up and running with Rust. We are going to use this GitHub repo below as a base to kick start our learning. But we will take pit stops at the interesting parts so you are not entirely lost at sea.
git clone https://github.com/Dygear/rp2350-hstx.git
Once we have this cloned, we are good to go so long as we have the Adafruit Feather RP2350 board, and the Debug Probe already available and the software below installed.
Let's start with the Debug Header, the little 3 pin interface lets you peek into the Pons of the Raspberry Pi brain. You can find this header on the Raspberry Pi 5, the Raspberry Pi Pico (H, and WH), and now happily the Adafruit RP23XX boards thus far. By connecting a Pico Probe to this interface, you can get a lot of debug information back on your big main computer. ARM refers to this type of interfacing / debugging as Semihosting.
With the 3-Pin JST cable, cable plugged into the D header on the Pico Probe and the other end of that cable onto the Debug Header on your Feather (Shown above); With the Pico Probe connected to your computer, and you can connect the Feather to any USB power source, or back to your computer as well. Once you've done that, you're ready to issue the cargo run command, so long as you have the required software installed below.
There are some items of software you'll need. Obviously the Rust programming language compiler would be a good thing to have on your system. We need a minimum version of 1.75.0 in order for the cloned repo linked above to work. This is because 1.75 landed some features we use in embedded Rust on the stable branch. To install Rust please go to rustup.rs, it is the official way of installing Rust and is supported by the Rust Foundation.
Once that is installed and ready, we also need one extra bit of software inside of Rust so that we can compile for the RP2350's chip architecture. We can issue the command rustup target add thumbv8m.main-none-eabihf that will take care of cross compiling on our system for the RP2350 chip.
Probe-rs is a very cool project. It's an embedded toolkit that allows you to talk to a wide range of chips using commodity hardware such as the Debug Probe. They landed support for the RP2350 chip that has a much more complicated debug interface than the RP2040's. Kudos to that team for making such an impressive bit of software. We need to install this on our hosting computer by going to their website probe.rs and copying the command it has listed for your operating system. (The caveat of not blindly pasting code into your terminal still applies. Make sure it's going to do what you expect it to do before you let it do it.)
Back to the code we cloned all of the way at the top of this article. With all of the software above installed, and your computer connected to the debug probe, the probe connected to the feather, and the feather connected to power or your computer you now have a system that is ready to go. We really can run that cargo run command and have Rust code on our feather. But what are all of these files and what do they do?
.cargo/config.toml and cargo run
The .cargo/config.toml file configures cargo run to use probe-rs to flash to the boards ROM. You will need a Raspberry Pi Debug Probe in order to use this, but it makes development MUCH easier, faster, and more fun! You connect the Debug Probe's D (for debug, D for defmt 😉) side to the board's Debug Port. Once done connect the Adafruit board, and Debug Probe to your computer. You can flash at will with cargo run and see any debug messages in your computer's terminal thanks to defmt.
memory.x
If you've never seen a memory.x file before, and have no clue what it is; I don't blame you for being curious. It's an odd file, filled with things that aren't Rust or C, or anything else that fits the norm. This file actually tells the linker where to put sections of the binary. It makes sure everything is in order so that when the microcontroller jumps to flash memory, the expected data is there ready for it. It also tells the the linker how much RAM the target board or chip has.
build.rs
This build script copies the memory.x file from the crate root into a directory where the linker can always find it at build time. For many projects this is optional, as the linker always searches the project root directory -- wherever Cargo.toml is. However, if you are using a workspace or have a more complicated build setup, this build script becomes required. Additionally, by requesting that Cargo re-run the build script whenever memory.x is changed, updating memory.x ensures a rebuild of the application with the new memory settings.
That's it. The bear minimum of what you need to know in order to get your system setup to flash Rust to the Adafruit Feather RP2350 HSTX board. Poke around in the src/main.rs file. You'll notice for one thing that we are using the GPIO numbers directly, not any of the CircuitPython names. So if you want to toggle the board.LED as you did in CircuitPython, you actually want GPIO7 to interact with p.PIN_7 in Rust / Embassy. This is defined on the pinout diagram in Yellow (2nd item from center if you are colorblind.). The board.NEOPIXEL for example is actually on GPIO21, or for Rust / Embassy that's p.PIN_21.
This page (Rust on the Adafruit Feather RP2350 HSTX) was last updated on March 28, 2025.
Text editor powered by tinymce.