Skip to content

RP2040: default Arduino Mbed configuration enters Arduino-Pico backend and fails with ENOENT #1977

Closed

Description

@zackees

Reproduction

Using fbuild 2.5.50 on Linux:

[env:rp2040]
platform = raspberrypi
board = pico
framework = arduino

Minimal sketch: include Arduino.h, empty setup() and loop(). The investigation used a consumer sketch with FastLED as a local dependency, but the failure occurs before sketch compilation.

Board: Raspberry Pi Pico / RP2040 @ 133MHz
Memory: 2.00MB Flash, 264.00KB RAM
Toolchain: arm-none-eabi-gcc 14.2.0
build error: io error: No such file or directory (os error 2)

Source evidence

The RP2040 orchestrator selects Rp2040Cores (Arduino-Pico) unconditionally, ensures the Arduino-Pico pqt toolchain and framework, and scans its core/variant layout. It has no Arduino Mbed dispatch. The standard pico definition is an Mbed-core profile, so successful rpipico/Arduino-Pico builds do not validate this path.

Expected

Support the selected Mbed framework, or reject unsupported core selection early with an actionable diagnostic rather than a generic ENOENT. Do not silently replace Mbed with Arduino-Pico.

Consumer impact

Blocks an fbuild reproduction of FastLED/FastLED#5233 against the reporter’s default Arduino Mbed core. The same FastLED 3.10.9 sources compile with Arduino-Pico 5.7.0; this is not evidence that Mbed is compatible.

Coordinated with FastLED/FastLED#5233. No FastLED source fix is claimed by this report.

Activity

  1. zackees commented on Nov 10, 2026

    @zackees
    MemberAuthor

    Status: PR #1979 adds only a fail-fast diagnostic (typed ConfigError naming the Mbed core + workaround, raised before provisioning). It does not build the Mbed core. Root cause of the old ENOENT: pico.json has build.core = "arduino", so the RP2040 orchestrator's source scan used Rp2040Cores::get_core_dir("arduino") -> nonexistent cores/arduino inside Arduino-Pico (crates/fbuild-build-arm/src/rp2040/orchestrator.rs, core_dir/scan step).

    Plan: real Arduino Mbed OS RP2040 builds

    Packages (PlatformIO registry, same as stock platform-raspberrypi):

    • platformio/framework-arduino-mbed (ArduinoCore-mbed; RP2040 variants RASPBERRY_PI_PICO, NANO_RP2040_CONNECT).
    • platformio/toolchain-gccarmnoneeabi (the GCC version pinned by platform-raspberrypi's platform.json for the mbed core, not the pqt-gcc used for Arduino-Pico).
    • Upload reuses existing picotool/UF2 path (elf2uf2-equivalent is fine; Mbed images include boot2 already in libmbed.a/linker script).

    Flags - mirror platform-raspberrypi/builder/frameworks/arduino/mbed-core/arduino-core-mbed.py, which takes everything from the variant dir variants/<VARIANT>/:

    • defines.txt -> CPPDEFINES, cflags.txt / cxxflags.txt -> CC/CXX flags, includes.txt (with -iwithprefixbefore + -iprefix <framework>/cores/arduino) -> CPPPATH, ldflags.txt -> LINKFLAGS, libs/libmbed.a + linker_script.ld -> link.
    • Extra defines: ARDUINO=10810, ARDUINO_ARCH_MBED, ARDUINO_ARCH_RP2040, ARDUINO_<board>, F_CPU, plus -DMBED_NO_GLOBAL_USING_DIRECTIVE; core sources cores/arduino/** + variant sources; libraries/ as framework libs.
    • fbuild already has helpers for "flags from txt manifests" (add_prefixed_include_file, add_define_file in rp2040 orchestrator) - reuse them.

    Implementation shape (no new crate):

    1. fbuild-library: ArduinoMbedCore package (like Rp2040Cores) + toolchain entry in fbuild-toolchain.
    2. fbuild-build-arm/src/rp2040/mbed.rs: build_mbed() path; rp2040/core_select.rs returns an enum {ArduinoPico, Mbed} instead of an error, orchestrator dispatches.
    3. Tests: unit tests for variant-manifest flag parsing on a tempdir fixture; #[ignore = "downloads framework-arduino-mbed"] integration build of tests/platform/pico-mbed (empty sketch) + CI board lane.

    Effort: ~400-600 lines + test fixture, 1-2 days including CI lane; main risk is matching the pinned toolchain version and libmbed.a link order.

  2. zackees commented on Nov 10, 2026

    @zackees
    MemberAuthor

    Implementation is now explicitly authorized by the FastLED maintainer in the #5233 investigation, including the real Mbed prerequisite rather than only a better diagnostic. Work is isolated on feat/rp2040-mbed-core in a separate dependency checkout; the other fbuild session’s checkout and shared daemons are not being modified.

    Acceptance remains: (1) checkout-built fbuild reproduces the unsupported-Mbed failure, (2) stock pico selects ArduinoCore-mbed while explicit Earle Philhower selection stays Arduino-Pico, (3) replay the published Mbed RP2040 variant compile/define/include/link inputs and prebuilt libmbed.a without substituting Arduino-Pico, (4) actual empty-sketch Mbed link, (5) exact FastLED 3.10.9 consumer compiler output and then its fix. Rust tests and all Rust tools go through soldr; actual board builds go through fbuild. No PlatformIO execution.

    Completed so far: checkout CLI/daemon build and the real baseline rejection; framework-selection regression failed with Pico vs Mbed, then passed after selector logic. The Mbed recipe and variant-contract tests are in progress. No functioning Mbed build or consumer fix is claimed yet.

  3. zackees commented on Nov 10, 2026

    @zackees
    MemberAuthor

    Real Mbed integration milestone: the checkout-built backend successfully compiled and linked the stock pico empty sketch against ArduinoCore-mbed 4.5.0 / variants/RASPBERRY_PI_PICO / libmbed.a using managed Arm GCC 15.2.1. Result: 74,779 bytes flash, 39,228 bytes RAM. This was not Arduino-Pico fallback.

    The exact FastLED 3.10.9 consumer then reached library compilation and exposed a backend argument-size failure: GCC could not launch cc1plus because the expanded SDK include paths made its option environment too large. I am preserving the published Mbed -iprefix/-iwithprefixbefore recipe instead of expanding every SDK path, with a regression and the same consumer rerun pending.

    No FastLED source compiler failure or missing WiFi.h has yet been reproduced; #5233 remains open. Backend unit tests and integration work are not yet a landed/released support claim.

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