Skip to content

Commit e7c22d4

Browse files
committed
ESP32-P4: built variants for revisions and wifi daughterboard
Signed-off-by: Peter M <petermm@gmail.com>
1 parent 49c410b commit e7c22d4

File tree

8 files changed

+73
-12
lines changed

8 files changed

+73
-12
lines changed

.github/workflows/esp32-mkimage.yaml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
elixir_version: ["1.17"]
5151
rebar3_version: ["3.24.0"]
5252
compiler_pkgs: ["clang-14"]
53-
soc: ["esp32", "esp32c2", "esp32c3", "esp32s2", "esp32s3", "esp32c5", "esp32c6", "esp32c61", "esp32h2", "esp32p4"]
53+
soc: ["esp32", "esp32c2", "esp32c3", "esp32s2", "esp32s3", "esp32c5", "esp32c6", "esp32c61", "esp32h2", "esp32p4", "esp32p4_pre", "esp32p4_c6", "esp32p4_pre_c6"]
5454
flavor: ["", "-elixir"]
5555

5656
env:
@@ -120,13 +120,30 @@ jobs:
120120
run: |
121121
make
122122
123+
- name: "Set SOC target"
124+
run: echo "SOC_TARGET=${{ startsWith(matrix.soc, 'esp32p4') && 'esp32p4' || matrix.soc }}" >> $GITHUB_ENV
125+
123126
- name: "Use release defaults"
124127
if: startsWith(github.ref, 'refs/tags/')
125128
shell: bash
126129
working-directory: ./src/platforms/esp32/
127130
run: |
128131
cp sdkconfig.release-defaults sdkconfig.defaults
129132
133+
- name: "Handle esp32p4 variants sdkconfig"
134+
if: startsWith(matrix.soc, 'esp32p4')
135+
shell: bash
136+
working-directory: ./src/platforms/esp32/
137+
run: |
138+
cp sdkconfig.defaults.${{ matrix.soc }} sdkconfig.defaults.esp32p4
139+
140+
- name: "Handle esp32p4 c6 variants - add wifi_remote component"
141+
if: matrix.soc == 'esp32p4_c6' || matrix.soc == 'esp32p4_pre_c6'
142+
shell: bash
143+
working-directory: ./src/platforms/esp32/components/avm_builtins
144+
run: |
145+
cp idf_component.yml.esp32p4_wifi_remote idf_component.yml
146+
130147
- name: "Build ${{ matrix.soc }}${{ matrix.flavor }} with idf.py"
131148
shell: bash
132149
working-directory: ./src/platforms/esp32/
@@ -137,7 +154,7 @@ jobs:
137154
then
138155
mv partitions${{ matrix.flavor }}.csv partitions.csv
139156
fi
140-
idf.py set-target ${{ matrix.soc }}
157+
idf.py set-target ${{ env.SOC_TARGET }}
141158
idf.py reconfigure
142159
idf.py build
143160
@@ -147,11 +164,14 @@ jobs:
147164
if [ -z "${{ matrix.flavor }}" ]
148165
then
149166
./mkimage.sh
167+
if [ "${{ matrix.soc }}" != "${{ env.SOC_TARGET }}" ]; then
168+
mv atomvm-${{ env.SOC_TARGET }}.img atomvm-${{ matrix.soc }}.img
169+
fi
150170
else
151171
FLAVOR_SUFFIX=$(echo "${{ matrix.flavor }}" | sed 's/-//g')
152172
BOOT_FILE="../../../../build/libs/esp32boot/${FLAVOR_SUFFIX}_esp32boot.avm"
153173
./mkimage.sh --boot "$BOOT_FILE"
154-
mv atomvm-${{ matrix.soc }}.img atomvm-${{ matrix.soc }}${{ matrix.flavor }}.img
174+
mv atomvm-${{ env.SOC_TARGET }}.img atomvm-${{ matrix.soc }}${{ matrix.flavor }}.img
155175
fi
156176
ls -l *.img
157177

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7474

7575
- Removed `externalterm_to_term_copy` added in [0.6.5] and introduced flags to `externalterm_to_term` to perform copy.
7676
- Release images for ESP32 chips are built with ESP-IDF v5.5
77-
- Only support ESP32P4 on ESP-IDF v5.5.2, v5.4.4 and later, release images are for the mass market rev3 version.
77+
- Only support ESP32P4 on ESP-IDF v5.5.2, v5.4.4 and later.
7878
- ESP32: SPI peripheral defaults to `"spi2"` instead of deprecated `hspi`
7979
- Added `zlib:compress/1`
8080
- Entry point now is `init:boot/1` if it exists. It starts the kernel application and calls `start/0` from the

src/platforms/esp32/components/avm_builtins/idf_component.yml renamed to src/platforms/esp32/components/avm_builtins/idf_component.yml.esp32p4_wifi_remote

File renamed without changes.

src/platforms/esp32/sdkconfig.defaults.esp32p4

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,4 @@ CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
77
CONFIG_PARTITION_TABLE_CUSTOM=y
88
CONFIG_SPIRAM=y
99

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_LWIP_IPV6=y
15-
CONFIG_WIFI_RMT_EXTRA_IRAM_OPT=n
16-
CONFIG_WIFI_RMT_SLP_IRAM_OPT=n
10+
# no external chip/wifi
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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_LWIP_IPV6=y
15+
CONFIG_WIFI_RMT_EXTRA_IRAM_OPT=n
16+
CONFIG_WIFI_RMT_SLP_IRAM_OPT=n
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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+
# no esp-wifi-external
11+
12+
# Support esp32p4 pre-release
13+
CONFIG_ESP32P4_SELECTS_REV_LESS_V3=y
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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_LWIP_IPV6=y
15+
CONFIG_WIFI_RMT_EXTRA_IRAM_OPT=n
16+
CONFIG_WIFI_RMT_SLP_IRAM_OPT=n
17+
18+
# Support esp32p4 pre-release
19+
CONFIG_ESP32P4_SELECTS_REV_LESS_V3=y

src/platforms/esp32/test/sdkconfig.ci.wokwi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ CONFIG_COMPILER_OPTIMIZATION_PERF=y
77
CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y
88
CONFIG_MBEDTLS_ECP_FIXED_POINT_OPTIM=y
99
CONFIG_LWIP_IPV6=n
10-
CONFIG_ESP32P4_SELECTS_REV_LESS_V3=n

0 commit comments

Comments
 (0)