Raspberry Pi Silicon

# RP2040 & RP2350 simulator.

Run real Raspberry Pi Pico (RP2040) and Pico 2 (RP2350 Cortex-M33 and Hazard3 RISC-V) firmware in the browser, locally via the ct CLI, or in CI with PIO, DMA, timers, SPI, I2C, UART, and custom board wiring.

[Start now](https://app.circuittwin.ai/try) [Compare with Wokwi](https://circuittwin.ai/compare/wokwi)

## Browser emulators vs production RP2040 / RP2350 CI.

Move beyond single-board toy sketches into deterministic multi-board hardware testing.

| Capability           | Browser JS Emulators                         | CircuitTwin                                                          |
| -------------------- | -------------------------------------------- | -------------------------------------------------------------------- |
| MCU coverage         | Usually RP2040 only (single-core or partial) | RP2040 (Cortex-M0+) and RP2350 (Cortex-M33 & Hazard3 RISC-V)         |
| Peripherals          | Basic GPIO, UART, and selected widgets       | PIO, DMA, timers, PWM, ADC, UART, SPI, I2C, and datasheet ICs        |
| Custom PCBs & wiring | Browser breadboard or diagram.json           | Multi-board wiring plus KiCad, Altium, Eagle, and ODB++ import       |
| CI & fault testing   | Limited browser automation                   | Native ct CLI, GitHub Actions, GitLab CI, fault matrices, JSON/JUnit |
| Debugging            | Serial console prints                        | GDB server with reverse-step, SWO/RTT, and deterministic VCD traces  |

## Run Pico SDK and Rust builds from the terminal.

Execute your real CMake or Cargo ELF output with structured verdicts and full waveform capture.

Every run records deterministic `trace.jsonl`, `isr.jsonl`, and `signals.vcd` artifacts so you can inspect PIO, SPI, and I2C timing in GTKWave or attach GDB from VS Code.

terminal

# Build your Pico SDK or Rust Embassy project as usual
cmake -B build -DPICO_BOARD=pico2
cmake --build build

# Run the compiled ELF on a digital twin with JSON output
ct run --json --board rpi-pico2 build/sensor_node.elf --until "OK" --record trace/

# Attach GDB with reverse-stepping on any failure
ct debug --board rpi-pico build/app.elf

## Raspberry Pi Pico (RP2040 & RP2350) firmware testing

Run compiled Raspberry Pi Pico and Pico 2 ELF files in CI without BOOTSEL USB mass-storage juggling.

RP2040 pairs dual Cortex-M0+ cores with PL011 UART, PL022 SPI, DesignWare I2C and PIO state machines; RP2350 upgrades to dual Cortex-M33 cores. Both boards carry dedicated silicon comparison records in public/evidence/accuracy/ (board-pico-rp2040.json and board-pico2-arm.json).

Testing the compiled Pico SDK ELF in CI validates clock dividers, DMA descriptors and I2C/SPI sensor error handling without manual BOOTSEL resets.

### Pico & Pico 2 twin specs

| Board slug | MCU & Core                         | Evidence record                       |
| ---------- | ---------------------------------- | ------------------------------------- |
| rpi-pico   | RP2040 (Dual Cortex-M0+ @ 133 MHz) | board-pico-rp2040.json + ARMv6-M diff |
| rpi-pico2  | RP2350 (Dual Cortex-M33 @ 150 MHz) | board-pico2-arm.json + ARMv8-M diff   |

Shell — build Pico SDK ELF & run

```
cmake -B build -DPICO_BOARD=pico && cmake --build build
ct run --json --board rpi-pico build/firmware.elf
```

tests/pico.suite.yaml

```
version: 1
board: rpi-pico
firmware: build/firmware.elf
tests:
  - name: pl011-uart-and-bme680
    timeout_ms: 2000
    expect:
      console_contains: "PICO_SENSOR_OK"
      exit_code: 0
  - name: i2c0-nack-retry
    faults:
      - at_ms: 50
        bus: I2C0
        kind: nack
        address: 0x76
        count: 3
    expect:
      console_contains: "I2C_RECOVERED"
```

### Troubleshooting

| Symptom                                     | Fix                                                                                                         |
| ------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| No stdout on UART0                          | Enable pico\_enable\_stdio\_uart(target 1) in CMakeLists.txt (USB CDC stdio does not print to PL011 UART0). |
| PL022 SPI clock higher than slave max       | Verify CPSDVSR (must be even 2..254) and SCR in the SPI Clock Divider Calculator.                           |
| HardFault on unaligned 32-bit read (RP2040) | ARMv6-M Cortex-M0+ faults on every unaligned word/halfword load; use memcpy for packed bus frames.          |
| RP2350 stack limit fault (STKOF)            | Decode CFSR bit 20 in the HardFault Decoder and check MSPLIM/PSPLIM initialization.                         |

## Common questions.

**Does CircuitTwin support both RP2040 (Pico) and RP2350 (Pico 2)?**

Yes. CircuitTwin supports Raspberry Pi Pico (RP2040 Arm Cortex-M0+) and Pico 2 (RP2350 Arm Cortex-M33 and Hazard3 RISC-V) binaries built with Pico SDK, CMake, Zephyr, PlatformIO, or Rust Embassy.

**Can I simulate PIO, DMA, SPI, I2C, and external sensors?**

Yes. Wire RP2040 or RP2350 pins to external SPI, I2C, or UART sensor twins, or connect multiple boards together to test real driver code, DMA transfers, timers, and PIO programs.

**How does CircuitTwin compare to browser-only JavaScript RP2040 emulators?**

Browser-only JS emulators are great for quick classroom sketches, whereas CircuitTwin adds RP2350 Pico 2 support, custom KiCad/Altium PCB import, datasheet-generated sensor twins, GDB reverse-stepping, and deterministic GitHub Actions / GitLab CI.

**Do I have to rewrite my Pico SDK code to run in CircuitTwin?**

No. Pass the compiled ELF or HEX file produced by your existing Pico SDK, Zephyr, or Rust toolchain directly to CircuitTwin.

## Related guides.

CircuitTwin vs Wokwi Compare browser playgrounds against datasheet twin generation, custom PCBs, and CI. [Compare tools →](https://circuittwin.ai/compare/wokwi)

ESP32 Firmware Simulator & CI Run ESP32, ESP32-S3, and ESP32-C3 firmware from ESP-IDF and PlatformIO in CI. [Read ESP32 guide →](https://circuittwin.ai/esp32-simulator)

STM32 Simulator Online & CLI Test STM32F1, F4, F7, H7, and G4 firmware without a physical Nucleo board. [Read STM32 guide →](https://circuittwin.ai/stm32-simulator)

Test Firmware Without Hardware Automate hardware-free embedded tests in GitHub Actions and GitLab CI. [Read CI guide →](https://circuittwin.ai/test-firmware-without-hardware)
