-
Notifications
You must be signed in to change notification settings - Fork 8k
Open
Labels
Status: ReviewingIssue is being reviewedIssue is being reviewed
Description
Answers checklist.
- I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
- I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
- I have searched the issue tracker for a similar issue and not found a similar issue.
General issue report
Persistent ~2 mA Power Draw After BLE → Wi-Fi → BLE Cycle (ESP-IDF v5.3.1)
Summary
Cycling from an always-on BLE stack to Wi-Fi and back on ESP-IDF v5.3.1 yields an extra ~2 mA of light-sleep current compared to BLE-only operation. Full Wi-Fi teardown via esp_wifi_disconnect(), esp_wifi_stop(), and esp_wifi_deinit() does not recover the expected µA-level sleep current, indicating residual RF coexistence resources remain powered.
Environment
- ESP-IDF version: 5.3.1
- Power measurement tool: Nordic Power Profiler
- ** 32 Khz crystal and DFS and auto light sleep running at 80 MAX / 40 min
Reproduction Steps
- BLE baseline
- Enable BLE advertising (no Wi-Fi).
- Enter light-sleep → record baseline current.
- Wi-Fi cycle
- Initialize and connect Wi-Fi:
esp_wifi_init(&cfg); esp_wifi_set_mode(WIFI_MODE_STA); esp_wifi_start(); esp_wifi_connect();
- Fully tear down Wi-Fi:
esp_wifi_disconnect(); esp_wifi_stop(); esp_wifi_deinit();
- Initialize and connect Wi-Fi:
- Return to BLE
- Continue BLE advertising.
- Enter light-sleep → observe ~2 mA higher draw.
Expected Behavior
After full Wi-Fi deinitialization, BLE-only light-sleep current should return to the initial baseline (tens to hundreds of µA).
Actual Behavior
A persistent ~2 mA increase in light-sleep current remains after the BLE→Wi-Fi→BLE sequence.
Investigation & Findings
- Heap tracing uncovered ~19 KB of unfreed internal RAM in the RF coexistence adapter (
esp_coex_adapter), allocated on Wi-Fi init and never freed by public APIs. - Coexistence subsystem lacks a public deinit call; buffers remain resident even after
esp_wifi_deinit(). - Bluetooth always on means coexistence arbitration remains active, preventing full power-down of RF resources.
Metadata
Metadata
Assignees
Labels
Status: ReviewingIssue is being reviewedIssue is being reviewed