Skip to content

Use the board detector for ESP32-P4 boards, rename PoE-P4 display output settings to Display Out - #397

Merged
lovyan03 merged 3 commits into
m5stack:developfrom
ainyan03:p4_detect
Oct 9, 2026
Merged

lovyan03 merged 3 commits into
m5stack:developfrom
ainyan03:p4_detect

Conversation

@ainyan03

@ainyan03 ainyan03 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Leave ESP32-P4 board identification to the M5GFX board detector (m5stack/M5GFX#343), and rename the PoE-P4 display output settings to Display Out. Requires M5GFX with #343.

Changes

  • Remove the P4 GPIO checks from _check_boardtype() (G32 high: Tab5, G0 high: Unit PoE-P4, otherwise Stamp-P4). User wiring can change both pins. M5GFX now confirms Unit PoE-P4 by its Ethernet PHY and reports Tab5 / Stamp-P4 candidates through getBoardCandidate().
  • BOARD_ID 31 (CoreP4X) and 35 (Tab5X), set by board-specific firmware builds, now apply after cfg.fallback_board and before the detector's candidate. Otherwise the Stamp-P4 candidate that M5GFX reports for any unconfirmed P4 board would hide them.
  • The P4 package default becomes Stamp-P4 / Stamp-P4X (by chip revision) instead of Tab5.
  • Rename (separate commit): cfg.unit_poep4_display_out and cfg.external_display.unit_poep4_display_out replace the unit_poep4_hdmi names, which remain as deprecated members.
    • The two settings structures are separate members. If the deprecated one differs from its defaults it is used, with a warning.
    • Bit 9 of external_display_value is now unit_poep4_display_out; the deprecated flag moves to bit 10. Clearing either flag disables Display Out. A sketch that zeroes external_display_value and then sets only the deprecated flag no longer enables it; use the new name.
    • Examples use the new names.

Tested

  • Stamp-P4 (chip v1.3), Tab5 (v1.0), Unit PoE-P4 (v1.3) with and without Display Out: M5.getBoard() = 150 / 22 / 148.
  • Tab5 with the display setup forced to fail: M5.getBoard() = Tab5 through the candidate.
  • Unit PoE-P4 + Display Out: attaches as a 1280x720 display with the new names; with the old names and 1920x1080@30 the old settings take effect, with deprecation warnings at build time and the runtime warning.
  • Builds for the versions in the upstream CI (Arduino 2.0.17 / 3.x, ESP-IDF 4.4 – 6.1).
  • Not tested: CoreP4X, Tab5X, Stamp-P4X (no hardware).

The depends on M5GFX in library.properties / library.json should be raised to the release that contains M5GFX#343; without it, a newer M5Unified with an older M5GFX silently skips Display Out.

BOARD_ID 31 (CoreP4X) and 35 (Tab5X), set by board-specific firmware
builds, now apply after cfg.fallback_board and before the detector's
candidate. M5GFX reports a StampP4 candidate for any P4 board it cannot
confirm, which would otherwise hide the build selection.
Remove the P4 GPIO checks from _check_boardtype() (G32 high: Tab5, G0
high: UnitPoEP4, otherwise StampP4). Both pins can be changed by user
wiring; M5GFX now confirms UnitPoEP4 by its Ethernet PHY and reports Tab5
and StampP4 candidates.

The P4 package default becomes StampP4 / StampP4X (by chip revision)
instead of Tab5.
cfg.unit_poep4_display_out and cfg.external_display.unit_poep4_display_out
replace the unit_poep4_hdmi names, which remain as deprecated members.

- The two settings structures are separate members. If the deprecated one
  differs from its defaults it is used, with a warning.
- Bit 9 of external_display_value is now unit_poep4_display_out; the
  deprecated flag moves to bit 10. Clearing either flag disables Display
  Out. A sketch that zeroes external_display_value and then sets only the
  deprecated flag no longer enables it.
@lovyan03
lovyan03 merged commit 07a5daa into m5stack:develop Oct 9, 2026
30 checks passed
@ainyan03
ainyan03 deleted the p4_detect branch October 9, 2026 06:20
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