Skip to content

Add initial support for M5Stack Cardputer ADV with Cap LoRa-1262#2457

Open
kucharz96 wants to merge 50 commits intomeshcore-dev:devfrom
kucharz96:main
Open

Add initial support for M5Stack Cardputer ADV with Cap LoRa-1262#2457
kucharz96 wants to merge 50 commits intomeshcore-dev:devfrom
kucharz96:main

Conversation

@kucharz96
Copy link
Copy Markdown

Summary

This pull request adds initial support for M5Stack Cardputer ADV used with M5Stack Cap LoRa-1262.

The goal of this PR is to upstream a minimal, reviewable hardware bring-up path for this device combination, without changing MeshCore protocol behavior, routing, BLE logic, or UI behavior.

What this PR changes

This PR introduces two focused hardware-related adjustments for the Cardputer ADV LoRa path:

  1. LoRa cap IO expander / RF path initialization

    • updates the 0x43 IO expander setup so that only the required output is enabled
    • avoids driving the entire expander bank high during startup
    • leaves TX/RX RF switching to the SX1262 DIO2 RF switch control path
  2. SX1262 PA configuration after successful radio initialization

    • applies PA configuration only after std_init() completes successfully
    • aligns the radio bring-up more closely with real hardware behavior observed during Cardputer ADV testing

Motivation

At the time of opening this PR, the official MeshCore tree does not provide dedicated support for M5Stack Cardputer ADV.

During real-device bring-up and testing with Cardputer ADV + Cap LoRa-1262, the radio could initialize and operate, but RF behavior was not as consistent as expected compared with hardware-specific builds tested on the same platform.

The most likely cause appeared to be in the low-level hardware bring-up path for the LoRa cap, especially around expander-based initialization and RF control, rather than in MeshCore application logic.

Scope

This PR is intentionally narrow in scope.

It does not include:

  • protocol changes
  • routing changes
  • BLE changes
  • UI changes
  • experimental AGC tuning
  • broader refactoring of other board variants

The intent is to keep the first upstream Cardputer ADV submission small and easy to review.

Files changed

  • variants/m5stack_cardputer/M5CardputerBoard.h
  • variants/m5stack_cardputer/target.cpp

Hardware used for testing

  • M5Stack Cardputer ADV
  • M5Stack Cap LoRa-1262
  • SX1262-based LoRa path

Notes for review

This should be considered initial support rather than a final, fully validated implementation.

Feedback would be especially appreciated on:

  • whether the IO expander initialization matches expectations for Cap LoRa-1262 hardware
  • whether the PA configuration is appropriate for upstream inclusion as-is
  • whether Cardputer ADV support should continue under the current m5stack_cardputer variant path or be split into more explicit ADV-specific handling

Closing

The main purpose of this PR is to start upstream support for M5Stack Cardputer ADV and open the discussion with maintainers using a small, hardware-focused patch set.

Thanks for reviewing.

kucharz96 and others added 30 commits April 23, 2026 22:51
WIP: Restore Cardputer ADV port on ui-new base
@kucharz96
Copy link
Copy Markdown
Author

Closes #2458

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.

6 participants