openthread border router: support c6 single chip br

pull/11189/head
Xu Si Yu 2023-03-09 14:48:29 +08:00
rodzic badf267022
commit f0c934c7a8
6 zmienionych plików z 37 dodań i 3 usunięć

Wyświetl plik

@ -201,6 +201,14 @@ esp_err_t esp_external_coex_set_validate_high(bool is_high_valid);
#endif
#endif
#if CONFIG_ESP_COEX_SW_COEXIST_ENABLE && CONFIG_SOC_IEEE802154_SUPPORTED
/**
* @brief Enable Wi-Fi and 802.15.4 coexistence.
* @return : ESP_OK - success, other - failed
*/
esp_err_t esp_coex_wifi_i154_enable(void);
#endif
#ifdef __cplusplus
}
#endif

Wyświetl plik

@ -395,3 +395,14 @@ esp_err_t esp_disable_extern_coex_gpio_pin()
return ESP_OK;
}
#endif/*External Coex*/
#if CONFIG_ESP_COEX_SW_COEXIST_ENABLE && CONFIG_SOC_IEEE802154_SUPPORTED
esp_err_t esp_coex_wifi_i154_enable(void)
{
// TODO: Add a scheme for wifi and 154 coex.
// Remove this function if FCC-50 closes.
coex_enable();
coex_schm_status_bit_set(1, 1);
return ESP_OK;
}
#endif

Wyświetl plik

@ -7,11 +7,16 @@
This example demonstrates an [OpenThread border router](https://openthread.io/guides/border-router).
The ESP Thread Border Router SDK provides extra components and examples for putting the ESP Thread Border Router solution into production:
* [ESP Thread Border Router Docs](https://docs.espressif.com/projects/esp-thread-br)
* [ESP Thread Border Router Repo](https://github.com/espressif/esp-thread-br)
## How to use example
### Hardware Required
#### **Wi-Fi based Thread Border Router**
The following SoCs are required to run this example:
By default, two SoCs are required to run this example:
* An ESP32 series Wi-Fi SoC (ESP32, ESP32-C, ESP32-S, etc) loaded with this ot_br example.
* An ESP32-H4 802.15.4 SoC loaded with [ot_rcp](../ot_rcp) example.
* Another ESP32-H4 SoC loaded with [ot_cli](../ot_cli) example.
@ -25,6 +30,8 @@ ESP32 pin | ESP32-H4 pin
GPIO4 | TX
GPIO5 | RX
The example could also run on a single SoC which supports both Wi-Fi and Thread (e.g., ESP32-C6), but since there is only one RF path in ESP32-C6, which means Wi-Fi and Thread can't receive simultaneously, it has a significant impact on performance. Hence the two SoCs solution is recommended.
#### **Ethernet based Thread Border Router**
Similar to the previous Wi-Fi based Thread Border Route setup, but a device with Ethernet interface is required, such as [ESP32-Ethernet-Kit](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/hw-reference/esp32/get-started-ethernet-kit.html)
@ -33,6 +40,8 @@ Similar to the previous Wi-Fi based Thread Border Route setup, but a device with
```
idf.py menuconfig
```
In order to run the example on single SoC which supports both Wi-Fi and Thread, the option `CONFIG_ESP_COEX_SW_COEXIST_ENABLE` and option `CONFIG_OPENTHREAD_RADIO_NATIVE` should be enabled. The two options are enabled by default for ESP32-C6 target.
Two ways are provided to setup the Thread Border Router in this example:
- Auto Start

Wyświetl plik

@ -34,6 +34,7 @@
#include "esp_vfs_dev.h"
#include "esp_vfs_eventfd.h"
#include "esp_wifi.h"
#include "esp_coexist.h"
#include "mdns.h"
#include "nvs_flash.h"
#include "protocol_examples_common.h"
@ -221,7 +222,12 @@ void app_main(void)
#if CONFIG_EXAMPLE_CONNECT_WIFI
#if CONFIG_OPENTHREAD_BR_AUTO_START
ESP_ERROR_CHECK(example_connect());
#if CONFIG_ESP_COEX_SW_COEXIST_ENABLE && CONFIG_OPENTHREAD_RADIO_NATIVE
ESP_ERROR_CHECK(esp_wifi_set_ps(WIFI_PS_MIN_MODEM));
ESP_ERROR_CHECK(esp_coex_wifi_i154_enable());
#else
ESP_ERROR_CHECK(esp_wifi_set_ps(WIFI_PS_NONE));
#endif
esp_openthread_set_backbone_netif(get_example_netif());
#else
esp_ot_wifi_netif_init();

Wyświetl plik

@ -1,7 +1,7 @@
## IDF Component Manager Manifest File
dependencies:
espressif/esp_ot_cli_extension:
version: "~0.3.0"
version: "~0.4.0"
espressif/mdns: "^1.0.3"
## Required IDF version
idf:

Wyświetl plik

@ -1,6 +1,6 @@
## IDF Component Manager Manifest File
dependencies:
espressif/esp_ot_cli_extension:
version: "~0.3.0"
version: "~0.4.0"
idf:
version: ">=4.1.0"