Hold GC1109 PA_POWER during deep sleep for LNA RX wake#1600
Hold GC1109 PA_POWER during deep sleep for LNA RX wake#1600weebl2000 wants to merge 1 commit intomeshcore-dev:devfrom
Conversation
6b2d2c5 to
624b40e
Compare
|
Nice, hope this fix will get merged soon for cases when powersave is enabled. Awesome. |
|
@weebl2000 Thank you for replacing the original PR with this one. It is much simpler and straightforward code, and easy to see what exactly it's doing. |
|
I finally got the meshcore build env working. Dont know how to enable powersaving mode on the companion but I'm drawing ~0.74 watts (.143 amps at 5.15V) with the screen off where on the 1.11 ver I was previously running just under .6 watts in idle mode. Maybe this is because the LNA is now staying powered on while the esp32 is in idle or light sleep? Edit. If I disconnect from bluetooth and reconnect the watttage drops back down under .6 watts for a like ~30 seconds but then jumps back up to .74 watts and never comes back down. |
624b40e to
08880bf
Compare
|
@Socalix I think the current order is correct. The key distinction here is between the GPIO peripheral registers and the pad hold logic. digitalWrite() updates the GPIO output registers unconditionally — even while the pad is held. The hold only freezes the pad, not the register state. When rtc_gpio_hold_dis() is called, the pad immediately reflects whatever level is already programmed in the GPIO registers. This is why the ESP-IDF docs for gpio_hold_dis() state: “If you don't want the level changes, the gpio should be configured to a known state before this function is called.” That instruction only makes sense if register writes are expected to occur while the pad is held. With the current order: Configure GPIO output HIGH (register updated, pad still held HIGH) Release hold → pad transitions from held-HIGH to register-HIGH (no glitch) Reversing the order would cause the pad to briefly revert to its default state on hold release, which would momentarily remove power from the GC1109 FEM. So the existing order is intentional and avoids a power glitch during wake from deep sleep.
https://docs.espressif.com/projects/esp-idf/en/stable/esp32s3/api-reference/peripherals/gpio.html
|
|
@weebl2000 adding this as a comment to the code might be valuable so it does not get changed in the future because "it looks wrong" |
The GC1109 FEM needs its VFEM_Ctrl pin held HIGH during deep sleep to keep the LNA active, enabling proper RX sensitivity for wake-on-packet. Without this, the LNA is unpowered during sleep and RX wake sensitivity is degraded by ~17dB. Release RTC holds in begin() after configuring GPIO registers (not before) to ensure glitch-free pin transitions on wake. Trade-off: ~6.5mA additional sleep current for significantly improved wake-on-packet range.
08880bf to
eb1aa2f
Compare
done |
I haven't tried it myself yet with the companion. It might be difficult to test if you're receiving messages all the time btw. Unless you have a faraday cage. 😋 |

Summary
Without this, the GC1109 LNA could be unpowered during sleep, degrading RX wake sensitivity by ~17dB.
Trade-off: ~6.5mA additional deep sleep current for significantly improved wake-on-packet range.
Test plan
Supersedes #1249