External Coexistence Design en
External Coexistence Design en
External Coexistence Design en
(Application Note)
Related Products
All ESP chip series, except ESP8266 and ESP32 series
Version 1.1
Espressif Systems
Copyright © 2022
www.espressif.com
About This Document
This document provides information about 1-wire, 2-wire, and 3-wire Wi-Fi coexistence
schemes for Espressif customers when configuring devices equipped with ESP Wi-Fi
SoCs (including all ESP chip series except ESP8266 and ESP32 series).
Release notes
Certification
Download certificates for Espressif products from
https://www.espressif.com/en/certificates.
Table of Contents
1. Introduction ................................................................................................................................... 1
2. Architecture Design ...................................................................................................................... 2
2.1. Mapping of Coexistence Modes and PTA (Packet Traffic Arbitration) Signals ..................... 2
2.1.1. 1-wire mode ........................................................................................................... 2
2.1.2. 2-wire mode ........................................................................................................... 3
2.1.3. 3-wire mode ........................................................................................................... 3
2.1.4. Coexistence Signaling Timing Information .............................................................. 4
2.2. Coexistence PTA (Packet Traffic Arbitration) Flow .............................................................. 5
2.3. Wi-Fi Key Packets ............................................................................................................... 6
3. Design Implementation................................................................................................................. 7
3.1. Software interfaces in ESP-IDF............................................................................................ 7
4. Q&A .............................................................................................................................................. 9
Appendix A. Terminology ........................................................................................................ 10
Chapter 1. Introduction
1. Introduction
In the 2.4 GHz ISM band, the availability of channels is regulated per country. There are
mainly three communication protocols worldwide: Bluetooth® (BLE & BT), 15.4
(Zigbee & Thread), and Wi-Fi.
Nowadays, more and more Espressif’s Wi-Fi SoCs share the 2.4 GHz frequency band
with other devices, such as BLE, BT, and Zigbee. In this case, Espressif implemented a
hardware interface and protocol to arbitrate and notify Peer devices whether there is
interference with its normal transmitting and receiving of packets. The protocol is
available for ESP32-S2 and the following series of SoCs (ESP Wi-Fi).
To implement the protocol, it is necessary to adopt a reasonable external coexistence
priority policy and determine the timing duration of key packets, to ensure proper
operation of ESP Wi-Fi and to limit the interference with the interaction behavior of Peer
devices.
Implementation of coexistence of Peer devices using different communication protocol
specifications is similar to implementation on a single dual-mode, dual-baseband SoC.
In other words, two sets of RF modules and baseband modules can receive packets of
different protocols in the 2.4 GHz ISM simultaneously. So, there will be less interference
compared with the coexistence of single-mode SoC.
If separate devices are used, there are two design differences from internal
coexistence.
• Internal interface needs to be called to check if the current Wi-Fi channel
conflicts with the communication channel of the Peer device, and decide
whether to enable the function of external coexistence.
• Since there are two sets of basebands, Wi-Fi sleep mode is optional and it is
possible that both devices transmit packets at the same time. Then it is
necessary to configure the internal coexistence timer to set the PTI (Packet
Type Identifier) of the 2.4 GHz band coexistence to achieve the function of
arbitrating and transmitting packets with the Peer device.
2. Architecture Design
Currently Espressif offers three coexistence modes with Peer devices: 1-wire, 2-wire
and 3-wire. For detailed description of these three modes, please refer to the table
below.
Table 2-1. Three Coexistence Modes
request Hardware
Peer device coexistence ESP
arbitrator Wi-Fi
module
In 1-wire mode, Peer device transmits a request signal to ESP Wi-Fi, where Peer device
triggers request whenever it needs the 2.4 GHz ISM band and expects ESP Wi-Fi to
always yield. This mode works very well for the Peer device, but high priority ESP Wi-Fi
traffic can be compromised which impacts ESP Wi-Fi performance.
Since PTI level for 1-wire mode is always high level, arbitration results are not required
after Peer device triggers a request.
request
Hardware
Peer device coexistence ESP
grant arbitrator Wi-Fi
module
In 2-wire mode, the request is extended with the grant signal, allowing the Peer device
to request the 2.4 GHz ISM band. The arbitration results are received through grant
signal.
The ESP Wi-Fi internally controls the prioritization with the Peer device, and on a
conflict, the Hardware coexistence arbitrator module can analyze which device (Peer
device or ESP Wi-Fi) is permitted to access to the ISM band.
request
Hardware
priority coexistence ESP
Peer device arbitrator Wi-Fi
grant module
In 3-wire mode, the priority signal is added, allowing the Peer device to signify a high or
middle level behavior being performed.
The table below shows how to set PTI level through controlling the level of request and
priority signals:
Table 2-2. Set PTI Level Through Request and Priority Signals
Note:
GPIO voltage is high when 3.3 V are supplied to the related GPIO pin.
The above figure shows that the ESP Wi-Fi compares this external priority request,
which may be Middle/High level, against the internal Wi-Fi priority and can choose to
grant access to ISM band to either Peer device or ESP Wi-Fi.
Note:
The test above is conducted with ESP32-S2 chip. The same result can be expected when the PTI
level is middle or high in 3-wire mode.
Wi-Fi Coexistence
Wi-Fi protocol 1 2
PHY
transmit/receive priority timer 4
stack
control control
5
Hardware
5 coexistence
arbitrator
module
5
Peer device GPIO
3 4 Wi-Fi chipset
2. Wi-Fi protocol stack uses the coexistence priority timer control in ESP Wi-Fi to set
proper PTI value based on specific scenario. The PTI value will be transferred to
corresponding PTI level automatically later.
3. The Peer device outputs either high or low level through a GPIO pin to select PTI
level and obtains arbitration results from ESP Wi-Fi by reading signal from another
GPIO pin. The number of GPIOs offered by ESP Wi-Fi to communicate with the Peer
device is in the range of one to three depending on the chosen mode.
4. ESP Wi-Fi internal hardware coexistence arbitration module compares internal PTI
level with the level obtained from the Peer device.
5. Arbitration results are provided to PHY and the GPIO at the same time. Based on
arbitration results, PHY will decide whether to transmit/receive packets and GPIO will
output high/low level to the Peer device. High level means that the Peer device can
transmit/receive packets, and low level means that ESP Wi-Fi can transmit/receive
packets.
3. Design Implementation
3.1. Software interfaces in ESP-IDF
When configuring for the coexistence feature, please make sure to use release/v4.3 or
newer release of ESP-IDF. The following screenshot shows how to configure external
hardware coexistence in menuconfig:
Notice:
• For specific scenario of Peer device, if users want to keep the duration time of PTI level, they can
set related GPIO pin high/low through their alarm/timer or other similar function unit.
• esp_disable_extern_coex_gpio_pin:
By calling on the function esp_err_t esp_disable_extern_coex_gpio_pin(),
users can clear the configured priority for external coexistence and disable all
configured pins.
4. Q&A
If there are any other questions regarding the software interaction between the Wi-Fi
device and the Peer device, please feel free to contact us.
Appendix A. Terminology
Table A-1. Terminology
Term Description
Coexistence priority timer Part of ESP Wi-Fi hardware which keeps PTI value for configurable
control duration time.
ESP Wi-Fi Espressif’s SoC (All chip series, except ESP8266 and ESP32
series).
Hardware coexistence Part of ESP Wi-Fi hardware. It compares the PTI value from Peer
arbitrator module device and Wi-Fi scenario module to select device to access the
ISM band.
Peer device The 2.4 GHz device that shares ISM band with ESP Wi-Fi and
communicates priority information through GPIO interface.
PTI value & PTI level The Packet Type Identifier value will be used as raw data for
hardware coexistence arbitrator module. PTI level is mapped to
corresponding PTI value.