Jonathan Pallant Details the "Deeply Impressive" Raspberry Pi RP2350's Day-One Rust Support

"To my knowledge," Pallant says, "this is the first ever microcontroller launch with Rust support out-of-the-box."

Gareth Halfacree
4 months ago β€’ HW101

Embedded developer Jonathan Pallant has been playing with the new Raspberry Pi RP2350 microcontroller, focusing primarily on its ability to run Rust programs β€” and its position as the first microcontroller to launch with day-one Rust support.

"I've had prototype units for a while," Pallant writes of Raspberry Pi's second-generation in-house microcontroller design, "and you can run Rust code on it today. To my knowledge this is the first ever microcontroller launch with Rust support out-of-the-box. I have ported the rp-rs HAL [Hardware Abstraction Layer] to RP235x, along with a few of the examples."

The Raspberry Pi RP2350 is a major upgrade over the earlier Raspberry Pi RP2040, boasting newer Arm Cortex-M33 cores running at a faster 150MHz, almost twice the static RAM (SRAM) plus support for external pseudo-static RAM (PSRAM), an additional programmable input/output (PIO) block, and more β€” but it also brings with it an architectural complexity: the presence of two RISC-V cores, based on the free and open source Hazard3 design, which can be chosen in place of the Arm cores or even split with one Arm and one RISC-V core running simultaneously.

Pallant's work hasn't focused on merely the Arm cores, as you might expect for pre-release efforts to make Rust a first-class citizen on the new chip β€” and particularly given existing support for running Rust on the Arm cores of the RP2040. Instead, he's been working with both the Arm and RISC-V cores β€” and has successfully executed a range of example projects, from CPU-based and PIO-based "blinky" LED flashing programs to USB serial. Still more projects have been proven on the Arm cores alone, including Pallant's own Neotron BIOS and Neotron OS β€” a Rust-based computer platform inspired by microcomputers of the 1980s.

While it's now possible to run Rust code on the RP2350, and the other parts announced in the new microcontroller family, not all the microcontroller's new functionality is available: Pallant warns that the chip's new high-speed transmission (HSTX) peripheral, used to drive a display without tying up the CPU or PIO blocks, doesn't yet work, and neither does the SHA-256 acceleration engine. You can't use the new power management (POWMAN) peripheral to enter deep-sleep states, and you can't write to the one-time programmable (OTP) memory. Work is also still underway for programming support in probe-rs. "This is not a challenge," Pallant says of the outstanding to-do list, "it's an opportunity!"

Pallant describes Raspberry Pi's latest microcontroller as "deeply impressive. Being able to freely switch between Arm and RISC-V modes is completely unique," he continues, "and offers fascinating opportunities for experimentation. Carrying over the peripherals from RP2040 means it's easy to get started, and having advanced flash partition support, OTP and Secure Boot means production-grade applications can be much more robust than on RP2040."

Pallant's full write-up is available on his website.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles