Skip to content

Commit f195c1a

Browse files
committed
Add wifi support via esp-wifi-external for ESP32P4
Adds components/avm_builtins/idf_component.yml that conditionally retreivies and includes the espressif/esp-wifi-external component for when building for the `esp32p4` target. Chip specific sdkconfig.defaults.esp32p4 enable the on-board PSRAM, sets the flash size to 16M (since this is the standard ammount incuded in P4 chips), and configure the use on the on-board ESP32C6 WiFi module as the wifi host device. Adds ESP32P4 build tests to CI workflow. Signed-off-by: Winford <winford@object.stream>
1 parent e6e574b commit f195c1a

File tree

6 files changed

+64
-6
lines changed

6 files changed

+64
-6
lines changed

.github/workflows/esp32-build.yaml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
fail-fast: false
4646

4747
matrix:
48-
esp-idf-target: ["esp32", "esp32c3"]
48+
esp-idf-target: ["esp32", "esp32c3", "esp32p4"]
4949
language: ['cpp']
5050
idf-version:
5151
- 'v5.0.7'
@@ -59,6 +59,13 @@ jobs:
5959
idf-version: 'v5.0.7'
6060
- esp-idf-target: "esp32c3"
6161
idf-version: 'v5.1.5'
62+
- esp-idf-target: "esp32p4"
63+
idf-version: 'v5.0.7'
64+
- esp-idf-target: "esp32p4"
65+
idf-version: 'v5.1.5'
66+
- esp-idf-target: "esp32p4"
67+
idf-version: 'v5.2.3'
68+
6269
steps:
6370
- name: Checkout repo
6471
uses: actions/checkout@v4
@@ -152,6 +159,11 @@ jobs:
152159
tar -xf ${QEMU_RISCV32_DIST} -C /opt && rm ${QEMU_RISCV32_DIST}
153160
154161
- name: Install pytest and pytest-embedded plugins
162+
# ESP32P4 is not currently supported by espressif/qemu, but an issue has been opened
163+
# (https://github.com/espressif/qemu/issues/127) and marked as "todo" status, but no
164+
# expected timeline is available yet.
165+
# TODO: remove the following exclusion when ESP32P4 support is added to espressif/qemu
166+
if: matrix.esp-idf-target != 'esp32p4'
155167
run: |
156168
set -e
157169
. $IDF_PATH/export.sh
@@ -162,6 +174,8 @@ jobs:
162174
pytest-embedded-qemu==1.10.3
163175
164176
- name: Build ESP32 tests using idf.py with memory checks
177+
# TODO: remove the following exclusion when ESP32P4 support is added to espressif/qemu
178+
if: matrix.esp-idf-target != 'esp32p4'
165179
working-directory: ./src/platforms/esp32/test/
166180
run: |
167181
set -e
@@ -179,6 +193,8 @@ jobs:
179193
idf.py build
180194
181195
- name: Run ESP32 tests using qemu with memory checks build
196+
# TODO: remove the following exclusion when ESP32P4 support is added to espressif/qemu
197+
if: matrix.esp-idf-target != 'esp32p4'
182198
working-directory: ./src/platforms/esp32/test/
183199
timeout-minutes: 10
184200
run: |
@@ -190,6 +206,8 @@ jobs:
190206
cp sdkconfig.defaults.backup sdkconfig.defaults
191207
192208
- name: Build ESP32 tests using idf.py
209+
# TODO: remove the following exclusion when ESP32P4 support is added to espressif/qemu
210+
if: matrix.esp-idf-target != 'esp32p4'
193211
working-directory: ./src/platforms/esp32/test/
194212
run: |
195213
set -e
@@ -200,6 +218,8 @@ jobs:
200218
idf.py build
201219
202220
- name: Run ESP32 tests using qemu
221+
# TODO: remove the following exclusion when ESP32P4 support is added to espressif/qemu
222+
if: matrix.esp-idf-target != 'esp32p4'
203223
working-directory: ./src/platforms/esp32/test/
204224
timeout-minutes: 10
205225
run: |

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ build/**
1010
xcode/**
1111
examples/**/build
1212
libs/**/build
13+
src/platforms/esp32/dependencies.lock
14+
src/platforms/esp32/managed_components/**
1315
src/platforms/esp32/build/**
1416
src/platforms/esp32/build/**/*.d
1517
src/platforms/esp32/test/build/**

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4747
- Added `application:get_env/2`
4848
- Added CodeQL analysis to esp32, stm32, pico, and wasm workflows
4949
- Added Function.ex and Protocol.ex improving Elixir 1.18 support
50+
- Added WiFi support for ESP32P4 via esp-wifi-external for build with ESP-IDF v5.4 and later
5051

5152
### Changed
5253

src/platforms/esp32/components/avm_builtins/Kconfig

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@ config AVM_ENABLE_I2C_RESOURCE_NIFS
9090

9191
config AVM_ENABLE_NETWORK_PORT_DRIVER
9292
bool "Enable network port driver"
93-
depends on ESP_WIFI_ENABLED || ESP_HOST_WIFI_ENABLED || ESP32_WIFI_ENABLED
93+
depends on ESP_WIFI_ENABLED || ESP_HOST_WIFI_ENABLED || ESP32_WIFI_ENABLED || ESP_WIFI_REMOTE_ENABLED
9494
default y
9595

9696
config AVM_ENABLE_SOCKET_PORT_DRIVER
9797
bool "Enable socket port driver"
98-
depends on ESP_WIFI_ENABLED || ESP_HOST_WIFI_ENABLED || ESP32_WIFI_ENABLED || ETH_ENABLED
98+
depends on ESP_WIFI_ENABLED || ESP_HOST_WIFI_ENABLED || ESP32_WIFI_ENABLED || ETH_ENABLED || ESP_WIFI_REMOTE_ENABLED
9999
default y
100100

101101
config AVM_ENABLE_SPI_PORT_DRIVER
@@ -112,17 +112,17 @@ config AVM_ENABLE_OTP_CRYPTO_NIFS
112112

113113
config AVM_ENABLE_OTP_SOCKET_NIFS
114114
bool "Enable OTP Socket NIFs"
115-
depends on ESP_WIFI_ENABLED || ESP_HOST_WIFI_ENABLED || ESP32_WIFI_ENABLED || ETH_ENABLED
115+
depends on ESP_WIFI_ENABLED || ESP_HOST_WIFI_ENABLED || ESP32_WIFI_ENABLED || ETH_ENABLED || ESP_WIFI_REMOTE_ENABLED
116116
default y
117117

118118
config AVM_ENABLE_OTP_NET_NIFS
119119
bool "Enable OTP Net NIFs"
120-
depends on ESP_WIFI_ENABLED || ESP_HOST_WIFI_ENABLED || ESP32_WIFI_ENABLED || ETH_ENABLED
120+
depends on ESP_WIFI_ENABLED || ESP_HOST_WIFI_ENABLED || ESP32_WIFI_ENABLED || ETH_ENABLED || ESP_WIFI_REMOTE_ENABLED
121121
default y
122122

123123
config AVM_ENABLE_OTP_SSL_NIFS
124124
bool "Enable OTP SSL NIFs"
125-
depends on ESP_WIFI_ENABLED || ESP_HOST_WIFI_ENABLED || ESP32_WIFI_ENABLED || ETH_ENABLED
125+
depends on ESP_WIFI_ENABLED || ESP_HOST_WIFI_ENABLED || ESP32_WIFI_ENABLED || ETH_ENABLED || ESP_WIFI_REMOTE_ENABLED
126126
default y
127127

128128
endmenu
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# SPDX-FileCopyrightText: AtomVM Contributors
3+
#
4+
## IDF Component Manager Manifest File
5+
dependencies:
6+
# # Put list of dependencies here
7+
# # For components maintained by Espressif:
8+
# component: "~1.0.0"
9+
# # For 3rd party components:
10+
# username/component: ">=1.0.0,<2.0.0"
11+
# username2/component2:
12+
# version: "~1.0.0"
13+
# # For transient dependencies `public` flag can be set.
14+
# # `public` flag doesn't have an effect dependencies of the `main` component.
15+
# # All dependencies of `main` are public by default.
16+
# public: true
17+
18+
espressif/esp_wifi_remote:
19+
rules:
20+
- if: "idf_version >= 5.4"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# SPDX-FileCopyrightText: AtomVM Contributors
3+
#
4+
# ESP32-P4 Flash and PSRAM
5+
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
6+
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
7+
CONFIG_PARTITION_TABLE_CUSTOM=y
8+
CONFIG_SPIRAM=y
9+
10+
# esp-wifi-external config for ESP32-C6 esp_wifi_hosted via SDIO
11+
# (default options for esp32-p4-function-ev-board)
12+
CONFIG_LWIP_PPP_VJ_HEADER_COMPRESSION=n
13+
CONFIG_SLAVE_IDF_TARGET_ESP32C6=y
14+
CONFIG_WIFI_RMT_EXTRA_IRAM_OPT=n
15+
CONFIG_WIFI_RMT_SLP_IRAM_OPT=n

0 commit comments

Comments
 (0)