Station G3: Detect LNA_P and PA-PL1 hardware jumper states before driving FEM GPIOs
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 53/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- c
- 領域
- embedded-iot
調査の方向性
Start with variants/station_g3_esp32/LoRaFEMControl.cpp and inspect init(), the FEM capability methods, and the mode and gain functions named in the issue. Then check StationG3Board::handleCommand() and powerOff() to trace how unsupported controls and GPIO holds are handled. The issue describes boot-time jumper probing and the expected unsupported responses; done means jumper-shorted pins remain inputs and their radio gain controls report unsupported.
索引モデルが issue の本文から書いたものです。
説明
Note: I do not use MeshCore myself—all of our testing was done with Meshtastic firmware (https://github.com/meshtastic/firmware/pull/12084) and was not tested on MeshCore, which is why I'm opening an issue rather than a PR. While cross-referencing your variants/station_g3_esp32/LoRaFEMControl.cpp implementation (#2515 / #3137), we tested hardware jumper detection on the Station G3 that may be useful here as well.
Background & Issue
On the Station G3 (BQ35LORA900V1M), software control of the primary slot LNA (P_PRIMARY_LNA_EN, GPIO 10) and PA Power Level 1 (P_PA1_EN, GPIO 9) is only possible when the physical LNA P and PA-PL1 jumpers on the baseboard are removed:
LNA P(GPIO 10): Active LOW (LOW/open = LNA ON,HIGH/short = LNA OFF). Installing the physical jumper shorts the lineHIGH(hardware-disabling the LNA).PA-PL1(GPIO 9): Active HIGH (LOW/open = low power level,HIGH/short = high power level). Installing the physical jumper shorts the lineHIGH(and the Station G3 ships withPA-PL1installed by default).
Currently in variants/station_g3_esp32/LoRaFEMControl.cpp:
LoRaFEMControl::init()unconditionally sets bothP_PA1_ENandP_PRIMARY_LNA_ENtoOUTPUTand drives them (LOWforP_PA1_ENwhenpa_gain_enabled = false, andLOWforP_PRIMARY_LNA_ENduring RX/sleep)—which drivesLOWdirectly against theHIGHjumper when a jumper is installed.canControlLNA()andcanControlPAGain()unconditionally returntruewhenever the pin macros are defined, soget/set radio.fem.rxgainandget/set radio.fem.txgainreportOKeven when a physical jumper is overriding the pin in hardware.
Suggested Fix (Hardware-Verified on Station G3 with Meshtastic)
In Meshtastic firmware, we tested probing the Station G3's jumper state at boot in init() using the ESP32-S3's internal pull-down (INPUT_PULLDOWN) before configuring the pin as an OUTPUT:
- With the jumper removed (open),
digitalRead()withINPUT_PULLDOWNreadsLOW(0,0 mV). - With the jumper installed (shorted),
digitalRead()withINPUT_PULLDOWNreadsHIGH(1).
In variants/station_g3_esp32/LoRaFEMControl.cpp, init() could check each pin before driving it:
#ifdef P_PA1_EN
rtc_gpio_hold_dis((gpio_num_t)P_PA1_EN);
pinMode(P_PA1_EN, INPUT_PULLDOWN);
delay(1);
if (digitalRead(P_PA1_EN) == LOW) {
pa_can_control = true;
pinMode(P_PA1_EN, OUTPUT);
applyPAGain();
}
#endif
#ifdef P_PRIMARY_LNA_EN
rtc_gpio_hold_dis((gpio_num_t)P_PRIMARY_LNA_EN);
pinMode(P_PRIMARY_LNA_EN, INPUT_PULLDOWN);
delay(1);
if (digitalRead(P_PRIMARY_LNA_EN) == LOW) {
lna_can_control = true;
pinMode(P_PRIMARY_LNA_EN, OUTPUT);
setRxModeEnable();
}
#endif
Then:
- Have
canControlLNA()returnlna_can_controlandcanControlPAGain()returnpa_can_control(which automatically makesStationG3Board::handleCommand()return"Error: unsupported"forget/set radio.fem.rxgainortxgainwhen the corresponding jumper is installed). - Guard the
digitalWrite()calls insetSleepModeEnable(),setTxModeEnable(),setRxModeEnable(),applyPAGain(), andrtc_gpio_hold_en()inStationG3Board::powerOff()withcanControlLNA()/canControlPAGain()so the MCU leaves jumper-shorted pins inINPUTmode.
Reference
- Meshtastic PR with hardware test results: https://github.com/meshtastic/firmware/pull/12084
- 主要言語
- C
- スター
- 3.9k
- フォーク
- 1.5k
- 平均マージ
- 2日 7時間
- マージ済み PR(30日)
- 56
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
meshcore-dev/MeshCore のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
meshcore-dev/MeshCore#4015 ·
メンテナーはふだん 2 日以内に返信
-
CMD_SET_DEFAULT_FLOOD_SCOPE leaves an older, longer name's tail after the new name対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
meshcore-dev/MeshCore#3891 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
meshcore-dev/MeshCore#3826 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
meshcore-dev/MeshCore#3825 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
meshcore-dev/MeshCore#3781 ·
メンテナーはふだん 2 日以内に返信
meshcore-dev/MeshCore の issue をすべて見る
似ている issue
-
CF_CFDP_S_SendFileData computes the file checksum from the SB buffer after CFE_SB_TransmitBufferオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
389ds/389-ds-base#8251 ·
メンテナーはふだん 1 日以内に返信
-
bug data-types
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
ClickHouse/clickhouse-cpp#645 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
ROCm/hrx-system#3628 ·
メンテナーはふだん 1 日以内に返信