Skip to content

Commit e8f76bb

Browse files
committed
Fix(c2_bt): FG: Update doc for uart setup
Change C2 pins so that devkit can be easily used.
1 parent 98762ff commit e8f76bb

File tree

3 files changed

+23
-20
lines changed

3 files changed

+23
-20
lines changed

esp_hosted_fg/docs/Linux_based_host/UART_setup.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
| Supported Chipsets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-S3 | ESP32-C6 | ESP32-C5 | ESP32-S2 |
44
| ------------------ | :---: | :------: | :------: | :------: | :------: | :------: | :------: |
5-
| 4 line UART | Y | N | Y | Y | N | N | Y |
6-
| 2 line UART | N | Y | N | N | Y | Y | N |
5+
| 4 line UART | T | NT | T | T | NT | NT | T |
6+
| 2 line UART | NT | T | NT | NT | T | T | NT |
77

8-
Y - **Tested**, N - **Not Tested**
8+
T - **Tested**, NT - **Not Tested**
99

1010
In this section, ESP chipset provides a way to run Bluetooth/BLE over UART interface.
1111
Please connect ESP peripheral to Raspberry-Pi with jumper cables (preferably PCB) as mentioned below.
@@ -28,6 +28,12 @@ Raspberry-Pi pinout can be found [here!](https://pinout.xyz/pinout/uart)
2828

2929
#### Four Line UART setup
3030

31+
> [!NOTE]
32+
>
33+
> For UART protocol
34+
> - Host TX is to be connected to slave RX & vice versa.
35+
> - Host CTS is to be connected to slave RTS & vice versa.
36+
3137
| Raspberry-Pi Pin Function | Raspberry-Pi Pin | ESP32 | ESP32-S3 | ESP32-C3 | ESP32 Pin Function |
3238
|:-------:|:--------:|:---------:|:--------:|:--------:|:--------:|
3339
| RX | 10 | IO5 | IO17 | IO5 | TX |
@@ -41,15 +47,21 @@ Sample SPI+UART setup image looks like:
4147

4248
#### Two Line UART setup
4349

50+
> [!NOTE]
51+
>
52+
> For UART protocol, Host TX is connected to slave RX & vice versa.
4453
4554
| Raspberry-Pi Pin Function | Raspberry-Pi Pin | ESP32-C2 | ESP32-C5 | ESP32-C6 | ESP Function |
4655
|:-------:|:--------:|:---------:|:--------:|:--------:|:--------:|
47-
| TX | 8 | IO5 | IO5 | IO5 | TX |
48-
| RX | 10 | IO18 | IO23 | IO12 | RX |
49-
50-
Note:
51-
- ESP32-C2 only
52-
- Although, `HCI with UART` is supported on `ESP32-C2`, `Wi-Fi + Bluetooth` (together) when used with `SPI+UART` setup, Bluetooth on UART works fine but Wi-Fi on SPI faces low throughput problem. By the time this is rectified, please use 'SPI only' i.e. `HCI over SPI` and `Wi-Fi over SPI` transport combination. In `SPI only` setup, there is no such limitation.
56+
| RX | 10 | IO5 | IO5 | IO5 | TX |
57+
| TX | 8 | IO1 | IO23 | IO12 | RX |
58+
59+
> [ !CAUTION ]
60+
> - ESP32-C2 only
61+
> - ESP32-C2 has much less IRAM, without PSRAM support.
62+
> - With `SPI+UART` mode, i.e. Wi-Fi on SPI & BLE over UART mode, Wi-Fi on SPI faces low throughput problem when uart is loaded.
63+
> - With `SPI only` mode, i.e. Wi-Fi & BLE, both, running over SPI, both, Wi-Fi and Bluetooth work smooth.
64+
> - Conclusion, For `ESP32-C2`, prefer using `SPI only` mode.
5365
5466

5567
### 1.2 Raspberry-Pi Software Setup

esp_hosted_fg/esp/esp_driver/network_adapter/main/slave_bt.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -413,9 +413,7 @@ static void init_uart_c2_c6_c5(void)
413413
{
414414
ESP_LOGD(TAG, "Set-up BLE for ESP32-C2/C6/C5");
415415

416-
#if defined(CONFIG_IDF_TARGET_ESP32C2)
417-
ESP_LOGI(TAG, "UART Pins: Tx:%u Rx:%u", BT_TX_PIN, BT_RX_PIN);
418-
#elif defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32C5)
416+
#if defined(CONFIG_IDF_TARGET_ESP32C2) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32C5)
419417
//ESP_ERROR_CHECK( uart_set_pin(BLUETOOTH_UART, BT_TX_PIN,
420418
// BT_RX_PIN, BT_RTS_PIN, BT_CTS_PIN) );
421419
ESP_LOGI(TAG, "UART Pins: Tx:%u Rx:%u", BT_TX_PIN, BT_RX_PIN);

esp_hosted_fg/esp/esp_driver/network_adapter/main/slave_bt.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,7 @@
8989
#define BT_RTS_PIN 19
9090
#define BT_CTS_PIN 23
9191

92-
#elif defined(CONFIG_IDF_TARGET_ESP32C2)
93-
94-
#define BT_TX_PIN 5
95-
#define BT_RX_PIN 18
96-
//#define BT_RTS_PIN 9
97-
//#define BT_CTS_PIN 8
98-
99-
#elif defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32C5)
92+
#elif defined(CONFIG_IDF_TARGET_ESP32C2) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32C5)
10093

10194
#define BT_TX_PIN CONFIG_BT_LE_HCI_UART_TX_PIN
10295
#define BT_RX_PIN CONFIG_BT_LE_HCI_UART_RX_PIN

0 commit comments

Comments
 (0)