🛠 Faire clignoter la LED embarquée (elle est derrière la puce Wi-Fi !)
Objectives
Discover the Raspberry Pi Pico W (RP2040 dual-core Cortex-M0+ 133 MHz + Infineon CYW43439 Wi-Fi/BT radio chip) with the classic: blinking the LED. But beware, the Pico W has a unique peculiarity: the user LED is not on a RP2040 GPIO, it is wired to the WL_GPIO0 pin of the CYW43439 Wi-Fi chip. The blink_simple example from the SDK therefore does not work on the Pico W; you must use the wireless driver (picow_blink in pico-examples). You will also learn why GP23, GP24, GP25, and GP29 are not free GPIOs on this board.
Hardware
- 1 × Raspberry Pi Pico W (ref. SCO918, or Pico WH with soldered headers) — not a classic Pico
- 1 × micro-USB data cable
- For the C version: Pico SDK 2.x with
PICO_BOARD=pico_w; for the MicroPython version:_picowfirmware (includes the cyw43 driver)
Complete code
// picow_blink.ino-like C SDK — la LED est sur WL_GPIO0 du CYW43439
// CMake : pico_stdlib + pico_cyw43_arch_none (pas besoin du réseau ici)
#include "pico/stdlib.h"
#include "pico/cyw43_arch.h"
int main(void) {
// cyw43_arch_init alimente le CYW43439 (via GP23) et charge son firmware
if (cyw43_arch_init) {
return 1; // impossible d'initialiser la puce radio
}
while (true) {
cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, 1); // LED ON (WL_GPIO0)
sleep_ms(250);
cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, 0); // LED OFF
sleep_ms(750);
}
}
// Équivalent MicroPython (firmware _picow) :
// from machine import Pin; import time
// led = Pin("LED", Pin.OUT) # alias de la broche pilotée via cyw43
// >
// # (souvent cité comme GP23) n'est pas confirmé dans la quickref rp2.
Expected verification
The green LED blinks: on for 250 ms, off for 750 ms. If you had written the "classic Pico" blink using gpio_init(25), nothing blinks — and for good reason: on the Pico W, GP25 is consumed internally (chip-select of the SPI driving the CYW43439) and the LED is elsewhere! That is THE lesson of this tutorial.
Common errors
- Reusing code from a classic Pico on GP25: on the Pico W, GP23/GP24/GP25/GP29 are reserved by the wireless module (power-on, SPI data/IRQ, SPI CS, SPI CLK) — the datasheet excludes them from user GPIOs.
- Compiling for the wrong board: forgetting
PICO_BOARD=pico_w(C SDK) or using a MicroPython firmware that is not_picow(without the cyw43 driver, the LED and Wi-Fi are invisible). - Forgetting
cyw43_arch_init: without initializing the driver,cyw43_arch_gpio_putdoes nothing — the LED is hanging on an unpowered radio chip. - Believing the board is defective because
blink_simpledoes not blink: this is documented behavior, the official example for the Pico W ispicow_blink. - Voltages: all logic is 3.3 V, not 5 V tolerant, just like on the classic Pico.
Other tutorials for this board
- Se connecter à un réseau Wi-Fi (station, WPA2/WPA3)
- Bouton et potentiomètre sans marcher sur le sans-fil (GPIO libres & ADC)
- Servir une page web depuis la Pico W (socket TCP + HTTP)
- Client HTTP : consommer une API depuis la Pico W
- Heure exacte via NTP : l'horloge temps réel des projets connectés
- Client MQTT : télémétrie IoT légère sur la Pico W
Code examples for this board
clignotante.pyPythonbouton-interruption.pyPythonpwm-servo.pyPythonlecture-adc.pyPythonneopixel.pyPythonoled-i2c.pyPython