Skip to content

Raspberry Pi Pico W: rpipicow.json lacks the CYW43 defines, so every sketch fails at link (2.5.51) #2014

Open

Description

@stevenmunn312-tech

Summary

On fbuild 2.5.51 a Pico W sketch that uses no network fails at link: the arduino-pico core's pinMode, digitalWrite and initVariant call into the CYW43 driver, and those symbols are undefined. The Pico 2 W (rpipico2w) links the same sketch.

The cause looks to be the board file: rpipicow.json does not carry the two defines that compile the driver wrappers, and rpipico2w.json does.

Reproduce

platformio.ini:

[env:rpipicow]
platform = raspberrypi
board = rpipicow
framework = arduino

src/main.cpp:

#include <Arduino.h>
void setup() { pinMode(LED_BUILTIN, OUTPUT); }
void loop() { digitalWrite(LED_BUILTIN, HIGH); delay(500); digitalWrite(LED_BUILTIN, LOW); delay(500); }
$ fbuild <project> build -e rpipicow -v --no-timestamp
build error: build failed: arm-none-eabi-gcc link failed:
digital.cpp:(.text.pinMode+0x2): undefined reference to `cyw43_pinMode'
digital.cpp:(.text.digitalWrite+0x2): undefined reference to `cyw43_digitalWrite'
init.cpp:(.text.initVariant+0x2): undefined reference to `init_cyw43_wifi'

Cause

In arduino-pico, cores/rp2040/cyw43_wrappers.cpp defines those three functions inside #if defined(PICO_CYW43_SUPPORTED), and both variants' digital.cpp and init.cpp call them unconditionally. The core's boards.txt sets the define for both boards:

rpipicow.build.extra_flags=-DPICO_CYW43_SUPPORTED=1 -DCYW43_PIN_WL_DYNAMIC=1
rpipico2w.build.extra_flags=-DPICO_CYW43_SUPPORTED=1 -DCYW43_PIN_WL_DYNAMIC=1

fbuild's board files differ (crates/fbuild-config/assets/boards/json/, same on main at 00bfaeb):

rpipico2w.json: "extra_flags": "-DARDUINO_RASPBERRY_PI_PICO_2W -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250 -DPICO_CYW43_SUPPORTED=1 -DCYW43_PIN_WL_DYNAMIC=1"
rpipicow.json:  "extra_flags": "-DARDUINO_RASPBERRY_PI_PICO_W -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250"

Control

Adding the two defines to the project makes the same sketch link:

build_flags = -DPICO_CYW43_SUPPORTED=1 -DCYW43_PIN_WL_DYNAMIC=1
build succeeded in 18.1s (flash: 536372 bytes, ram: 79724 bytes)

Suggested fix

Add -DPICO_CYW43_SUPPORTED=1 -DCYW43_PIN_WL_DYNAMIC=1 to rpipicow.json's extra_flags.

Environment

  • fbuild 2.5.51+git.9b26affea5ad, Windows 11, rebuilt 2026-11-14.
  • Also on a GitHub windows-latest runner (2026-11-11).
  • Arduino CLI builds the sketch for the Pico W on core rp2040:rp2040 6.1.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions