Skip to content

Fix M5Stack Unit C6L: correct pin config and add IO expander support#1884

Open
TheRealHaoLiu wants to merge 1 commit intomeshcore-dev:mainfrom
TheRealHaoLiu:fix-m5stack-unit-c6l
Open

Fix M5Stack Unit C6L: correct pin config and add IO expander support#1884
TheRealHaoLiu wants to merge 1 commit intomeshcore-dev:mainfrom
TheRealHaoLiu:fix-m5stack-unit-c6l

Conversation

@TheRealHaoLiu
Copy link

@TheRealHaoLiu TheRealHaoLiu commented Mar 1, 2026

Summary

Fixes several incorrect hardware configurations in the M5Stack Unit C6L variant introduced in #1578. All corrections verified against the Meshtastic official variant and tested on actual hardware.

  • I2C pins: SDA=10, SCL=8 (was SDA=16, SCL=17)
  • TCXO voltage: 3.0V (was 1.8V)
  • TX indicator: NeoPixel on GPIO 2 (was P_LORA_TX_LED=15)
  • Remove SX126X_RXEN=5: LNA enable is on PI4IO I2C expander P5, not a direct GPIO
  • Add USB CDC: Required for serial over USB on ESP32-C6
  • Add PI4IO I2C GPIO expander (addr 0x43): Controls LoRa reset (P7), LNA enable (P5), RF switch (P6), and button (P0)
  • Fix ESP32-C6 BLE build: Add missing #include <esp_mac.h> for esp_efuse_mac_get_default()

Note: This PR contains only the hardware fixes. #1885 is a superset that includes these fixes plus display support and OTA switching. Merge one or the other, not both.

Test plan

  • Repeater build compiles
  • Companion BLE build compiles
  • Tested on actual M5Stack Unit C6L hardware
  • Verified pin configuration matches Meshtastic reference variant

🤖 Generated with Claude Code

…support

The initial C6L port (meshcore-dev#1578) had several incorrect hardware configurations.
Fixes verified against the Meshtastic variant (meshtastic/firmware variants/
esp32c6/m5stack_unitc6l/variant.h) and tested on actual hardware.

Pin corrections:
- I2C: SDA=10, SCL=8 (was SDA=16, SCL=17)
- TCXO voltage: 3.0V (was 1.8V)
- TX indicator: NeoPixel on GPIO 2 (was P_LORA_TX_LED=15)
- Remove SX126X_RXEN=5 (LNA enable is on PI4IO expander P5, not GPIO 5)
- Add ARDUINO_USB_CDC_ON_BOOT and ARDUINO_USB_MODE for USB serial

Add PI4IO I2C GPIO expander support (addr 0x43):
- P0: Button input (active low)
- P5: LNA Enable output
- P6: RF Switch output
- P7: LoRa Reset output
- Proper initialization sequence for RF control

Fix ESP32-C6 BLE companion build:
- Add missing #include <esp_mac.h> for esp_efuse_mac_get_default()

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant