Skip to content
Back to skills

Raspberry Pi Rp Rust Knowledge Patch

ASecurity

RP2040 / RP235x (Rust)

  • 25 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 1, 2026
ai-agentsrustapisecurity

Works with

  • api

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add Nevaberry/nevaberry-plugins --skill raspberry-pi-rp-rust-knowledge-patch --agent claude-code

Installs into .claude/skills of the current project.

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.

Security grade badge for Raspberry Pi Rp Rust Knowledge Patch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nevaberry-raspberry-pi-rp-rust-knowledge-patch/badge)](https://www.skillsdirectory.com/skills/nevaberry-raspberry-pi-rp-rust-knowledge-patch)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: raspberry-pi-rp-rust-knowledge-patch
description: RP2040 / RP235x (Rust)
version: "0.4.0"
license: MIT
metadata:
  author: Nevaberry
---


# RP2040 / RP235x Rust compatibility guidance

Load this skill for Rust HAL compatibility, peripheral and multicore APIs,
RP2350 boot and security, or A4 silicon behavior.
It covers toolchain and dependency requirements, changed peripheral behavior,
boot validation, silicon fixes, and clock settings.

## Reference index

| Reference | Topics |
| --- | --- |
| [Rust compatibility](references/rust-compatibility.md) | Minimum Rust versions; PIO, RNG, and I/O dependencies; ADC errors; I²C transactions |
| [Peripherals and multicore](references/peripherals-and-multicore.md) | Core 1 startup and atomics; GPIO groups, formatting, and pad fixes; PIO inputs; PWM |
| [Boot and security](references/boot-and-security.md) | Architecture detection; signed boot and TrustZone; UF2; image validation; flash, OTP, reboot, and security fixes |
| [Silicon and clocks](references/silicon-and-clocks.md) | A4 identification and SDK requirement; package reporting; USB and OTP reliability; reset defaults and boot clocks |

## Upgrade requirements and changed behavior

### Rust toolchains

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 compatibility

`rp2040-hal` 0.12.0 uses `pio` 0.3.0.
Use a compatible 0.3 release for any direct `pio` dependency whose program
types you pass to the HAL.

### RNG and I/O trait compatibility

`rp2040-hal` 0.12.0 uses `rand_core` 0.9.3.
Use `rand_core` 0.9 traits when writing bounds for HAL RNGs.
It 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 failures

ADC conversions now report errors in `rp2040-hal` 0.12.0.
Update callers to handle or propagate conversion failures when upgrading
to 0.12.0.

### I²C repeated STARTs

`rp2040-hal` 0.12.0 removes extra automatic repeated STARTs from its
`embedded_hal::i2c::I2c::transaction` implementation.
Review transaction sequences that relied on those extra STARTs.

See [Rust compatibility](references/rust-compatibility.md) for these
toolchain, dependency, and caller changes.

### A4 firmware and external circuits

Use Pico SDK 2.1 or later for firmware targeting A4.
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 (erratum 9).

### A4 boot image sizes

A4 rejects `LOAD_MAP` entries whose sizes are not word-aligned (erratum 25).
See [Boot and security](references/boot-and-security.md) for image validation
and flash partition behavior.

## Peripheral and multicore quick reference

### Core 1 startup and atomics

`rp235x-hal` 0.3.0 enables core 1's coprocessors when it spawns code on that
core. It sets `EXTEXCLALL` when enabling multicore operation, fixing atomic
operations in that configuration.

### GPIO pin-group output

In `rp235x-hal` 0.3.0, use `PinGroup::set_u32` to write the output values of
a pin group from one `u32`.

### PIO input pin count

In `rp235x-hal` 0.3.0, configure a PIO state machine's input pin count with
`in_count`.

### Generic PWM duty cycle

In `rp2040-hal` 0.12.0, PWM channels implement `SetDutyCycle` generically over
`ChannelId`, so code parameterized by the channel ID can use the trait.

### 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 `{:?}`.

### Second XIP chip select

`rp235x-hal` 0.3.0 supports the `XipCS1` GPIO function for the second XIP chip
select. On A3 and A4, the boot ROM's `connect_internal_flash()` uses the CS1
pin configured in `FLASH_DEVINFO` (erratum 14).

See [Peripherals and multicore](references/peripherals-and-multicore.md)
for the HAL APIs and A4 GPIO pad fixes.

## Architecture and secure boot quick reference

### Architecture selection

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.

### Signed boot provisioning

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.

### Partitioned flash and image validation

A4 supports drag-and-drop UF2 installation on chips configured with
partition tables, inheriting the A3 fix (erratum 10).
A4 inherits the A3 fixes that allow a valid `IMAGE_DEF` following an
explicitly invalid one to boot and make the parser fail cleanly on a
malformed lollipop block loop (errata 13 and 22).

### Boot ROM security mitigations

A4 includes A3's fault-injection mitigations for signed boot and OTP
confidentiality, plus an additional A4 mitigation for signed boot
(errata 20, 21, and 24).
The boot ROM disables RCP random delays to mitigate a side channel
(erratum 26).

See [Boot and security](references/boot-and-security.md) for flash partition
slot ECC, OTP permission checks, and reboot fixes.

## Silicon and clock quick reference

### 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.

### Clock reset defaults

`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 clock settings

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.

See [Silicon and clocks](references/silicon-and-clocks.md) for A4 clock
behavior, package reporting, and USB status and OTP read mitigations.

Files in this skill

  • SKILL.md6.4 KB
  • coverage.json649 B
  • references/boot-and-security.md2.3 KB
  • references/peripherals-and-multicore.md1.6 KB
  • references/rust-compatibility.md1.2 KB
  • references/silicon-and-clocks.md1.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.