Skip to content

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

Open
kucharz96 wants to merge 40 commits intomeshcore-dev:mainfrom
kucharz96:main
Open

Add initial support for M5Stack Cardputer ADV with Cap LoRa-1262#2390
kucharz96 wants to merge 40 commits intomeshcore-dev:mainfrom
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.

WIP: Restore Cardputer ADV port on ui-new base
@kucharz96
Copy link
Copy Markdown
Author

Update summary

I have pushed an additional Cardputer ADV-focused update on top of the initial port.

Main changes included in this update

  • Added a Cardputer RF diagnostics overlay showing:

    • Link score
    • RX/min
    • last SNR/RSSI
    • averaged SNR/RSSI
    • battery voltage
    • last RX age
  • Added keyboard navigation support for the Cardputer keyboard:

    • left arrow key / , for previous
    • right arrow key / / for next
    • Enter for select/confirm
    • keyboard input also wakes the display through the existing UI flow
  • Added a Cardputer-specific RF stability wrapper around the SX1262 driver:

    • keeps RX boosted gain enabled
    • reasserts boosted RX after TX/RX transitions
    • adds a bounded TX quiet-window check before transmit
    • adds RX capture guard after fresh RX events
    • adds a conservative RX watchdog after long receive silence
  • Kept the radio preset and protocol unchanged:

    • no SF/BW/CR changes
    • no packet format changes
    • no routing/ACK/flood protocol changes
    • no compatibility-breaking changes with existing MeshCore Narrow users

Goal

The goal of these changes is to improve practical handheld usability on the M5Stack Cardputer ADV with LoRa Cap, especially around diagnostics, menu control, receive stability, and recovery after TX/RX state transitions, while keeping the implementation isolated to the Cardputer target.

This is intentionally not a protocol-level change. It should remain compatible with existing MeshCore nodes and repeaters using the same Narrow preset.

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