Skip to content

fix(thinknode_m9): define SPI_FREQUENCY for the non-MUI build - #11546

Merged
thebentern merged 1 commit into
developfrom
fix/thinknode-m9-spi-frequency
Aug 19, 2026
Merged

thebentern merged 1 commit into
developfrom
fix/thinknode-m9-spi-frequency

Conversation

@thebentern

@thebentern thebentern commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Problem

build (thinknode_m9, esp32s3) has failed on every develop run since #10908 landed. develop was green through 5dffd2258, red from c308d0aca onward, and this is currently the only failing job on develop.

src/graphics/TFTDisplay.cpp:504:30: error: 'SPI_FREQUENCY' was not declared in this scope; did you mean 'SD_SPI_FREQUENCY'?
  504 |             cfg.freq_write = SPI_FREQUENCY;
      |                              ^~~~~~~~~~~~~

The M9's variant.h defines ST7789_CS, so TFTDisplay.cpp compiles its ST7789 LGFX branch, which reads SPI_FREQUENCY for the panel write clock — SPI_READ_FREQUENCY, its pair, is already in variant.h. But -D SPI_FREQUENCY=75000000 was only set in [env:thinknode_m9-tft], so the plain env has never compiled.

Change

Move the flag from the -tft env up into thinknode_m9_base, keeping the 75 MHz the -tft env already used for the same panel — and matching SD_SPI_FREQUENCY on the bus the two share.

It stays a build flag rather than moving into variant.h because device-ui's LGFX_GENERIC.h doesn't include variant.h: it reads SPI_FREQUENCY itself and silently falls back to #define SPI_FREQUENCY 20000000 when the macro is absent. One flag on the base keeps both consumers on the same value.

thinknode_m9-tft is unaffected — it inherits ${thinknode_m9_base.build_flags}.

Tests

Resolved flags, via pio project config --json-output — the MUI env is unchanged, the plain env gains the macro:

env:thinknode_m9      -> ['-D SD_SPI_FREQUENCY=75000000U', '-D SPI_FREQUENCY=75000000']
env:thinknode_m9-tft  -> ['-D SD_SPI_FREQUENCY=75000000U', '-D SPI_FREQUENCY=75000000']

pio run -e thinknode_m9: SUCCESS in 7:17, zero errors, src/graphics/TFTDisplay.cpp.o compiles clean.

No M9 hardware on hand, so this is a build fix verified by building. Since thinknode_m9-tft's resolved flags are identical to before, the MUI build is byte-for-byte unchanged and needs no re-test on device.

Summary by CodeRabbit

  • Bug Fixes
    • Improved SPI display communication settings for ThinkNode M9 builds.
    • Standardized the SPI frequency configuration across display environments.

The M9's variant.h defines ST7789_CS, so TFTDisplay.cpp compiles its
ST7789 LGFX branch, which reads SPI_FREQUENCY for the panel write clock
(SPI_READ_FREQUENCY, its pair, is already in variant.h). The flag was only
set in the -tft env, so `build (thinknode_m9, esp32s3)` has failed on
develop since the board landed in #10908:

  src/graphics/TFTDisplay.cpp:504:30: error: 'SPI_FREQUENCY' was not
  declared in this scope; did you mean 'SD_SPI_FREQUENCY'?

Move the flag up into thinknode_m9_base, keeping the 75 MHz the -tft env
already used for the same panel and matching the SD card's 75 MHz on the
bus they share. The -tft env inherits the base flags, so device-ui's
LGFX_GENERIC.h - which falls back to 20 MHz when the macro is absent -
still sees the identical value.
@github-actions

Copy link
Copy Markdown
Contributor

⚡ Try this PR in the Web Flasher

Note

Building this pull request… the flash button, badges and supported-board
list will appear here automatically once CI finishes.

@coderabbitai

coderabbitai Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 5ec9b723-a955-4ce2-8802-b487e63063ee

📥 Commits

Reviewing files that changed from the base of the PR and between a5fc95f and 09838de.

📒 Files selected for processing (1)
  • variants/esp32s3/ELECROW-ThinkNode-M9/platformio.ini

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The ThinkNode M9 configuration now defines SPI_FREQUENCY=75000000 in the shared build flags. The TFT-specific environment no longer defines the same flag.

Changes

ThinkNode M9 SPI configuration

Layer / File(s) Summary
Centralize SPI frequency build flag
variants/esp32s3/ELECROW-ThinkNode-M9/platformio.ini
The shared ThinkNode M9 configuration adds the 75 MHz SPI flag. The TFT environment removes its duplicate flag.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 09838

This change defines the existing 75 MHz SPI write frequency for the plain ThinkNode M9 build while preserving the TFT build configuration. It addresses the build failure without changing runtime behavior for the existing TFT environment, and no actionable merge-blocking risk remains.

Suggested reviewers: mverch67

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the ThinkNode M9 build fix and the missing SPI_FREQUENCY definition.
Description check ✅ Passed The description clearly explains the problem, implementation, build verification, unchanged MUI environment, and unavailable hardware.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/thinknode-m9-spi-frequency

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.

@thebentern thebentern added the bugfix Pull request that fixes bugs label Aug 19, 2026
@thebentern
thebentern merged commit 9fcb289 into develop Aug 19, 2026
48 of 57 checks passed
@thebentern
thebentern deleted the fix/thinknode-m9-spi-frequency branch August 19, 2026 01:28
papadopouloskyriakos pushed a commit to meshsat/meshsat-firmware that referenced this pull request Oct 18, 2026
…stic#11546)

The M9's variant.h defines ST7789_CS, so TFTDisplay.cpp compiles its
ST7789 LGFX branch, which reads SPI_FREQUENCY for the panel write clock
(SPI_READ_FREQUENCY, its pair, is already in variant.h). The flag was only
set in the -tft env, so `build (thinknode_m9, esp32s3)` has failed on
develop since the board landed in meshtastic#10908:

  src/graphics/TFTDisplay.cpp:504:30: error: 'SPI_FREQUENCY' was not
  declared in this scope; did you mean 'SD_SPI_FREQUENCY'?

Move the flag up into thinknode_m9_base, keeping the 75 MHz the -tft env
already used for the same panel and matching the SD card's 75 MHz on the
bus they share. The -tft env inherits the base flags, so device-ui's
LGFX_GENERIC.h - which falls back to 20 MHz when the macro is absent -
still sees the identical value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Pull request that fixes bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant