You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# ESP-Hosted on the ESP32-P4-Function-EV-Board DevKit
2
2
3
-
**Table of Contents**
4
-
5
-
-[1. Introduction](#1-introduction)
6
-
-[2. Building ESP-Hosted as Host for the P4](#2-building-esp-hosted-as-host-for-the-p4)
7
-
-[2.1. Adding Wifi Remote and Hosted Components](#21-adding-wifi-remote-and-hosted-components)
8
-
-[2.2. Building the Firmware](#22-building-the-firmware)
9
-
-[3. Checking that ESP-Hosted is Running](#3-checking-that-esp-hosted-is-running)
10
-
-[4. Flashing the On-board ESP32-C6 using ESP-Prog](#4-flashing-the-on-board-esp32-c6-using-esp-prog)
11
-
-[5. Troubleshooting](#5-troubleshooting)
12
-
-[6. Flashing the On-board ESP32-P4 through the Serial Interface](#6-flashing-the-on-board-esp32-p4-through-the-serial-interface)
13
-
-[7. References](#7-references)
3
+
<details>
4
+
<summary>**Table of Contents**</summary>
5
+
6
+
-[Introduction](#1-introduction)
7
+
-[Set-Up ESP-IDF](#2-set-up-esp-idf)
8
+
-[Building Host for the P4](#3-building-host-for-the-p4)
9
+
-[Adding Components](#31-adding-components)
10
+
-[Configuring Defaults](#32-configuring-defaults)
11
+
-[Building Firmware](#33-building-firmware)
12
+
-[Checking ESP-Hosted](#4-checking-esp-hosted)
13
+
-[Flashing ESP32-C6](#5-flashing-esp32-c6)
14
+
-[Using ESP-Prog](#51-using-esp-prog)
15
+
-[OTA Updates](#52-ota-updates)
16
+
-[Troubleshooting](#6-troubleshooting)
17
+
-[Flashing the On-board ESP32-P4 through the ESP-Prog](#7-flashing-esp32-p4)
18
+
-[References](#8-references)
19
+
20
+
</details>
14
21
15
22
## 1. Introduction
16
23
17
-
This page documents using ESP-Hosted on the
18
-
ESP32-P4-Function-EV-Board. The board comes with an on-board ESP32-C6
19
-
module, pre-flashed with ESP-Hosted slave code (v0.0.6). The board
20
-
provides a Wi-Fi connection to the on-board ESP32-P4, which acts as
21
-
the host.
24
+
This page documents using ESP-Hosted-MCU on the ESP32-P4-Function-EV-Board. The board comes with an on-board ESP32-C6 module, pre-flashed with ESP-Hosted-MCU slave code (v0.0.6). The board provides a Wi-Fi connection to the on-board ESP32-P4, which acts as the host.
The ESP32-P4 communicates with the ESP32-C6 module using SDIO.
31
33
32
-
## 2. Building ESP-Hosted as Host for the P4
34
+
## 2. Set-Up ESP-IDF
35
+
36
+
As you have reached here, it is highly likely that you have already setup ESP-IDF.
37
+
38
+
If not done, Please set up ESP-IDF:
39
+
40
+
#### Option 1: Installer Way
41
+
42
+
-**Windows**
43
+
- Install and setup ESP-IDF on Windows as documented in the [Standard Setup of Toolchain for Windows](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/windows-setup.html).
44
+
- Use the ESP-IDF [Powershell Command Prompt](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/windows-setup.html#using-the-command-prompt) for subsequent commands.
fish docs/setup_esp_idf__latest_stable__linux_macos.fish
54
+
```
55
+
56
+
#### Option 2: Manual Way
33
57
34
-
### 2.1. Adding Wifi Remote and Hosted Components
58
+
Please follow the [ESP-IDF Get Started Guide](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html) for manual installation.
35
59
36
-
The Wi-Fi service is provided to the ESP32-P4 using the
37
-
`esp_wifi_remote` component. Check your project's `idf_component.yml`
38
-
file) to see if it is already present. If not, you can add this
39
-
component to your project:
60
+
## 3. Building Host for the P4
61
+
62
+
### 3.1. Adding Components
63
+
64
+
Add `esp_wifi_remote` and `esp_hosted` components to the project:
40
65
41
66
```
42
67
idf.py add-dependency "espressif/esp_wifi_remote"
68
+
idf.py add-dependency "espressif/esp_hosted"
69
+
```
70
+
71
+
Remove 'esp-extconn' if present in `main/idf_component.yml`, as esp-extconn and esp-hosted cannot work together.
72
+
Open the `main/idf_component.yml` file and remove/comment the following block if present:
73
+
74
+
```
75
+
# ------- Delete or comment this block ---------
76
+
espressif/esp-extconn:
77
+
version: "~0.1.0"
78
+
rules:
79
+
- if: "target in [esp32p4]"
80
+
# -----------------------------------
43
81
```
44
82
45
-
The `esp_wifi_remote`component has a dependency on ESP-Hosted and
46
-
will also add the `esp_hosted` component to your build.
83
+
It is always good to use `esp_wifi_remote` as it provides all the Wi-Fi config and a wrapper abstraction layer.
84
+
But you can also evaluate without using it.
47
85
48
-
### 2.2. Building the Firmware
86
+
### 3.2. Configuring Defaults
87
+
88
+
Edit the `sdkconfig.defaults.esp32p4` file such that, it would have following content:
89
+
90
+
```
91
+
#### Comment below two lines if present:
92
+
# CONFIG_ESP_HOST_WIFI_ENABLED=y
93
+
# CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE=y
94
+
95
+
#### Add Wi-Fi Remote config for better performance:
96
+
CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=16
97
+
CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=64
98
+
CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM=64
99
+
CONFIG_ESP_WIFI_AMPDU_TX_ENABLED=y
100
+
CONFIG_ESP_WIFI_TX_BA_WIN=32
101
+
CONFIG_ESP_WIFI_AMPDU_RX_ENABLED=y
102
+
CONFIG_ESP_WIFI_RX_BA_WIN=32
103
+
104
+
CONFIG_LWIP_TCP_SND_BUF_DEFAULT=65534
105
+
CONFIG_LWIP_TCP_WND_DEFAULT=65534
106
+
CONFIG_LWIP_TCP_RECVMBOX_SIZE=64
107
+
CONFIG_LWIP_UDP_RECVMBOX_SIZE=64
108
+
CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=64
109
+
110
+
CONFIG_LWIP_TCP_SACK_OUT=y
111
+
```
112
+
113
+
### 3.3. Building Firmware
49
114
50
115
Set the ESP32-P4 as the target, build, flash the firmware and
51
116
(optionally) monitor ESP32-P4 console output:
52
117
53
118
```sh
54
119
idf.py set-target esp32p4
55
120
idf.py build
56
-
idf.py -p <Serial Port> flash monitor`
121
+
idf.py -p <Serial Port> flash monitor
57
122
```
58
123
59
-
## 3. Checking that ESP-Hosted is Running
124
+
## 4. Checking ESP-Hosted
60
125
61
126
When the P4 is running with Hosted, you should see console output similar to this after start-up:
62
127
@@ -114,17 +179,68 @@ I (1848) H_SDIO_DRV: Received INIT event
114
179
I (1868) rpc_wrap: Received Slave ESP Init
115
180
```
116
181
117
-
## 4. Flashing the On-board ESP32-C6 using ESP-Prog
182
+
## 5. Flashing ESP32-C6
183
+
ESP32-C6 flashing is totally **optional**, as C6 is expected to be pre-flashed with ESP-Hosted slave firmware, 0.0.6. If you wish to get updated ESP-Hosted slave firmware, you can flash it using two ways, Either with ESP-Prog on ESP32-C6, or using OTA update configured using web server.
184
+
185
+
### 5.1 OTA Updates
186
+
187
+
To update the ESP32-C6 slave module using Over-The-Air (OTA) updates, follow these steps:
188
+
189
+
1. Build the ESP-Hosted slave firmware for the ESP32-C6 module:
0 commit comments