Skip to content

fix(acceptance): #223 stm32 SPI + teensyLC LTO-symbol probes#226

Merged
zackees merged 1 commit intomainfrom
fix/223-stm32-spi-auto-discovery
May 10, 2026
Merged

fix(acceptance): #223 stm32 SPI + teensyLC LTO-symbol probes#226
zackees merged 1 commit intomainfrom
fix/223-stm32-spi-auto-discovery

Conversation

@zackees
Copy link
Copy Markdown
Member

@zackees zackees commented May 10, 2026

Two pre-existing acceptance-205.yml gates failed for the same reason: under each orchestrator's Release profile (-flto -Os + --gc-sections) the test was probing for a symbol the linker had inlined and stripped. Both fixes broaden the probe to also accept an LTO-stable signal that proves the intended code actually linked.

stm32f103c8 SPI auto-discovery — closes #223

teensyLC blink — acceptance-205.yml baseline failure since 2026-04-25

Same root-cause family: tiny setup() / loop() are visible in the LTO unit alongside Teensyduino's main.cpp and get inlined into main, with both unmangled and mangled symbols stripped. The original assertion (setup or _Z5setupv) is incompatible with the orchestrator's Release LTO settings.

  • crates/fbuild-build/tests/teensylc_acceptance.rs:88 — accept any of three signals: unmangled setup / loop, mangled _Z5setupv / _Z4loopv, or the sketch's Serial.println("Teensy LC Test - LED Blink") literal present in the firmware bytes (strings in .rodata survive --gc-sections because their address is taken by the println call).
  • crates/fbuild-build/tests/teensylc_acceptance.rs:114 — use result.compile_database_path from BuildResult instead of walking params.build_dir. The pipeline ignores params.build_dir and roots its cache at <project_dir>/.fbuild/build/<env>/<profile>/, so the previous walk-based lookup never found compile_commands.json. The orchestrator already reports the effective path — trust it.

Test plan

  • uv run soldr cargo test -p fbuild-build --release --test stm32_acceptance -- --ignored stm32f103c8_blink_with_spi_auto_discovers_library_205_ac4 passes locally
  • uv run soldr cargo test -p fbuild-build --release --test teensylc_acceptance -- --ignored teensylc_blink_meets_205_acceptance_criteria passes locally
  • uv run soldr cargo clippy --workspace --all-targets -- -D warnings clean
  • uv run soldr cargo fmt --all clean
  • CI: acceptance-205.yml STM32 gate goes green
  • CI: acceptance-205.yml teensyLC gate goes green (first time green since 2026-04-25)

Closes #223

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 10, 2026

Warning

Rate limit exceeded

@zackees has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 9 minutes and 30 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2e93be7b-4e93-4f7f-bcef-19e2d7dc44cd

📥 Commits

Reviewing files that changed from the base of the PR and between a04bb2a and 155e543.

📒 Files selected for processing (2)
  • crates/fbuild-build/tests/stm32_acceptance.rs
  • crates/fbuild-build/tests/teensylc_acceptance.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/223-stm32-spi-auto-discovery

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Two pre-existing acceptance gates failed for the same reason: under each
orchestrator's Release profile (`-flto -Os` + `--gc-sections`) the test
was probing for a symbol the linker had inlined and stripped. Both fixes
broaden the probe to also accept an LTO-stable signal that proves the
intended code was actually linked.

stm32f103c8 SPI auto-discovery (#223):

- crates/fbuild-build/tests/stm32_acceptance.rs:99 — accept either the
  mangled `_ZN8SPIClass*` symbol (non-LTO builds) OR a `PinMap_SPI_*`
  global from `Arduino_Core_STM32/libraries/SPI/src/utility/spi_com.c`
  (LTO builds; address-taken `const` array survives `--gc-sections`).
  Either signal proves the SPI library was auto-discovered, compiled,
  and linked. Orchestrator wiring is unchanged — already correct since
  #214 (commit 86bb2d9).

teensyLC blink (acceptance-205 baseline failure since 2026-04-25):

- crates/fbuild-build/tests/teensylc_acceptance.rs:88 — accept the
  unmangled `setup`/`loop`, the mangled `_Z5setupv`/`_Z4loopv`, OR the
  sketch's `Serial.println` literal `"Teensy LC Test - LED Blink"` in
  the firmware bytes. Strings in `.rodata` survive `--gc-sections`
  because their address is taken by the println call.
- crates/fbuild-build/tests/teensylc_acceptance.rs:114 — use
  `result.compile_database_path` from the BuildResult instead of
  walking `params.build_dir` (which the pipeline ignores: it roots its
  cache at `<project_dir>/.fbuild/build/<env>/<profile>/`).

Verified locally on Windows host (toolchain + packages cached): both
acceptance tests pass under Release LTO.

Closes #223

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@zackees zackees force-pushed the fix/223-stm32-spi-auto-discovery branch from 9835765 to 155e543 Compare May 10, 2026 18:31
@zackees zackees changed the title fix(stm32): #223 stm32f103c8 SPI auto-discovery fix(acceptance): #223 stm32 SPI + teensyLC LTO-symbol probes May 10, 2026
@zackees zackees merged commit a23d855 into main May 10, 2026
81 of 82 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

#205 AC#4: stm32f103c8 SPI auto-discovery is failing — SPIClass symbol missing from ELF

1 participant