Improve GC1109 FEM pin handling for Heltec v4 and Tracker v2#1249
Improve GC1109 FEM pin handling for Heltec v4 and Tracker v2#1249weebl2000 wants to merge 6 commits intomeshcore-dev:devfrom
Conversation
7dcc916 to
d84784e
Compare
Yeah maybe, I haven't tested with a lot of antennas yet. There's definitely something funky going on with the PA/LNA and the RX gain though. |
d84784e to
dcfea36
Compare
It'
@fschrempf It gets more tricky. But I think we actually might just need to set |
|
Updated with latest finding. I have tested for limited time but RX is heaps better, so others please do test! |
bc5e4be to
044505d
Compare
|
I was asked to build the firmware, here you go for ble companion and repeater
realized heltec wireless tracker v2 uses same chip: |
The repeater is also a companion firmware:-( |
|
Oops let me check |
Try now. Same URL. |
Thank you! |
683ac76 to
2736011
Compare
|
For those running the observer uplink firmware, there is a version to test compiled with this fix: https://discord.com/channels/1343693475589263471/1417491962675593296/1452383493295439903 Running that here but don't see a significant difference yet. |
For observer firmware, if you never enable the TX path I would guess the LNA stays properly enabled and you wouldn't see much difference. If I kept TX low always I also saw great reception with the current firmware. Only after sending once would the RX deteriorate. |
Observers are repeater firmware with mqtt uplink. So they do use TX a lot. Will keep monitoring the effect on my repeater. |
Ah okay. Only easy way to test is having two devices next to each other or otherwise testing with nodes at the edge of your reach. |
The definition |
|
basically, there is no firmware fixed way |
Why not? |
|
because there is no way to turn off that LNA by command |
|
|
Hello all Just wanted to do a quick chime in on this issue. Two days ago I applied the fix from https://github.com/weebl2000/MeshCore/tree/semtech_patch ( whitch afaik integrates the semtech patch and the LNA patch ) and the reception on my V4 greatly improved. Sadly, all I can do for you now is to share this anecdotical truth as I have no hard data to back this up, but hopefully it helps. The long story with background. I went to update my clients from the heltec v3 to the v4. Using the stock firmware i noticed that on the spot i do usually charge the devices the v3 reports noise floor about -105 and the v4 about -70. I quicky read up upon this that the LNA does this and went with it. Then I discovered that there is a reception difference between the two devices side by side. The v3 gets all the messages and the v4 does not. This was strange because the mesh here is great and neither the v3 nor my other wismesh tag had any problems on the same spot but the v4 did. After some digging i found this PR and gave it a spin, after 2 days of testing i can say that the v3 and the v4 get the same messages and the v4 did not miss any. |
|
Thanks @tpp-at-idx so you compare messages at the samen location between v3 and v4. One or two days back @weebl2000 posted 3 releases with a clear file naming. Are you able to distinct the difference between the Semtech register patch and the LNA patch? By comparing these two, I.e not the running the combined build. My main concern is that heltec is supporting the register patch from Semtech but does not commit on the LNA functionality. If we want to get this merged into a real MC releases we need to try to get the difference of both clear. And file one correct PR probably only the Semtech register patch. |
|
@spiralshapeturtle Sure, i can try to do some simple A/B testing and see how it goes, but sadly, the files posted in #1249 (comment) do not work for me, my node ended up bootlooping. I went on to the repo i have already cloned from https://github.com/weebl2000/MeshCore/tree/semtech_patch and edited platformio.ini for the heltec v4 to comment out the SX126X_SEMTECH_PATCH variable, so that should leave me with the LNA patch only to try for a few days as per my inderstanding of the code. I will run this for a few days and report how it goes. After that i will have to figure out how to disable the LNA patch and leave the semtech patch as i do not see a simple straight way how to do it but that is a problem for another day;) That said, and please forgive my coding and embedded device inexperience from the limited knowledge i have and from the knowledge that @weebl2000 shared in this PR i have the assumption that the LNA patch is somewhat correct and the way to do the PA/LNA switching regardless wether it fixes the receive issue or not and should be implemented regardless ( but maybe in another PR ) |
💯 fully agree. |
I agree that the logic written by @weebl2000 makes sense. However, I would really appreciate it if Heltec, via @Quency-D, could provide a formal company statement confirming whether this code is technically correct and acceptable from Heltec’s perspective. Ideally, the code would be reviewed and validated by Heltec’s own developers, and if approved submitted as a PR with their written endorsement for merging by Wessel. Some testing is available above @Quency-D and below as requested here With the cavity in place, I find it difficult to measure real-world differences. I also assume, as @tpp-at-idx mentioned, that the main benefits are achieved in scenarios where no cavity is installed and the receiver is oversteered with strong signals. That may explain why @Quency-D is unable to test this properly due to being located in a non-urban area, but we could help from our urban area's. Nevertheless, Heltec should still be able to confirm the correctness and validity of the proposed LNA code enhancement. Take responsibility and reach out for the current V4 issues out in the field, and help us by getting this fix into the new MeshCore release in the near future. From my own observations, the results also appear positive in my setup @weebl2000 at least my SNR on the v4 is strong and stable with the cavity. I killed my RS232 myself so it stopped unfortunately without noticing, let's grab the lines logged. Things to conclude from the units, the V4 +cavity is decoding more packets at the same point of time. with the V4 with turtle_3_semtech+rxfix.bin its running very well. Im just seeking for the guidance of Heltec in this matter. T114 McGill 9dBi antenna (30 cm lower mounted than the RAK) SNR to compare from the same Adverts Shall I run it without cavity, would that help? My first plan was to run it with the LNA fix only the next 24hours. |
I ran same test configuration as before again with the PR builds - both with and without the register patch by @weebl2000 (register value 1). This confirmed again that PR without register patch is not different from the existing v1.11.0 firmware in terms of RX reception. I then reviewed again the code changes in this PR against v1.11.0 and I found there's a significant discrepancy between the code change itself and the PR summary at the top:
I now created a new PR #1398 that only includes the register patch and no RX boosted gain in case others want to test as well. Test Sample:
|
We have been testing and verifying the modified register version. We have also arranged tests to assess the effects of modifying the GC1109 control pins, which are currently underway and may take some time. |
Thanks for the update good to hear that Heltec is actively testing and validating the modified register approach. For clarity, I want to restate the terminology used in this PR, as multiple mechanisms are being discussed: Semtech register patch LNA pin enhancement RX boosted gain While I appreciate that Heltec is still evaluating the GC1109 control-pin behavior, I do have some reservations about relying on the LNA pin enhancement as a final solution. Given Heltec’s reputation as a technically strong and fast-moving hardware vendor, the fact that the register-level fix is already being validated suggests this is likely the intended and more robust approach, with pin-level changes remaining secondary until proven otherwise |
|
Hello guys Stock firmware: Reference: 296 messages, V4 received: 284, loss: 4 % |
Where did you find the "Semtech only patch"? |
|
Seems like the links to the compiled firmwares aren't working... maybe you could host them on an alternate mirror? Thanks! Looking forward to trying this out. |
I can do that later this evening. If you can't access it you are most likely blocking Tor networks (unifi does this, you can untick it somewhere in settings, darkweb filter or something). The machine it runs on is also a Tor node (non-exit fyi). |
|
Soo, i noticed that #1398 was merged into dev today.. |
As I mentioned here #1249 (comment) before opening PR # 1398, the actual code changes in this PR do not align with the PR summary at the top. |
The root cause was that RadioLib didn't know about the external GC1109 RF switch. Without the SX126X_RXEN/TXEN definitions, RadioLib never called setRfSwitchPins(), so it couldn't automatically manage PA_TX_EN during RX/TX transitions.
Set pinmode output/input too to make sure
df0464c to
6f6e75f
Compare
|
Superseded by #1600 — stripped down to just the PA_POWER deep sleep fix. |












Improves the GC1109 FEM pin management for Heltec v4 and Heltec Tracker v2. These are correctness and robustness improvements to how GPIO46 (CPS strapping pin) and deep sleep pins are handled - not a fix for the core TX/RX switching which was already working correctly via DIO2.
Changes
GPIO46 (CPS) strapping pin handling
GPIO46 is an ESP32-S3 strapping pin. Previously it was configured as OUTPUT at boot and left that way permanently. Now:
pinMode(OUTPUT)then drives HIGH (full PA mode)pinMode(INPUT)This avoids holding a strapping pin as OUTPUT when it's not needed (CPS is "don't care" during RX per the GC1109 datasheet).
Deep sleep pin management
PA_POWER(VFEM LDO) during sleep in addition toPA_EN(CSD), so the GC1109 remains powered for RX wake capabilityPA_POWERandPA_ENon deep sleep wakeOther
PIN_BOARD_SDA/PIN_BOARD_SCLto the base[Heltec_lora32_v4]sectionGC1109 Control Logic Reference
TX/RX path switching is handled automatically by SX1262 DIO2 → GC1109 CTX (
SX126X_DIO2_AS_RF_SWITCH=true). This was already the case before this PR.