Skip to content

Pass detection preferences to M5GFX and stop assuming rejected boards - #399

Merged
lovyan03 merged 3 commits into
m5stack:developfrom
ainyan03:detect_positive_evidence
Oct 10, 2026
Merged

lovyan03 merged 3 commits into
m5stack:developfrom
ainyan03:detect_positive_evidence

Conversation

@ainyan03

@ainyan03 ainyan03 commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Follows the M5GFX board detection rework (requires m5stack/M5GFX#345).

  • cfg.fallback_board is passed to M5GFX through Display.setDetectConfig() before Display.init(), so a provisional detection result that differs from it does not build the wrong display.
  • A positive BOARD_ID is now an accepted, fixed firmware identity: M5GFX starts that board directly (no other families, no NVS). M5Unified selects it first and keeps it even when display startup fails. With a fixed BOARD_ID, the early ESP32-S3 GPIO46 hold is applied only when that board uses GPIO46 for power hold.
  • The package default (used only when nothing was detected) is restricted to boards that detection cannot reject:
    • ESP32 D0WDQ6: TimerCam → unknown (TimerCam has its own detector)
    • other ESP32 packages without M5 boards: AtomLite → unknown
    • ESP32-C6 / ESP32-H2 / ESP32-C5: NanoC6 / NanoH2 / StampC5 → unknown. StampC6 and StampC5 arrive as M5GFX candidates instead
    • PICO-D4 (StampPico), PICO-V3 (AtomPsram), ESP32-S3, ESP32-C3 and ESP32-P4 defaults are unchanged
    • Arduino board-definition selections are unchanged

Behavior changes

  • An unknown board does not get board-specific power hold, LEDs or buttons. On ESP32 the generic internal I2C (G21/G22) is still started.
  • A TimerCam whose RTC does not answer no longer holds G33 by default (on battery it powers off). Use the TimerCam Arduino board definition, cfg.fallback_board or BOARD_ID.
  • StampC6 / StampC5 are still selected, but no display object is added (getDisplayCount() 1 → 0).
  • Generic ESP32 boards (e.g. D0WD dev kits) are no longer treated as AtomLite (no LED on G27, internal I2C on G21/G22 instead of G21/G25).

Testing

Built together with the M5GFX change on the M5Unified / M5GFX CI versions (Arduino and ESP-IDF), and checked on 41 devices. This PR's CI fetches M5GFX from the develop branch, so it fails until the M5GFX change is merged.

Call Display.setDetectConfig() with cfg.fallback_board before Display.init(), so a provisional detection result that differs from it is not constructed and the fallback is selected instead.
Pass a positive BOARD_ID to M5GFX as the fixed board. M5Unified selects the accepted fixed board first and keeps it when display startup fails; an explicit fallback for a different board is ignored with a warning. On ESP32-S3, the early GPIO46 hold is applied for a fixed board only when that board uses GPIO46 for power hold.
The package default is used only when nothing was detected. Restrict it to boards no detector can reject: StampPico (PICO-D4), AtomPsram (PICO-V3), StampS3/StampS3Mini, StampC3U and StampP4/StampP4X stay. ESP32 D0WDQ6 (all members have detectors) and other ESP32 packages without M5 boards return unknown instead of TimerCam/AtomLite. ESP32-C6, ESP32-H2 and ESP32-C5 return unknown instead of NanoC6/NanoH2/StampC5; StampC6 and StampC5 arrive as display candidates.

Unknown boards get no board-specific power hold, LEDs or buttons; on ESP32 the generic internal I2C (G21/G22) is still started. A TimerCam whose RTC does not answer no longer holds G33; use the TimerCam board definition, cfg.fallback_board or BOARD_ID. Arduino board-definition selections are unchanged.
@ainyan03
ainyan03 force-pushed the detect_positive_evidence branch from c3d484c to ecf8ac1 Compare October 10, 2026 23:23
@lovyan03
lovyan03 merged commit fc1fb2d into m5stack:develop Oct 10, 2026
30 of 59 checks passed
@ainyan03
ainyan03 deleted the detect_positive_evidence branch October 10, 2026 23:55
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.

2 participants