Skip to content

fix(boards): give uno_r4_minima its build block (#2015) - #2025

Merged
zackees merged 4 commits into
mainfrom
fix/uno-r4-minima-build-block-2015
Nov 16, 2026
Merged

zackees merged 4 commits into
mainfrom
fix/uno-r4-minima-build-block-2015

Conversation

@zackees

@zackees zackees commented Nov 16, 2026

Copy link
Copy Markdown
Member

Root cause

uno_r4_minima.json has no build block, so it has no variant and no flags. It was imported in the bulk "update json" snapshot in its stripped form. enrich_boards silently skips any board whose PlatformIO platform isn't installed under ~/.platformio/platforms, and renesas-ra wasn't installed. uno_r4_wifi.json got its build block by hand later, when the Renesas pipeline landed (e2561e6); its siblings never did. With no build.variant, the board resolves to a fallback variant name that ArduinoCore-renesas doesn't ship. get_variant_includes then only logs a warning and returns no FSP include dirs, so the core fails at bsp_api.h / common_data.h.

Fix

  1. Board data (commit 1). Adds build blocks taken from ArduinoCore-renesas 1.6.0 boards.txt (the core fbuild pins in renesas_core.rs) and its platform.txt recipe defines. They follow the uno_r4_wifi sibling's shape and are cross-checked against platformio/platform-renesas-ra boards/*.json:
    • uno_r4_minima: variant MINIMA, -DARDUINO_UNOR4_MINIMA -DARDUINO_MINIMA (the core's own sources branch on ARDUINO_MINIMA), ARDUINO_ARCH_RENESAS(_UNO), ARDUINO_FSP, CFG_TUSB_MCU=OPT_MCU_RAXXX, _RA_CORE=CM4 _RENESAS_RA_. No NO_USB, because the Minima has native USB.
    • nano_r4: variant NANOR4, ARDUINO_NANO_R4 ARDUINO_UNOR4_MINIMA ARDUINO_nanor4 (the macro boards.txt's build.board produces).
    • portenta_c33: variant PORTENTA_C33, from upstream boards.txt and PIO. This is a data fix only: the Portenta core is the separate renesas_portenta package, which fbuild doesn't install, and there's no RA6M5 MCU config, so the board still doesn't build.
    • No VID/PID/hwids added.
  2. Fail fast (commit 2). The Renesas orchestrator now rejects a variant directory the core doesn't ship, with a ConfigError that names the variant and path, instead of failing later at bsp_api.h. build() doesn't grow (one line replaced).
  3. Generators (commit 3):
    • enrich_boards now lists every arduino board that still has no build.variant after a run, so the skip is no longer silent.
    • ci/enrich_extra_flags.py had two problems. On a board with no build block it emitted an extra_flags-only block with no core or variant. It also wrote PIO's list-form extra_flags verbatim, and the loader drops that silently. It now fills a missing core/variant from upstream (never overwriting) and joins list flags into a string.

Audit (framework-arduino boards missing build, build.variant or build.core)

  • renesas-ra: uno_r4_minima, nano_r4, portenta_c33. All fixed here.
  • Not fixed (out of scope; most don't need a variant or aren't platforms fbuild builds):
    • teensy ×10: no variant, by design for the Teensy cores.
    • espressif32 ×2 (esp32-c6-devkitc-1, seeed_xiao_esp32c6): no variant; they fall back to the mcu variant.
    • ch32v ×11: the variant lives under build.arduino.openwch.variant.
    • atmelavr ×4: attiny1634/441/828/841, core tinymodern, no variant.
    • No build block: heltec-cubecell ×11, logicrom ×29, kendryte210 ×5, k1921vk ×3, titiva ×3, timsp432 ×1, intel_arc32 ×1, wasm ×1.
    • No build.core, so the loader defaults it to arduino: libretiny ×47, ststm32 ×33, infineonxmc ×8.

Tests

  • New crates/fbuild-config/src/board/tests_renesas_boards.rs:
    • Minima resolves MINIMA with the Minima defines and without NO_USB.
    • Nano R4 resolves NANOR4.
    • Every bundled renesas-ra board declares build.core, build.variant and build.extra_flags.
    • All three failed before the JSON fix (red) and pass after it.
  • renesas::orchestrator::tests::check_variant_dir_rejects_a_variant_the_core_does_not_ship.

Validation

  • soldr cargo fmt --all: clean
  • soldr cargo clippy --workspace --all-targets -- -D warnings: exit 0
  • bash test -p fbuild-config, bash test -p fbuild-build-arm: exit 0
  • End-to-end (FBUILD_DEV_MODE=1, rebuilt CLI and daemon, blink sketch from the issue):
    • uno_r4_minima: builds (flash 28060 B, ram 13612 B).
    • uno_r4_wifi (control) and nano_r4: build.
    • An env with board_build.variant = standard now fails immediately with Renesas variant 'standard' not found at ….

Fixes #2015

uno_r4_minima.json (and its Renesas siblings nano_r4 and portenta_c33)
shipped with no `build` block, so the board resolved to a fallback
variant that ArduinoCore-renesas does not ship. The Renesas builder takes
the FSP include dirs from variants/<variant>/includes.txt, so the core
failed at bsp_api.h / common_data.h.

Add build blocks taken from ArduinoCore-renesas 1.6.0 boards.txt (the
pinned core) plus the platform.txt recipe defines, cross-checked against
platformio/platform-renesas-ra boards/*.json:
- uno_r4_minima: variant MINIMA, ARDUINO_UNOR4_MINIMA + ARDUINO_MINIMA,
  native USB (no NO_USB).
- nano_r4: variant NANOR4, ARDUINO_NANO_R4 + ARDUINO_UNOR4_MINIMA.
- portenta_c33: variant PORTENTA_C33 (data only; its core is the separate
  renesas_portenta package, which fbuild does not install).

Guard: tests_renesas_boards.rs asserts the Minima/Nano R4 variants and
defines, and that every bundled renesas-ra board declares build.core,
build.variant and build.extra_flags.

Fixes #2015
…2015)

A board whose variant directory is missing compiled with no FSP include
path and died much later at `bsp_api.h: No such file or directory`.
Reject it up front with a ConfigError that names the variant and path.
…ss (#2015)

enrich_boards skips any board whose PlatformIO platform is not installed
locally; that is how uno_r4_minima kept its stripped form. It now lists
every arduino board still missing build.variant after a run.

enrich_extra_flags.py, when a board had no build block, emitted one with
only extra_flags (and wrote PlatformIO's list form verbatim, which the
board loader ignores). It now joins list flags into a string and copies a
missing core/variant from the upstream JSON, never overwriting.
@coderabbitai

coderabbitai Bot commented Nov 16, 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

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.

UNO R4 Minima: uno_r4_minima.json has no build block, core fails at bsp_api.h (2.5.51)

1 participant