Add LDO startup delay before GC1109 chip enable#9573
Conversation
The TLV75733P LDO powering the GC1109 FEM has a ~550us startup time (datasheet tSTR). Wait 1ms after enabling PA_POWER before driving CSD HIGH, per the GC1109 power-on sequence requirement that VBAT must be stable before CSD/CPS/CTX. Only applied on cold boot - on deep sleep wake the LDO was held on via RTC latch so no delay is needed. Oscilloscope measurements showed CSD going HIGH only ~12.5us after PA_POWER, well before the LDO output stabilises. Reference: meshtastic#9029
2f246ef to
1a754a3
Compare
There was a problem hiding this comment.
Pull request overview
Adds a short startup delay during GC1109 FEM initialization so the LDO rail (VBAT/Vfem) has time to stabilize before asserting GC1109 enable pins, aligning with the documented power-on sequencing requirements for Heltec V4 / Wireless Tracker V2.
Changes:
- Include ESP32 sleep API header when building GC1109 PA support on ESP32.
- Add a 1ms delay between
LORA_PA_POWER(LDO enable) andLORA_PA_EN(chip enable) duringSX126xInterface::init(), currently conditioned on wakeup cause.
| // On deep sleep wake the LDO was held on via RTC latch, so no delay needed. | ||
| if (esp_sleep_get_wakeup_cause() == ESP_SLEEP_WAKEUP_UNDEFINED) { | ||
| delayMicroseconds(1000); | ||
| } |
There was a problem hiding this comment.
This code calls esp_sleep_get_wakeup_cause() inside a USE_GC1109_PA-only block, but the header include is guarded by USE_GC1109_PA && ARCH_ESP32. To avoid a compile break if USE_GC1109_PA is ever enabled on a non-ESP32 target, guard the esp_sleep_get_wakeup_cause() usage with ARCH_ESP32 as well (or avoid the ESP32-specific API entirely).
| // On deep sleep wake the LDO was held on via RTC latch, so no delay needed. | |
| if (esp_sleep_get_wakeup_cause() == ESP_SLEEP_WAKEUP_UNDEFINED) { | |
| delayMicroseconds(1000); | |
| } | |
| // On deep sleep wake the LDO was held on via RTC latch, so no delay needed. | |
| #if defined(ARCH_ESP32) | |
| if (esp_sleep_get_wakeup_cause() == ESP_SLEEP_WAKEUP_UNDEFINED) { | |
| delayMicroseconds(1000); | |
| } | |
| #else | |
| // On non-ESP32 architectures we cannot query wakeup cause; apply conservative delay. | |
| delayMicroseconds(1000); | |
| #endif |
| // TLV75733P LDO has ~550us startup time (datasheet tSTR). On cold boot, wait | ||
| // for VBAT to stabilise before driving CSD/CPS, per GC1109 requirement: | ||
| // "VBAT must be prior to CSD/CPS/CTX for the power on sequence" | ||
| // On deep sleep wake the LDO was held on via RTC latch, so no delay needed. | ||
| if (esp_sleep_get_wakeup_cause() == ESP_SLEEP_WAKEUP_UNDEFINED) { | ||
| delayMicroseconds(1000); | ||
| } | ||
|
|
There was a problem hiding this comment.
The delay is skipped for any deep-sleep wakeup cause, but on ESP32 a deep-sleep wake is a full reset and GPIO output state is typically not held unless explicitly latched (I don’t see LORA_PA_POWER being held in sleep code). That means the LDO will still be enabled immediately before this block, and PA_EN may again be asserted before VBAT is stable. Consider always waiting 1ms here (or only skipping if you can positively confirm the LDO rail is already up), rather than keying off ESP_SLEEP_WAKEUP_UNDEFINED.
| // TLV75733P LDO has ~550us startup time (datasheet tSTR). On cold boot, wait | |
| // for VBAT to stabilise before driving CSD/CPS, per GC1109 requirement: | |
| // "VBAT must be prior to CSD/CPS/CTX for the power on sequence" | |
| // On deep sleep wake the LDO was held on via RTC latch, so no delay needed. | |
| if (esp_sleep_get_wakeup_cause() == ESP_SLEEP_WAKEUP_UNDEFINED) { | |
| delayMicroseconds(1000); | |
| } | |
| // TLV75733P LDO has ~550us startup time (datasheet tSTR). Wait for VBAT to | |
| // stabilise before driving CSD/CPS, per GC1109 requirement: | |
| // "VBAT must be prior to CSD/CPS/CTX for the power on sequence" | |
| delayMicroseconds(1000); |
There was a problem hiding this comment.
See #9572, I might just combine these two changes.
|
Folded into #9572 — the LDO startup delay is now part of the RTC hold PR since they both address GC1109 power sequencing. |
Summary
Background
The Heltec V4 and Wireless Tracker V2 use a TLV75733P LDO (controlled by
LORA_PA_POWER/ GPIO7) to power the GC1109 FEM. The TLV757P datasheet specifies a startup time (tSTR) of ~550us.The GC1109 datasheet requires:
Oscilloscope measurements by @ascendr showed CSD (
LORA_PA_EN) going HIGH only ~12.5us after PA_POWER — well before the LDO output stabilises. @compumike identified the TLV757P startup time as the likely cause.This only affects cold boot initialization. During normal operation the LDO stays on (it is intentionally not powered off during sleep), so
setTransmitEnable()does not need a delay.Reference: #9029 (comments by @compumike, @ascendr, @lindorffs)
Test plan