This directory contains a range of examples ESP-IDF projects. These are intended to demonstrate the Wi-Fi functionality, and to provide code that you can copy and adapt into your own projects.
Some ESP chips like the ESP32-P4 or ESP32-H2, without built-in Wi-Fi or Bluetooth, can still use these features through a **two-chip solution** via ESP-Hosted.
The two chip solution needs:
- Communication bus like SDIO or SPI between the host and co-processor
- Co-processor flashed with ESP-Hosted co-processor (slave) software
- Host processor flashed with additional software components: [esp-hosted](https://components.espressif.com/components/espressif/esp_hosted/) and [esp-wifi-remote](https://components.espressif.com/components/espressif/esp_wifi_remote/). This is handled by `idf_component.yml`. See the `idf_component.yml` in [iperf](iperf/main/idf_component.yml) for an example.
The ESP32-P4-Function-EV-Board is used here as a demonstration on how to run a Wi-Fi example.
### Running a Wi-Fi example on the ESP32-P4-Function-EV-Board
On this board,
* The ESP32-P4 is connected with the on-board ESP32-C6 (co-processor) using SDIO communication bus. See this ESP-Hosted ESP32-P4 EV Board [documentation](https://github.com/espressif/esp-hosted-mcu/blob/main/docs/esp32_p4_function_ev_board.md) for more information.
* The ESP32-C6 on the ESP32-P4 EV Board is pre-flashed with ESP-Hosted co-processor (slave) software.
* Only the example code needs to be built & flashed on the Host using the steps below.
#### Host Flashing
* Set ESP32-P4 as the target
```sh
idf.py set-target esp32p4
```
* Run Configure
```sh
idf.py menuconfig
```
Set `Component config` -> `Wi-Fi Remote` -> `choose slave target` to `esp32c6`.
Do any other project configuration required for the example.
* Build and Flash
```sh
idf.py -p <host serial port> flash monitor
```
### Co-processor Flashing
**(Optional, but recommended)**
The ESP32-C6 on the ESP32-P4 EV Board is already pre-flashed with ESP-Hosted co-processor software. Host software on the ESP-Hosted component is backward compatible with this co-processor software. It is recommended to upgrade to the latest software via [simplified co-processor OTA](https://github.com/espressif/esp-hosted-mcu/blob/main/docs/esp32_p4_function_ev_board.md#51-ota-updates) or by [manual flashing with ESP-Prog](https://github.com/espressif/esp-hosted-mcu/blob/main/docs/esp32_p4_function_ev_board.md#52-using-esp-prog).
### Troubleshooting
For any technical queries on the two-chip solution, please open an [ESP-Hosted issue](https://github.com/espressif/esp-hosted-mcu/issues) on GitHub.