Quick Start - Pico 2 W LED Blink
Before diving into theory, let's jump straight into action. We'll blink the onboard LED on the Pico 2 W using Embassy and the cyw43 driver.
Pico 2 W Specific Code: On the Pico 2 W, GPIO25 is dedicated to controlling the wireless interface. The onboard LED is connected to the WiFi chip, not directly to a GPIO pin.
This means we need to use the cyw43 driver to control the LED, even for simple blinking. This is different from the standard Pico 2, where you can control GPIO25 directly.
The Code for Pico 2 W
We use Embassy with the cyw43 driver. The LED is accessed through the wireless chip, so we initialize the cyw43 peripheral even though we're not using WiFi yet.
#[embassy_executor::main]
async fn main(spawner: Spawner) {
let p = embassy_rp::init(Default::default());
// Initialize the cyw43 chip for LED access
let fw = include_bytes!("../cyw43-firmware/43439A0.bin");
let clm = include_bytes!("../cyw43-firmware/43439A0_clm.bin");
let pwr = Output::new(p.PIN_23, Level::Low);
let cs = Output::new(p.PIN_25, Level::High);
let mut pio = Pio::new(p.PIO0, Irqs);
let spi = PioSpi::new(
&mut pio.common,
pio.sm0,
pio.irq0,
cs,
p.PIN_24,
p.PIN_29,
p.DMA_CH0,
);
let state = make_static!(cyw43::State::new());
let (net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await;
spawner.spawn(wifi_task(runner)).unwrap();
loop {
// Turn on the LED
control.gpio_set(0, true).await;
Timer::after_millis(500).await;
// Turn off the LED
control.gpio_set(0, false).await;
Timer::after_millis(500).await;
}
}Clone the Quick Start Project
git clone https://github.com/ImplFerris/pico2-quick
cd pico2-quickHow to Run
To flash your application onto the Pico 2 W, press and hold the BOOTSEL button. While holding it, connect the Pico 2 W to your computer using a micro USB cable. You can release the button once the USB is plugged in.

Press BOOTSEL while plugging in USB
cargo run --releaseThis will flash (write) our program into the Pico 2 W's memory and run it automatically. If successful, you should see the onboard LED blinking at regular intervals.
With Debug Probe
If you're using a debug probe, you don't need to press the BOOTSEL button. You can just run these commands instead:
# Flash only
cargo flash --release
# Flash and view logs
cargo embed --releaseThe cyw43 initialization code shown here is simplified. In real projects, you'll want better error handling and may want to reuse the runner task for actual WiFi functionality. We'll cover this in detail in the WiFi chapter.