esp_coex: How to observe real-time RF activity per protocol (WiFi, BLE, 802.15.4) on GPIO pins? (IDFGH-18289)
Question
On ESP32-C6, which has WiFi, BLE, and 802.15.4 (Zigbee) sharing a coexistence arbiter, I need to observe real-time RF activity per protocol on GPIO pins using a logic analyzer. The goal is to see exactly when each protocol is actively using the radio, to debug coexistence timing issues.
I enabled CONFIG_ESP_COEX_GPIO_DEBUG with CONFIG_ESP_COEX_GPIO_DEBUG_DIAG_GENERAL and 4 GPIO pins. The diagram_bind_io_to_evt() in coexist_debug_diagram.c creates these bindings:
// DIAG_GENERAL, non-ESP32 path:
coex_bind_io_to_evt(0, 0); // IO idx 0 → coex event 0
coex_bind_io_to_evt(1, 4); // IO idx 1 → coex event 4
wifi_bind_io_to_evt(2, 9); // IO idx 2 → wifi event 9
wifi_bind_io_to_evt(3, 10); // IO idx 3 → wifi event 10My questions:
What do these event numbers mean? Coex events 0, 4 and WiFi events 9, 10 are not documented. What radio/arbitration state does each represent?
Where is 802.15.4? There are no bindings for 802.15.4 (Zigbee/Thread) RF activity in
DIAG_GENERALmode. How can I observe when the 802.15.4 radio is actively transmitting or receiving?Can WiFi and BLE be distinguished? Since WiFi and BLE share the same 2.4 GHz radio on ESP32-C6, is there a way to tell them apart in the GPIO debug output, or are they combined into the same WiFi events?
Is there an alternative approach? For example, routing
MODEM_DIAGhardware signals (fromgpio_sig_map.h) directly to GPIOs viaesp_rom_gpio_connect_out_signal()— is there a documented mapping ofMODEM_DIAG0..31signal indices to specific radio activities (WiFi TX, BLE TX, 802.15.4 TX, etc.)?
Environment
- Chip: ESP32-C6
- ESP-IDF version: v5.5.4
- Use case: WiFi + Zigbee (802.15.4) coexistence debugging on a product device with a single antenna
Source: espressif/esp-idf