SiliconTwin.RP2350.DebugAdapter 1.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global SiliconTwin.RP2350.DebugAdapter --version 1.2.0
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local SiliconTwin.RP2350.DebugAdapter --version 1.2.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=SiliconTwin.RP2350.DebugAdapter&version=1.2.0
                    
nuke :add-package SiliconTwin.RP2350.DebugAdapter --version 1.2.0
                    

RP2350Sharp

License .NET Version

RP2350Sharp is a register-accurate emulator for the Raspberry Pi RP2350 (Raspberry Pi Pico 2) microcontroller, written entirely in modern C# (.NET 10). It models the dual-architecture core — Arm Cortex-M33 and the Hazard3 RISC-V cores — along with the BusInterconnect and peripherals, and runs real RP2350 firmware (including MicroPython) without modification. The Arm core runs a per-instruction cycle model calibrated against real silicon (branch, wide-fetch and flash-wait penalties), so Cycles, the timers and DWT CYCCNT share one clk_sys clock; it is not cycle-exact — see LIMITATIONS.md.

It is the RP2350 sibling of RP2040Sharp, sharing its design lineage from the excellent rp2040js project by Uri Shaked.

Packages

Package Description License
RP2350Sharp The emulator engine: dual Cortex-M33 / Hazard3 CPU, BusInterconnect, peripherals, and the SiliconTwin.Abstractions adapter (RP2350Mcu). AOT-compatible. BUSL-1.1
RP2350Sharp.Wireless CYW43439 Wi-Fi emulation for the Pico 2 W (gSPI, SDIO backplane, WHD/SDPCM). BUSL-1.1
SiliconTwin.RP2350 Fluent, deterministic firmware test harness (UART capture/inject, GPIO logic analyzer + VCD, timing, FluentAssertions). BUSL-1.1
SiliconTwin.RP2350.MicroPython MicroPython VM introspection (decode mp_obj_t, resolve QSTRs, walk mp_state_ctx). BUSL-1.1
SiliconTwin.RP2350.GdbHost GDB server + inspection CLI (rp2350-gdb) for the emulator. BUSL-1.1
SiliconTwin.RP2350.DebugAdapter Mixed managed↔native DAP server (rp2350-dap) for nanoFramework in Rider / VS Code. BUSL-1.1

SiliconTwin.Abstractions

RP2350Sharp implements SiliconTwin.Abstractions (MIT, dependency-free, AOT-safe), the contracts shared by every Silicon Twin core, so a host — a circuit simulator, a test kit, a C ABI, a UI — drives the RP2350 through the same API it uses for an AVR or an STM32. RP2350Mcu wraps the machine and implements IMcu plus IGpio (one bank with the bonded pads of the package), IPwmSource, IAdcInput and IPeripheralMap (UART0/1, SPI0/1, I2C0/1 at byte level).

using RP2350.Embedding;
using RP2350.Peripherals;
using SiliconTwin.Abstractions;

using IMcu mcu = new RP2350Mcu(new RP2350MachineOptions { PinLevelBuses = PinLevelBus.I2c });   // owns the machine
mcu.Load(FirmwareImage.FromUf2(File.ReadAllBytes("firmware.uf2")));
mcu.Reset(ResetKind.Power);

var bank = ((IGpio)mcu).Banks[0];
bank.WatchMask = 1UL << 15;                                   // only GP15
bank.PinChanged += (in PinChange e) =>                        // fires inside Run, stamped with the exact cycle
    Console.WriteLine($"GP15 -> {(e.IsHigh(15) ? "HIGH" : "LOW")} at {CycleBudget.ToSeconds(e.Cycle, mcu.ClockHz) * 1e3:F3} ms");
bank.SetInputs(1UL << 14, 0);                                 // the circuit pulls the button pin low

double carry = 0;
for (var frame = 0; frame < 1000; frame++)                    // one simulated second, 1 ms frames
{
    var budget = CycleBudget.Next(ref carry, mcu.ClockHz, 0.001);
    CycleBudget.Settle(ref carry, budget, mcu.Run(budget));   // Run returns the cycles actually consumed
}

mcu.ClockHz is the live clk_sys (≈6.5 MHz out of reset, 150 MHz after clock_init) and ClockChanged fires when firmware reprograms it. Run maps cycle budgets onto the machine's per-core instruction slices; PinChange.Cycle is exact to the instruction for SIO-driven pads and to the clk_sys cycle for the pin-level serial engines, PWM and PIO. Nothing is hooked into the machine until the first PinChanged subscriber arrives. Loading takes UF2 and raw .bin (not ELF or Intel HEX). RP2350Mcu.Wrap(machine) adopts a machine you built yourself. See RP2350Mcu's XML docs for the cycle budget, dual-core and pin-level semantics, and LIMITATIONS.md for what the contract cannot express yet.

Licensing

The entire project — the emulator core and the tooling (TestKit, Micropython.TestKit, Wireless) alike — is licensed under the Business Source License 1.1, which automatically converts to the MIT License (the Change License) on the Change Date (2030-07-11).

Use for personal, hobby, educational, academic-research, evaluation, or open-source purposes is always free of charge. Commercial Use — as defined in LICENSE-BUSL.txt — requires a separate commercial license. See LICENSE and LICENSE-BUSL.txt.

In one line: free to write, run, debug and profile with — on any machine, at any company — and free in the CI of public repositories. Shipping it inside a product you sell needs a commercial licence. Running it in a private CI needs an entitlement, which is a service governed by its own terms, not by this licence.

Parts of RP2350Sharp are derived from rp2040js by Uri Shaked, under the MIT License. RP2350Sharp also redistributes the RP2350 boot ROM binary (© Raspberry Pi Ltd, BSD-3-Clause), which embeds sweet-b (© Western Digital Corporation, BSD-3-Clause). See NOTICE.txt for the complete third-party notices — it must accompany every redistribution.

Status

Beta. See the releases for the changelog.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.4.0 119 11/6/2026
1.3.2 125 10/23/2026
1.3.1 131 10/23/2026
1.3.0 131 10/22/2026
1.2.0 129 10/14/2026
1.1.0 157 8/26/2026
1.0.5 153 7/27/2026