Esp32 Wifi Bluetooth Coexistence
Wi-Fi/Bluetooth coexistence is the scheduling problem created by putting two radios that both operate in the same 2.4 GHz ISM band on one die sharing one antenna, and it exists because Wi-Fi and Bluetooth can't physically transmit or receive at the same instant through a single RF front end — the coexistence arbiter's entire job is time-slicing access to that shared antenna so neither radio starves the other. A design that simply let Wi-Fi and Bluetooth each transmit whenever their own protocol stack wanted to would produce constant collisions, since both radios occupy overlapping frequency channels within the same band; coexistence logic exists specifically to arbitrate that shared RF resource in real time, at a timescale far faster than application software could ever manage.
Priority classification matters because not every radio event carries the same cost if it's delayed, and treating a BLE connection-event timeout the same as a Wi-Fi idle-scan window would protect the wrong thing at the wrong moment. A BLE connection event missing its scheduled slot too many times in a row can actually drop the Bluetooth link entirely, since BLE's own protocol has hard timing requirements for maintaining a connection; a Wi-Fi beacon reception delayed by a few milliseconds is comparatively low-stakes and easily recovered on the next beacon interval — real coexistence schemes classify requests by exactly this kind of real consequence, not just by which radio happens to be asking, so a BLE connection-critical event can preempt a lower-stakes Wi-Fi request even though Wi-Fi might otherwise be treated as the "primary" radio on the chip.
Coexistence runs partly in dedicated hardware logic and partly in firmware precisely because the hardest real-time deadlines are too fast for firmware to arbitrate, while the higher-level scheduling policy benefits from being changeable without a silicon respin. The lowest-level, microsecond-scale arbitration — literally granting or denying RF front-end access for a given slot — has to be hardware state machine logic running fast enough to meet BLE's hard timing, but the policy deciding which request classes get priority under which conditions is deliberately kept in firmware, so a field update can retune coexistence behavior for a new use case or fix a discovered edge case without requiring a new chip revision.
External coexistence signaling — dedicated pins that let this chip negotiate airtime with an entirely separate radio chip on the same board — exists for the product designs that pair this SoC with another wireless chip rather than relying solely on its own internal radios. Some products combine this chip's Wi-Fi/BLE with a separate cellular or Zigbee/Thread radio sharing the same 2.4 GHz-adjacent spectrum or physical antenna proximity, and in that case the internal arbiter alone can't resolve the conflict since it has no visibility into the other chip's scheduling — dedicated coexistence I/O pins exist specifically to let two separate radio chips negotiate shared airtime across a board-level connection, extending the same time-slicing principle beyond a single die's internal arbiter.
Wi-Fi/Bluetooth coexistence is the scheduling layer that makes "two radios on one antenna" a workable product claim rather than a marketing simplification papering over constant collisions: real-time hardware arbitration fast enough to protect BLE's hard connection timing, firmware-tunable priority policy that can adapt without a chip respin, and external signaling pins extending the same discipline to a second radio chip when the product needs one.