Skip to content

board_spec: correct the StamP4XHub signal A/B roles - #402

Open
TinyuZhao wants to merge 1 commit into
m5stack:developfrom
TinyuZhao:fix/stampp4xhub-grove-ab
Open

TinyuZhao wants to merge 1 commit into
m5stack:developfrom
TinyuZhao:fix/stampp4xhub-grove-ab

Conversation

@TinyuZhao

Copy link
Copy Markdown
Member

Problem

The board catalog for the StampP4X Hub has the two signals of Grove12, Grove13 and Grove14 swapped. The factory pinmap puts signal A on the lower GPIO of each connector:

Connector Signal A Signal B
Grove12 GPIO37 (UART0 TX) GPIO38 (UART0 RX)
Grove13 GPIO0 (SDA) GPIO1 (SCL)
Grove14 GPIO26 (USB1 D-) GPIO27 (USB1 D+)

The catalog had the two pins of each connector the other way round, while the per-pin note already stated the order the pinmap uses. Grove15 (GPIO3 / GPIO2) is correct and unchanged.

Changes

  • extras/board_spec/boards/m5stampp4xhub.json: swap the A/B pin of Grove12, Grove13 and Grove14, keeping each pin's signal role and note.
  • regenerate extras/board_spec/dist/board_spec_editor.html (node build/bundle.js).

Note

Grove13 is the one that matters in practice: it is the external I2C port on the system bus, so a module wired per the old catalog would be read with SDA and SCL swapped. Nothing in M5Unified depends on this; the catalog is the only wrong copy.

Verification

  • node cli/spec.js check → check passed: 63 board(s), 90 resolved combination(s)
  • npm test → 219 pass, 0 fail

The factory pinmap puts signal A on the lower GPIO of each connector:
Grove12 GPIO37 (A) / GPIO38 (B), Grove13 GPIO0 (A, SDA) / GPIO1 (B, SCL)
and Grove14 GPIO26 (A) / GPIO27 (B). The catalog had the two pins of each
connector the other way round; the note on each pin already stated the order
the pinmap uses.

Grove15 (GPIO3 / GPIO2) is correct and unchanged. Nothing in M5Unified
depends on this, the catalog is the only wrong copy.

Signed-off-by: tinyu <tinyu0806@gmail.com>
@ainyan03

ainyan03 commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Before merging, could you check the signal order on the connectors? We don't have the hardware here, so I can't tell from this side, but the result affects which way this change should go.

In the catalog, .1 / .2 are not signal A / B. They are terminals of hy2_4p, in physical order across the connector:

Terminal .1 .2 .3 .4
Wire white yellow red black
Power 5V GND
port_i2c SCL SDA
port_uart RX TX
port_io in out

So the signal next to 5V is .2. These are catalog terminals, not connector pin numbers: a schematic may number the same connector from the GND end.

Existing ports follow this order. Port B and Port C are usually on a base or module rather than on the core, so those are the products listed for them:

Product Port .1 .2 .3 .4
Core2 Port A G33 (SCL) G32 (SDA) 5V GND
CoreS3 Port A G1 (SCL) G2 (SDA) 5V GND
M5GO Bottom Port C G16 (RXD2) G17 (TXD2) 5V GND
Module ExtPort For Core2 Port C G13 G14 5V GND

The ExtPort documentation uses the same numbering for its switchable ports: PortD-1 (White) and PortD-2 (Yellow).

M5Unified uses the same order: port_c_rxd is pin 1 and port_c_txd is pin 2.

Could you confirm these on the actual connectors, going from GND towards the far end (GND, 5V, next, last)?

  1. Grove13: which of SDA (GPIO0) and SCL (GPIO1) is next to 5V?
  2. Grove12: which of UART0 TX (GPIO37) and RX (GPIO38) is next to 5V?
  3. Grove14: which of D+ and D- is next to 5V? Please check the current board wiring rather than the pinmap, since there is no existing port to compare it with.

If SDA and TX are next to 5V, Grove12 and Grove13 already match the existing boards, and swapping them would put them in the opposite order. In that case, the connectors where signal A is on .1 (Grove0-11 and Grove15) are worth checking instead.

If SCL and RX are next to 5V, this board differs from the existing ones, and I'd like to record that in the connector note as well.

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