Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Raspberry Pi Rp Rust Knowledge Patch?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/nevaberry-raspberry-pi-rp-rust-knowledge-patch-nevaberry-plugins)
---
name: raspberry-pi-rp-rust-knowledge-patch
description: RP2040 / RP235x (Rust)
version: "0.4.0"
license: MIT
metadata:
author: Nevaberry
---
# RP2040 / RP235x Rust Compatibility
Load this skill when updating Rust HAL dependencies, using GPIO, PIO or
multicore features, or working with RP2350 boot behavior and silicon fixes.
Use the topic references for complete guidance and silicon erratum numbers.
## Reference index
| Reference | Topics |
| --- | --- |
| [HAL compatibility](references/hal-compatibility.md) | Rust minimums, dependency and trait compatibility, ADC failures, I²C transaction changes |
| [Peripherals and multicore](references/peripherals-and-multicore.md) | Core 1 startup, atomics, GPIO groups, XIP chip select, PIO inputs, PWM traits, diagnostic formatting |
| [Boot and security](references/boot-and-security.md) | Architecture selection, signed boot, TrustZone, UF2, image validation, flash configuration, OTP permissions, reboot and security fixes |
| [Silicon and clocks](references/silicon-and-clocks.md) | A4 identification, SDK minimum, GPIO errata, package reporting, USB/OTP reliability, reset defaults, early boot clocks |
## HAL upgrade requirements and behavior changes
### Rust compiler minimums
Building `rp2040-hal` 0.12.0 requires Rust 1.82 or newer because its
indirect build dependency `indexmap` requires it.
Building `rp235x-hal` 0.3.0 requires Rust 1.79 or newer.
### PIO program type compatibility
In `rp2040-hal` 0.12.0, the HAL uses `pio` 0.3.0.
Use a compatible 0.3 release for a direct `pio` dependency whose program
types you pass to the HAL.
### RNG and I/O traits
In `rp2040-hal` 0.12.0, the HAL uses `rand_core` 0.9.3.
Use `rand_core` 0.9 traits when writing bounds for HAL RNGs.
The HAL also uses `embedded-io` 0.7.1; its `ReadErrorType` implements
`core::fmt::Display` and `core::error::Error` to satisfy the updated error
trait requirements.
### ADC conversion failures
ADC conversions in `rp2040-hal` 0.12.0 now report errors.
Update callers to handle or propagate conversion failures when upgrading.
### I²C transaction sequences
In `rp2040-hal` 0.12.0, the HAL removes extra automatic repeated STARTs
from its `embedded_hal::i2c::I2c::transaction` implementation.
Review transaction sequences that relied on those extra STARTs.
## Production silicon requirements
### Identify A4 parts
RP2350A and RP2350B moved to A4 mass production in July 2025, and the
earlier steppings reached end of life.
Identify A4 by the suffix on the part number printed on the chip.
Use Pico SDK 2.1 or later for firmware targeting A4.
### Review GPIO leakage workarounds
A4 inherits the A3 fix for increased leakage current when a Bank 0 pad
has its input enabled.
Review any external circuit added to work around that leakage.
### Boot image alignment
A4 rejects `LOAD_MAP` entries whose sizes are not word-aligned.
It also inherits the A3 fix allowing a valid `IMAGE_DEF` following an
explicitly invalid one to boot, and the fix making the parser fail
cleanly on a malformed lollipop block loop.
## Peripheral and multicore features
### GPIO group output and XIP chip select
In `rp235x-hal` 0.3.0, use `PinGroup::set_u32` to write the output values
of a pin group from one `u32`.
The HAL supports the `XipCS1` GPIO function for the second XIP chip select.
### PIO input count
In `rp235x-hal` 0.3.0, configure a PIO state machine's input pin count
with `in_count`.
### Generic PWM duty cycles
In `rp2040-hal` 0.12.0, PWM channels implement `SetDutyCycle` generically
over `ChannelId`, so code parameterized by the channel ID can use the trait.
### Core 1 startup and atomics
In `rp235x-hal` 0.3.0, the HAL enables core 1's coprocessors when it spawns
code on that core.
The HAL sets `EXTEXCLALL` when enabling multicore operation, fixing atomic
operations in that configuration.
### Diagnostic formatting
In `rp235x-hal` 0.3.0, `StackAllocation` implements `core::fmt::Debug` and
`defmt::Format` for diagnostic output.
GPIO structures implement `core::fmt::Debug` and can be formatted with `{:?}`.
## Architecture and signed boot
### Select an architecture for required features
The RP2350 boot ROM can detect the architecture of a second-stage binary
and reboot into the matching mode.
The chosen mode enables either the Cortex-M33 pair or the Hazard3 RISC-V pair.
Target Cortex-M33 for firmware that relies on the hardware double-precision
floating-point accelerator or Arm TrustZone.
### Provision a signed boot key
Store the public key's hash in the chip's 8 KB of antifuse OTP and sign
the boot binary with the matching private key.
With signed boot enabled, the device boots only binaries whose signature
verifies against a provisioned key.
### TrustZone firmware starting point
RP2350 is the reference hardware platform for Trusted Firmware-M 2.1.0 LTS,
a starting point for Cortex-M33 firmware that uses TrustZone.
## A4 boot and security fixes
### Partitioned flash and chip select
A4 supports drag-and-drop UF2 installation on chips configured with
partition tables, inheriting the A3 fix.
A4 fixes the permanent boot failure triggered by an invalid ECC bit
pattern in `FLASH_PARTITION_SLOT_SIZE`.
On A3 and A4, `connect_internal_flash()` uses the CS1 pin configured in
`FLASH_DEVINFO`.
### OTP permissions and reboot
A4 inherits the corrected access checks for OTP pages 62 and 63 in
`otp_access()`.
A4 also inherits the A3 fix for reboots that halt with certain
`FRCE_OFF` bits set.
### Security mitigations
A4 includes A3's fault-injection mitigations for signed boot and OTP
confidentiality, plus an additional A4 mitigation for signed boot.
The A4 boot ROM disables RCP random delays to mitigate a side channel.
## A4 clock defaults and early boot
### Reset values
`ROSC.FREQA.DS0_RANDOM` and `ROSC.FREQA.DS1_RANDOM` reset to 1, enabling
randomization of the first two drive stages.
`CLOCKS.CLK_SYS_CTRL.SRC` resets to 1 (AUX), and
`CLOCKS.CLK_SYS_CTRL.AUXSRC` resets to 2 (ROSC).
### Early boot dividers
Early boot changes the `clk_ref` divider from 1 to 5 and the ROSC divider
from 8 to 2.
With the new reset defaults, these settings bring boot `clk_sys` to about
48 MHz across all boot outcomes, including watchdog and POWMAN vector boot.