Skip to content

fix(boards): match upstream defines for uno_r4_wifi, rpipico2, pico, nanorp2040connect - #2050

Merged
zackees merged 3 commits into
mainfrom
fix/board-define-drift-2038
Nov 17, 2026
Merged

zackees merged 3 commits into
mainfrom
fix/board-define-drift-2038

Conversation

@zackees

@zackees zackees commented Nov 17, 2026

Copy link
Copy Markdown
Member

Fixes #2038 (part of #2035).

Upstream check

Board Upstream defines fbuild before fbuild after
uno_r4_wifi ArduinoCore-renesas 1.6.0 recipes emit -DARDUINO_ARCH_{build.arch}; the package arch is renesas_uno, so the result is ARDUINO_ARCH_RENESAS_UNO (plus the literal ARDUINO_ARCH_RENESAS). platform-renesas-ra uno_r4_wifi.json lists it too missing added
rpipico2 arduino-pico 4.5.3 recipes emit -DARDUINO_ARCH_{build.arch}, arch rp2040 for every board. ARDUINO_ARCH_RP2350 appears nowhere in the core. RP2350 is flagged by PICO_RP2350=1 from lib/rp2350/platform_def.txt, which fbuild already loads. maxgerhardt rpipico2.json uses -DARDUINO_ARCH_RP2040 ARDUINO_ARCH_RP2350 (hand-written in be3f6ed); get_defines emitted both RP2040 and RP2350 ARDUINO_ARCH_RP2040 only
pico, nanorp2040connect upstream PIO JSONs use -D ARDUINO_... (spaced) copied verbatim -DARDUINO_...

Parser

get_defines already handled -D NAME. ini_parser::parse_flags folds it into -DNAME, and parse_define_flags pairs a bare -D with the next token as well. The new test extra_flags_separated_define_resolves_like_the_joined_form pins that behaviour. So the spacing change only normalises the data; no parser fix was needed.

Generator

enrich_boards overwrites extra_flags from upstream PIO. Re-running it would have reintroduced the spaced form, so it now joins -D NAME (second commit). That bin now has tests, so its harness is re-enabled, as check_test_layout requires. The bundle-wide guard bundled_extra_flags_use_joined_define_form and the per-board define tests catch a regeneration that reverts any of these fixes. ci/enrich_extra_flags.py only fills missing entries and never overwrites.

Library impact (FastLED)

  • src/platforms.h picks RP2350 on PICO_RP2350 || ARDUINO_ARCH_RP2350, so detection still works through PICO_RP2350, which matches what Arduino IDE builds see.
  • ARDUINO_ARCH_RENESAS_UNO gates FastLED's Renesas UNO memory class (compile_test.hpp) and an alternate platform-detection arm. The WiFi board now matches the Minima.

Validation

  • RED: the 3 new drift tests failed before the JSON edits. GREEN: bash test -p fbuild-config passes (258 lib + 2 bin).
  • soldr cargo fmt --all, soldr cargo clippy --workspace --all-targets -- -D warnings, and ci/check_test_layout.py are clean.
  • E2E (FBUILD_DEV_MODE=1, --clean, rebuilt CLI/daemon): uno_r4_wifi and rpipico2 (board_build.core = earlephilhower) blinks build. In compile_commands.json, all 67 uno_r4_wifi TUs get -DARDUINO_ARCH_RENESAS_UNO and all 45 rpipico2 TUs get -DARDUINO_ARCH_RP2040 and -DPICO_RP2350. There is no ARDUINO_ARCH_RP2350 and no bare -D.

…nanorp2040connect

- uno_r4_wifi: add -DARDUINO_ARCH_RENESAS_UNO. ArduinoCore-renesas 1.6.0
  recipes emit -DARDUINO_ARCH_{build.arch} with arch `renesas_uno`, and
  platform-renesas-ra's uno_r4_wifi.json carries it (as #2025 did for Minima).
- rpipico2: -DARDUINO_ARCH_RP2350 -> -DARDUINO_ARCH_RP2040. arduino-pico
  4.5.3 emits -DARDUINO_ARCH_{build.arch} with arch `rp2040` for every
  board; ARDUINO_ARCH_RP2350 appears nowhere in the core (RP2350 is flagged
  by PICO_RP2350=1 from lib/rp2350/platform_def.txt, which fbuild already
  loads). maxgerhardt/platform-raspberrypi rpipico2.json agrees.
- pico, nanorp2040connect: `-D ARDUINO_X` -> `-DARDUINO_X`. The resolver
  already pairs the separated form (pinned by a new test); the bundle keeps
  one token per define, guarded bundle-wide.

Fixes #2038
…flags

Upstream PlatformIO pico.json / nanorp2040connect.json write `-D ARDUINO_...`.
enrich_boards overwrites extra_flags from upstream, so a re-run would
reintroduce the spaced form fixed in the previous commit. Join it at the
whitespace-token level (ini_parser::parse_flags does the same join but also
strips the quoting layer the stored JSON must keep). The bin now has tests,
so its harness is re-enabled (check_test_layout forbids test = false then).

Refs #2038
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Validate Boards compares the bundle to upstream PlatformIO after the same
merge enrich_boards applies. Mirror the new `-D NAME` -> `-DNAME` join so
the normalised pico / nanorp2040connect flags are not reported as drift.

Refs #2038
@zackees
zackees added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit b4b683d Nov 17, 2026
30 checks passed
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

boards: define drift in uno_r4_wifi, rpipico2, pico and nanorp2040connect JSONs

1 participant