Add initial support for M5Stack Cardputer ADV with Cap LoRa-1262#2457
Add initial support for M5Stack Cardputer ADV with Cap LoRa-1262#2457kucharz96 wants to merge 50 commits intomeshcore-dev:devfrom
Conversation
WIP: Restore Cardputer ADV port on ui-new base
Cardputer UI new port
Cardputer rf diagnostics
Cardputer rf diagnostics
Removed links to outdated resources and links
Removed links to outdated resources and links
Update script link in FAQ 4.7 to the repo of the fork
…oard-support Add LilyGo T-ETH Elite SX1262 board support
|
Closes #2458 |
|
Hi. Your code uses wrong io expander init commands. |
|
Just popping in to add my little voice in support of adding Cardputer as a target. |
| -D HAS_GPS=1 | ||
| -D LORA_TX_POWER=22 | ||
| -D SX126X_DIO2_AS_RF_SWITCH=true | ||
| -D SX126X_CURRENT_LIMIT=240 |
There was a problem hiding this comment.
RadioLib's setCurrentLimit comment:
Sets current protection limit. Can be set in 2.5 mA steps.
Parameters
currentLimit current protection limit to be set in mA. Allowed values range from 0 to 140.
Why it's 240 here?
https://jgromes.github.io/RadioLib/class_s_x126x.html#a8f971dca834be7e0470a9a9f0c01854e
There was a problem hiding this comment.
Agreed,
According to This Datashet 140mA is the default setting, when the device is configured.
| -D SX126X_DIO2_AS_RF_SWITCH=true | ||
| -D SX126X_CURRENT_LIMIT=240 | ||
| -D SX126X_RX_BOOSTED_GAIN=1 | ||
| -D SX126X_DIO3_TCXO_VOLTAGE=3.3f |
There was a problem hiding this comment.
Official m5's example uses 3.0 TXCO voltate.
Is there an explanation for using 3.3V?
https://docs.m5stack.com/en/arduino/projects/cap/cap_lora868
There was a problem hiding this comment.
interesting,
the default for the 1262 in RadioLib appears to be 1.6V
according to This Datasheet the typical value is 1.7V
so both may be a little on the high side?
Reading around, seems the higher voltage just speeds up start-up time of the TCXO, allowing it to warm the crystal faster, getting it to operating temp faster.
There was a problem hiding this comment.

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:
LoRa cap IO expander / RF path initialization
0x43IO expander setup so that only the required output is enabledSX1262 PA configuration after successful radio initialization
std_init()completes successfullyMotivation
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:
The intent is to keep the first upstream Cardputer ADV submission small and easy to review.
Files changed
variants/m5stack_cardputer/M5CardputerBoard.hvariants/m5stack_cardputer/target.cppHardware used for testing
Notes for review
This should be considered initial support rather than a final, fully validated implementation.
Feedback would be especially appreciated on:
m5stack_cardputervariant path or be split into more explicit ADV-specific handlingClosing
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.