Rust ported to ARM and RISC-V Raspberry Pi RP2350
Cette publication existe aussi en Français
A number of peripherals in the latest Raspberry Pi RP2350 have been ported to the Rust language as work continues on a full port.
Jonathan Pallant at Ferrous Systems was given early access to the new RP2350 chip, mounted on a pre-production Raspberry Pi Pico 2 specifically to look at support for the Rust language.
The main challenges with the work revolved around the very ‘beta’ state of the ROM, datasheet, and Pico SDK, says Pallant, but the chip boots with a basic Image Definition Block in both ARM Secure and RISC-V modes. Pallant has also implemented the SPI, UART and I2C peripherals and GPIOs in Rust as well as the DMA engine, reading the OTP memory with and without ECC and calling ROM routines.
The areas that still need some attention include adding support for Arm Debug Interface v6 to probe-rs, the very popular Rust-based flashing/logging tool. It supports RP2040, and a wide range of other microcontrollers, but unfortunately the ARM Debug Interface in RP2350 is too new for probe-rs and it doesn’t know how to speak to the cores inside the chip.
He is also writing drivers for the new peripherals, like the High Speed Transmitter (HSTX), the Power Manager (POWMAN), and the SIO’s new TMDS encoder as well as changing the Rust support libraries for RISC-V, so RISC-V applications can declare interrupt handlers exactly like Arm Cortex-M applications do. This would allow sample programs which compile for either RISC-V mode or ARM mode with no source code changes.
He is also writing Rust support for the new PSRAM memory support which would provide a RP2350 with up to 16MB of external RAM, as well as implementing secure boot, and support for flash partitions and all the lovely new things we have in RP2350’s ROM.
Rust Embedded Devices Working Group; www.