🛠 Faire clignoter la LED embarquée (elle est derrière la puce Wi-Fi !)

Raspberry Pi Pico W · debutant · Schéma : IMG-pico-w-debutant-1-picow-blink-led.svg — Raspberry Pi Pico W vue de dessus avec la LED utilisateur mise en évidence, flèche pointant depuis la puce CYW43439 (blindage métallique) vers la LED, câble micro-USB branché

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

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

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials