Repository navigation
Detect displayless ESP32-P4 boards in the board detector, Tab5X by chip revision, rename PoE-P4 display output to Display Out - #343
Merged
Conversation
Add UnitPoEP4 and StampP4 / StampP4X to the board catalog. detect_class may no longer be placed on connector pins or button pins: external wiring or a button held at power-on changes their level, so they cannot tell boards apart. The validator rejects both. StampS3Mini's legacy_board_id is corrected from 150 to 155 to match boards.hpp; 150 is StampP4 and the duplicate failed the catalog check.
ESP32-P4 boards other than Tab5 and CoreP4X were left to GPIO checks in M5Unified (G32 high: Tab5, G0 high: UnitPoEP4, otherwise StampP4), and the P4 detector list ran only while NVS held no board or a P4 display board. - The P4 detector list now always runs and reports candidates to the caller, as on the other chips. - UnitPoEP4: when G31 and G52 are pulled up and G32 is floating, read the IP101 PHY ID (address 1, registers 2 / 3 = 0x0243 / 0x0C54) over MDIO with both lines driven open-drain. G51 (PHY reset) is not touched. The pull check keeps Tab5 out, where G31 / G32 are the internal I2C bus. - StampP4 / StampP4X has nothing on board to confirm, so it is reported only as a candidate (chip revision v3.0 or later: StampP4X) and is never saved to NVS. - Tab5: with the internal I2C bus present and G22 (backlight enable, pulled down by a resistor) low, a Tab5 candidate is kept even when the IO expanders do not answer or the display setup fails. This replaces the G32 check in M5Unified.
Tab5X is Tab5 with an ESP32-P4 of chip revision v3.0 or later. Without a saved hint the detector returned Tab5 on Tab5X and saved it to NVS, so M5Unified did not enable Tab5X's controllable EXT port power. Select Tab5X from the chip revision. A saved Tab5 / Tab5X hint that disagrees is logged and overridden.
The add-on board for Unit PoE-P4 is named Display Out. Rename board_M5UnitPoEP4HDMI to board_M5UnitPoEP4DisplayOut (value 201 is unchanged), the class M5UnitPoEP4HDMI to M5UnitPoEP4DisplayOut and the header M5UnitPoEP4HDMI.h to M5UnitPoEP4DisplayOut.h. The old enum value and class remain as deprecated aliases, the old header includes the new one, and the old feature macros stay defined, so existing sketches build with deprecation warnings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Identify the ESP32-P4 boards without a built-in display in the board detector, select Tab5X by chip revision, and rename the PoE-P4 display output to Display Out.
Until now M5Unified told these boards apart by GPIO levels (G32 high: Tab5, G0 high: Unit PoE-P4, otherwise Stamp-P4), and the P4 detector list ran only when NVS held no board or a P4 display board. M5Unified will drop those checks in a follow-up PR once this is merged.
Changes
getBoardCandidate(); chip revision v3.0 or later: Stamp-P4X). It is never saved to NVS.detect_classmay no longer be set on connector or button pins (external wiring or a button held at power-on changes their level); the validator rejects both. StampS3Mini'slegacy_board_idis corrected to 155.board_M5UnitPoEP4HDMI→board_M5UnitPoEP4DisplayOut(value 201 unchanged),M5UnitPoEP4HDMI→M5UnitPoEP4DisplayOut,M5UnitPoEP4HDMI.h→M5UnitPoEP4DisplayOut.h. The old names remain as deprecated aliases and the old header includes the new one, so existing sketches build with deprecation warnings.Tested
npm test,spec.js check.