1| Supported Targets | ESP32 | ESP32-C3 |
2| ----------------- | ----- | -------- |
3
4# ESP-IDF BLE throughput GATT SERVER Test
5
6This is the demo used to test the BLE throughput, this demo should used with throughput client demo together.
7The throughput of BLE can up to 720-767 Kbps between to ESP32 board.
8
9## How to Use Example
10
11Before project configuration and build, be sure to set the correct chip target using:
12
13```bash
14idf.py set-target <chip_name>
15```
16To configure the project, you can follow these steps:
17
181. In order to maximize throughput, we need to set the uart print baud rate at `921600` or more:
19Go to: `idf.py menuconfig --> Component config --> ESP32-specific --> UART console baud rate` and set to `921600` or `1500000` and don't print too much log.
202. We can only test notify or write throughput at the same time, this demo default to test the notify throughput, if want to test the write throughput,
21please set: `idf.py menuconfig --> Component config --> Example 'GATT CLIENT THROUGHPUT' Config  --->` then select the `test the gattc write throughput` option.
223. This demo only test unidirectional throughput, if you want to test the bidirectional throughput please change the demo by yourself.
234. Should change the CPU frequency to 160 MHz or 240 MHz in the `idf.py menuconfig`  and `Component config  ---> ESP32-specific  ---> CPU frequency (240 MHz or 160 MHz)`.
245. Should change the bluetooth controller and Bluedroid run in different Core in the `idf.py menuconfig` on `Component config  ---> Bluetooth  ---> The cpu core which bluetooth controller run (Core 0 (PRO CPU))` and `Bluedroid Enable  ---> The cpu core which Bluedroid run (Core 1 (APP CPU))`.
256. In order to maximize throughput, please test in a clean environment without many BLE devices working and both test devices are ESP32.
26
27### Hardware Required
28
29* A development board with ESP32/ESP32-C3 SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.)
30* A USB cable for Power supply and programming
31
32See [Development Boards](https://www.espressif.com/en/products/devkits) for more information about it.
33
34### Build and Flash
35
36Run `idf.py -p PORT flash monitor` to build, flash and monitor the project.
37
38(To exit the serial monitor, type ``Ctrl-]``.)
39
40See the [Getting Started Guide](https://idf.espressif.com/) for full steps to configure and use ESP-IDF to build projects.
41
42## Example Output
43
44```
45I (0) cpu_start: Starting scheduler on APP CPU.
46I (498) BTDM_INIT: BT controller compile version [d03a5d3]
47I (498) system_api: Base MAC address is not set
48I (498) system_api: read default base MAC address from EFUSE
49I (508) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07
50I (918) GATTS_DEMO: REGISTER_APP_EVT, status 0, app_id 0
51
52W (918) BT_BTM: BTM_BleWriteAdvData, Partial data write into ADV
53W (918) BT_BTM: BTM_BleWriteScanRsp, Partial data write into ADV
54I (928) GATTS_DEMO: CREATE_SERVICE_EVT, status 0,  service_handle 40
55
56I (948) GATTS_DEMO: SERVICE_START_EVT, status 0, service_handle 40
57
58I (948) GATTS_DEMO: ADD_CHAR_EVT, status 0,  attr_handle 42, service_handle 40
59
60I (948) GATTS_DEMO: the gatts demo char length = 3
61
62I (958) GATTS_DEMO: prf_char[0] =11
63
64I (958) GATTS_DEMO: prf_char[1] =22
65
66I (968) GATTS_DEMO: prf_char[2] =33
67
68I (968) GATTS_DEMO: ADD_DESCR_EVT, status 0, attr_handle 43, service_handle 40
69
70I (6258) GATTS_DEMO: ESP_GATTS_CONNECT_EVT, conn_id 0, remote ac:67:b2:6d:4e:22:
71I (7538) GATTS_DEMO: ESP_GATTS_MTU_EVT, MTU 517
72I (7698) GATTS_DEMO: GATT_WRITE_EVT, conn_id 0, trans_id 2, handle 43
73I (7698) GATTS_DEMO: GATT_WRITE_EVT, value len 2, value :
74I (7698) GATTS_DEMO: 01 00
75I (7698) GATTS_DEMO: notify enable
76I (7708) GATTS_DEMO: ESP_GATTS_CONF_EVT, status 0
77I (7718) GATTS_DEMO: ESP_GATTS_CONF_EVT, status 0
78I (7718) GATTS_DEMO: ESP_GATTS_CONF_EVT, status 0
79I (7728) GATTS_DEMO: ESP_GATTS_CONF_EVT, status 0
80I (7728) GATTS_DEMO: ESP_GATTS_CONF_EVT, status 0
81I (7738) GATTS_DEMO: ESP_GATTS_CONF_EVT, status 0
82I (7738) GATTS_DEMO: ESP_GATTS_CONF_EVT, status 0
83I (7748) GATTS_DEMO: ESP_GATTS_CONF_EVT, status 0
84I (7748) GATTS_DEMO: ESP_GATTS_CONF_EVT, status 0
85I (7758) GATTS_DEMO: ESP_GATTS_CONF_EVT, status 0
86...
87```
88
89## Troubleshooting
90
91For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon.
92