Skip to content

soc_rp2040

RP2040 chip facts used before peripheral drivers exist.

Addresses and interrupt numbers are from the Raspberry Pi RP2040 datasheet, sections 2.2 (address map) and 2.3 (interrupts), build 3184e8e (2025-02-20). The SRAM extent is the six-bank 264 KiB window.

  • boot2 — W25Q080-compatible RP2040 second-stage bootloader.
  • ctrl — Typed RP2040 peripheral identities and cross-core ownership claims.
  • dma — RP2040’s twelve uniform DMA channels.
  • multicore — RP2040 SIO primitives and the ROM core-1 launch protocol.
  • pinmux — RP2040 fixed-function pin routing.
  • test_status — Machine-observable completion for ARM on-target tests.
  • watchdog — RP2040 watchdog control and retained reset reason.
  • xip — Two-core exclusion for operations which temporarily remove flash/XIP.
struct Rp2040;

Implements: LowPower, PanicRecovery, SystemOnChip

struct Rp2040Dma;

Implements: DmaReach

fn enable_adc_clock()

Select the crystal for clk_adc and enable the clock slice.

The ADC’s reset-done bit cannot rise while this clock is stopped. Keep its 12 MHz crystal source independent of the optional USB/CPU PLL profile.

fn enable_peripheral_clock()

Keep peripherals on the 12 MHz crystal even when USB raises the CPU clock.

unsafe fn reset(mask: u32)

Assert reset for one or more peripheral blocks through the atomic set alias.

The caller must exclusively own the selected blocks and ensure no other core or interrupt uses them. Any in-flight operation is discarded.

fn uart_instance(base: u32) -> Option<u8>
unsafe fn unreset(mask: u32)

Release peripherals from reset through the atomic clear alias.

The caller must ensure each requested peripheral is ready before use.

const ADC_BASE: u32;
const CPU_HZ: u32;
const DMA_BASE: u32;
const I2C0_BASE: u32;
const I2C1_BASE: u32;
const IO_BANK0_BASE: u32;
const IRQ_ADC_FIFO: u8;
const IRQ_DMA_0: u8;
const IRQ_DMA_1: u8;
const IRQ_I2C0: u8;
const IRQ_I2C1: u8;
const IRQ_IO_BANK0: u8;
const IRQ_PWM_WRAP: u8;
const IRQ_SPI0: u8;
const IRQ_SPI1: u8;
const IRQ_UART0: u8;
const IRQ_UART1: u8;
const IRQ_USBCTRL: u8;
const NVIC_IRQ_COUNT: u8;
const PADS_BANK0_BASE: u32;
const PWM_BASE: u32;
const RESETS_BASE: u32;
const RESET_ADC: u32;
const RESET_DMA: u32;
const RESET_I2C0: u32;
const RESET_I2C1: u32;
const RESET_IO_BANK0: u32;
const RESET_PADS_BANK0: u32;
const RESET_PWM: u32;
const RESET_SPI0: u32;
const RESET_SPI1: u32;
const RESET_UART0: u32;
const RESET_UART1: u32;
const RESET_USBCTRL: u32;
const ROSC_BASE: u32;
const SIO_BASE: u32;
const SPI0_BASE: u32;
const SPI1_BASE: u32;
const SRAM_BASE: u32;
const SRAM_END: u32;
const SRAM_SIZE: u32;
const UART0_BASE: u32;
const UART1_BASE: u32;
const USB_DPRAM_BASE: u32;
const USB_REGS_BASE: u32;
const XIP_BASE: u32;
const XIP_SIZE: u32;
const XOSC_HZ: u32;

Crystal shared by the supported Wio RP2040 and Raspberry Pi Pico boards.