Symptom
Your blink program works on a Pico, but on a Pico W / Pico 2 W the LED stays dark (or the build fails because PICO_DEFAULT_LED_PIN is not defined).
Why
| Board | LED connected to |
|---|---|
| Pico, Pico 2 | GP25 on the RP2040/RP2350 |
| Pico W, Pico 2 W | WL_GPIO0 on the Infineon CYW43439 wireless chip |
On the W boards, toggling GP25 does nothing useful. The LED is only reachable through the wireless driver.
Portable blink (from pico-examples)
#include "pico/stdlib.h"
#ifdef CYW43_WL_GPIO_LED_PIN
#include "pico/cyw43_arch.h"
#endif
int led_init(void) {
#if defined(PICO_DEFAULT_LED_PIN)
gpio_init(PICO_DEFAULT_LED_PIN);
gpio_set_dir(PICO_DEFAULT_LED_PIN, GPIO_OUT);
return PICO_OK;
#elif defined(CYW43_WL_GPIO_LED_PIN)
return cyw43_arch_init(); // starts the wireless driver
#endif
}
void led_set(bool on) {
#if defined(PICO_DEFAULT_LED_PIN)
gpio_put(PICO_DEFAULT_LED_PIN, on);
#elif defined(CYW43_WL_GPIO_LED_PIN)
cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, on);
#endif
}
target_link_libraries(blink pico_stdlib)
if (PICO_CYW43_SUPPORTED)
target_link_libraries(blink pico_cyw43_arch_none) # driver without a network stack
endif()
Build with -DPICO_BOARD=pico_w or pico2_w so the right defines exist.
Practical note
Since the LED needs the wireless driver, "LED as status indicator" on a W board costs you driver initialisation even if you don't use Wi-Fi. For a status light that is independent of the radio, wire an LED to a free GPIO.