Station G3: Detect LNA_P and PA-PL1 hardware jumper states before driving FEM GPIOs
Mantenedores costumam responder em até 2 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 53/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- c
- Domínio
- embedded-iot
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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
- Linguagem predominante
- C
- Estrelas
- 3.9k
- Forks
- 1.5k
- Merge médio
- 2d 19h
- PRs com merge (30d)
- 61
Preparar o ambiente
Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de meshcore-dev/MeshCore
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
meshcore-dev/MeshCore#4015 ·
Mantenedores costumam responder em até 2 dias
-
CMD_SET_DEFAULT_FLOOD_SCOPE leaves an older, longer name's tail after the new nameTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
meshcore-dev/MeshCore#3891 · 1 comentário ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 64/100
meshcore-dev/MeshCore#3826 ·
Mantenedores costumam responder em até 2 dias
-
App Preset Australia: NTAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
meshcore-dev/MeshCore#3825 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
meshcore-dev/MeshCore#3781 ·
Mantenedores costumam responder em até 2 dias
Todas as issues de meshcore-dev/MeshCore
Issues semelhantes
-
CF_CFDP_S_SendFileData computes the file checksum from the SB buffer after CFE_SB_TransmitBufferAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
-
needs triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
389ds/389-ds-base#8251 ·
Mantenedores costumam responder em até 1 dia
-
bug data-types
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
ClickHouse/clickhouse-cpp#645 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
ROCm/hrx-system#3628 ·
Mantenedores costumam responder em até 1 dia