Skip to content

Commit 8ee5f0a

Browse files
me-no-devJason2866UnexpectedMakerSuGliderPilnyTomas
authored
Esp32 s3 support (espressif#6341)
Co-authored-by: Jason2866 <[email protected]> Co-authored-by: Unexpected Maker <[email protected]> Co-authored-by: Rodrigo Garcia <[email protected]> Co-authored-by: Tomáš Pilný <[email protected]> Co-authored-by: Pedro Minatel <[email protected]> Co-authored-by: Ivan Grokhotkov <[email protected]> Co-authored-by: Jan Procházka <[email protected]> Co-authored-by: Limor "Ladyada" Fried <[email protected]>
1 parent 3f79097 commit 8ee5f0a

File tree

3,774 files changed

+685763
-19274
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,774 files changed

+685763
-19274
lines changed

.github/scripts/install-platformio-esp32.sh

+7-6
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
export PLATFORMIO_ESP32_PATH="$HOME/.platformio/packages/framework-arduinoespressif32"
44
PLATFORMIO_ESP32_URL="https://github.com/platformio/platform-espressif32.git#feature/arduino-idf-master"
55

6-
XTENSA32_TOOLCHAIN_VERSION="8.4.0+2021r2-patch2"
7-
XTENSA32S2_TOOLCHAIN_VERSION="8.4.0+2021r2-patch2"
8-
RISCV_TOOLCHAIN_VERSION="8.4.0+2021r2-patch2"
6+
TOOLCHAIN_VERSION="8.4.0+2021r2-patch2"
97
ESPTOOLPY_VERSION="~1.30100.0"
108
ESPRESSIF_ORGANIZATION_NAME="espressif"
119

@@ -30,9 +28,12 @@ replace_script+="data['packages']['toolchain-xtensa-esp32']['owner']='$ESPRESSIF
3028
replace_script+="data['packages']['toolchain-xtensa-esp32s2']['owner']='$ESPRESSIF_ORGANIZATION_NAME';"
3129
replace_script+="data['packages']['toolchain-riscv32-esp']['owner']='$ESPRESSIF_ORGANIZATION_NAME';"
3230
# Update versions to use the upstream
33-
replace_script+="data['packages']['toolchain-xtensa-esp32']['version']='$XTENSA32_TOOLCHAIN_VERSION';"
34-
replace_script+="data['packages']['toolchain-xtensa-esp32s2']['version']='$XTENSA32S2_TOOLCHAIN_VERSION';"
35-
replace_script+="data['packages']['toolchain-riscv32-esp']['version']='$RISCV_TOOLCHAIN_VERSION';"
31+
replace_script+="data['packages']['toolchain-xtensa-esp32']['version']='$TOOLCHAIN_VERSION';"
32+
replace_script+="data['packages']['toolchain-xtensa-esp32s2']['version']='$TOOLCHAIN_VERSION';"
33+
replace_script+="data['packages']['toolchain-riscv32-esp']['version']='$TOOLCHAIN_VERSION';"
34+
# Add ESP32-S3 Toolchain
35+
replace_script+="data['packages'].update({'toolchain-xtensa-esp32s3':{'type':'toolchain','optional':True,'owner':'$ESPRESSIF_ORGANIZATION_NAME','version':'$TOOLCHAIN_VERSION'}});"
36+
replace_script+="data['packages']['toolchain-xtensa-esp32'].update({'optional':False});"
3637
# esptool.py may require an upstream version (for now platformio is the owner)
3738
replace_script+="data['packages']['tool-esptoolpy']['version']='$ESPTOOLPY_VERSION';"
3839
# Save results

.github/scripts/on-push.sh

+19-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
set -e
44

5+
export ARDUINO_BUILD_DIR="$HOME/.arduino/build.tmp"
6+
57
function build(){
68
local target=$1
79
local fqbn=$2
@@ -63,6 +65,7 @@ if [ "$BUILD_PIO" -eq 0 ]; then
6365

6466
FQBN_ESP32="espressif:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app"
6567
FQBN_ESP32S2="espressif:esp32:esp32s2:PSRAM=enabled,PartitionScheme=huge_app"
68+
FQBN_ESP32S3="espressif:esp32:esp32s3:PSRAM=opi,USBMode=default,PartitionScheme=huge_app"
6669
FQBN_ESP32C3="espressif:esp32:esp32c3:PartitionScheme=huge_app"
6770

6871
SKETCHES_ESP32="\
@@ -76,9 +79,10 @@ if [ "$BUILD_PIO" -eq 0 ]; then
7679
$ARDUINO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino\
7780
"
7881

79-
build "esp32" $FQBN_ESP32 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32
82+
build "esp32s3" $FQBN_ESP32S3 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32
8083
build "esp32s2" $FQBN_ESP32S2 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32XX
8184
build "esp32c3" $FQBN_ESP32C3 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32XX
85+
build "esp32" $FQBN_ESP32 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32
8286
else
8387
source ${SCRIPTS_DIR}/install-platformio-esp32.sh
8488
# PlatformIO ESP32 Test
@@ -96,6 +100,20 @@ else
96100
# build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino"
97101

98102
python -m platformio ci --board "$BOARD" "$PLATFORMIO_ESP32_PATH/libraries/WiFi/examples/WiFiClient" --project-option="board_build.mcu = esp32s2" --project-option="board_build.partitions = huge_app.csv"
103+
python -m platformio ci --board "$BOARD" "$PLATFORMIO_ESP32_PATH/libraries/WiFi/examples/WiFiClient" --project-option="board_build.mcu = esp32c3" --project-option="board_build.partitions = huge_app.csv"
104+
105+
echo "Hacking in S3 support ..."
106+
replace_script="import json; import os;"
107+
replace_script+="fp=open(os.path.expanduser('~/.platformio/platforms/espressif32/platform.json'), 'r+');"
108+
replace_script+="data=json.load(fp);"
109+
replace_script+="data['packages']['toolchain-xtensa-esp32']['optional']=True;"
110+
replace_script+="data['packages']['toolchain-xtensa-esp32s3']['optional']=False;"
111+
replace_script+="data['packages']['tool-esptoolpy']['owner']='tasmota';"
112+
replace_script+="data['packages']['tool-esptoolpy']['version']='https://github.com/tasmota/esptool/releases/download/v3.2.1/esptool-3.2.1.zip';"
113+
replace_script+="fp.seek(0);fp.truncate();json.dump(data, fp, indent=2);fp.close()"
114+
python -c "$replace_script"
115+
116+
python -m platformio ci --board "$BOARD" "$PLATFORMIO_ESP32_PATH/libraries/WiFi/examples/WiFiClient" --project-option="board_build.mcu = esp32s3" --project-option="board_build.partitions = huge_app.csv"
99117

100118
#build_pio_sketches "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries"
101119
fi

.github/scripts/sketch_utils.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,19 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <fqbn> <path-to-i
88
fi
99

1010
ARDUINO_CACHE_DIR="$HOME/.arduino/cache.tmp"
11+
if [ -z "$ARDUINO_BUILD_DIR" ]; then
12+
build_dir="$(dirname $sketch)/build"
13+
else
14+
build_dir="$ARDUINO_BUILD_DIR"
15+
fi
1116
local ide_path=$1
1217
local usr_path=$2
1318
local fqbn=$3
1419
local sketch=$4
1520
local xtra_opts=$5
1621
local win_opts=$6
1722

18-
build_dir="$(dirname $sketch)/build"
23+
rm -rf "$build_dir"
1924
mkdir -p "$build_dir"
2025
mkdir -p "$ARDUINO_CACHE_DIR"
2126
$ide_path/arduino-builder -compile -logger=human -core-api-version=10810 \

.github/scripts/tests_build.sh

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ case "$target" in
2525
;;
2626
"esp32c3") fqbn="espressif:esp32:esp32c3:PartitionScheme=huge_app"
2727
;;
28+
"esp32s3") fqbn="espressif:esp32:esp32s3:PSRAM=opi,USBMode=default,PartitionScheme=huge_app"
29+
;;
2830
esac
2931

3032
if [ -z $fqbn ]; then

.github/scripts/update-version.sh

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
3+
if [ ! $# -eq 3 ]; then
4+
echo "Bad number of arguments: $#" >&2
5+
echo "usage: $0 <major> <minor> <patch>" >&2
6+
exit 1
7+
fi
8+
9+
re='^[0-9]+$'
10+
if [[ ! $1 =~ $re ]] || [[ ! $2 =~ $re ]] || [[ ! $3 =~ $re ]] ; then
11+
echo "error: Not a valid version: $1.$2.$3" >&2
12+
echo "usage: $0 <major> <minor> <patch>" >&2
13+
exit 1
14+
fi
15+
16+
ESP_ARDUINO_VERSION_MAJOR="$1"
17+
ESP_ARDUINO_VERSION_MINOR="$2"
18+
ESP_ARDUINO_VERSION_PATCH="$3"
19+
ESP_ARDUINO_VERSION="$ESP_ARDUINO_VERSION_MAJOR.$ESP_ARDUINO_VERSION_MINOR.$ESP_ARDUINO_VERSION_PATCH"
20+
21+
echo "New Arduino Version: $ESP_ARDUINO_VERSION"
22+
23+
echo "Updating platform.txt..."
24+
cat platform.txt | sed "s/version=.*/version=$ESP_ARDUINO_VERSION/g" > __platform.txt && mv __platform.txt platform.txt
25+
26+
echo "Updating package.json..."
27+
cat package.json | sed "s/.*\"version\":.*/ \"version\": \"$ESP_ARDUINO_VERSION\",/g" > __package.json && mv __package.json package.json
28+
29+
echo "Updating cores/esp32/esp_arduino_version.h..."
30+
cat cores/esp32/esp_arduino_version.h | \
31+
sed "s/#define ESP_ARDUINO_VERSION_MAJOR.*/#define ESP_ARDUINO_VERSION_MAJOR $ESP_ARDUINO_VERSION_MAJOR/g" | \
32+
sed "s/#define ESP_ARDUINO_VERSION_MINOR.*/#define ESP_ARDUINO_VERSION_MINOR $ESP_ARDUINO_VERSION_MINOR/g" | \
33+
sed "s/#define ESP_ARDUINO_VERSION_PATCH.*/#define ESP_ARDUINO_VERSION_PATCH $ESP_ARDUINO_VERSION_PATCH/g" > __esp_arduino_version.h && mv __esp_arduino_version.h cores/esp32/esp_arduino_version.h
34+
35+
exit 0

.github/workflows/hil.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
runs-on: ubuntu-latest
4848
strategy:
4949
matrix:
50-
chip: ['esp32', 'esp32s2', 'esp32c3']
50+
chip: ['esp32', 'esp32s2', 'esp32s3', 'esp32c3']
5151
chunks: ${{fromJson(needs.gen_chunks.outputs.chunks)}}
5252

5353
steps:
@@ -71,7 +71,7 @@ jobs:
7171
strategy:
7272
fail-fast: false
7373
matrix:
74-
chip: ['esp32', 'esp32s2', 'esp32c3']
74+
chip: ['esp32', 'esp32s2', 'esp32s3', 'esp32c3']
7575
chunks: ${{fromJson(needs.gen_chunks.outputs.chunks)}}
7676
container:
7777
image: python:3.10.1-bullseye
@@ -110,6 +110,7 @@ jobs:
110110

111111
event_file:
112112
name: "Event File"
113+
if: ${{ always() }}
113114
needs: Test
114115
runs-on: ubuntu-latest
115116
steps:

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
tools/xtensa-esp32-elf
22
tools/xtensa-esp32s2-elf
3+
tools/xtensa-esp32s3-elf
34
tools/riscv32-esp-elf
45
tools/dist
56
tools/esptool

CMakeLists.txt

+6-3
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ set(LIBRARY_SRCS
8787
libraries/HTTPClient/src/HTTPClient.cpp
8888
libraries/HTTPUpdate/src/HTTPUpdate.cpp
8989
libraries/LittleFS/src/LittleFS.cpp
90+
libraries/I2S/src/I2S.cpp
9091
libraries/NetBIOS/src/NetBIOS.cpp
9192
libraries/Preferences/src/Preferences.cpp
9293
libraries/RainMaker/src/RMaker.cpp
@@ -163,7 +164,6 @@ set(BLE_SRCS
163164
libraries/BLE/src/GeneralUtils.cpp
164165
)
165166

166-
167167
set(includedirs
168168
variants/${IDF_TARGET}/
169169
cores/esp32/
@@ -181,6 +181,7 @@ set(includedirs
181181
libraries/HTTPClient/src
182182
libraries/HTTPUpdate/src
183183
libraries/LittleFS/src
184+
libraries/I2S/src
184185
libraries/NetBIOS/src
185186
libraries/Preferences/src
186187
libraries/RainMaker/src
@@ -201,7 +202,7 @@ set(includedirs
201202

202203
set(srcs ${CORE_SRCS} ${LIBRARY_SRCS} ${BLE_SRCS})
203204
set(priv_includes cores/esp32/libb64)
204-
set(requires spi_flash mbedtls mdns esp_adc_cal wifi_provisioning nghttp)
205+
set(requires spi_flash mbedtls mdns esp_adc_cal wifi_provisioning nghttp wpa_supplicant)
205206
set(priv_requires fatfs nvs_flash app_update spiffs bootloader_support openssl bt esp_ipc esp_hid)
206207

207208
idf_component_register(INCLUDE_DIRS ${includedirs} PRIV_INCLUDE_DIRS ${priv_includes} SRCS ${srcs} REQUIRES ${requires} PRIV_REQUIRES ${priv_requires})
@@ -236,7 +237,9 @@ function(maybe_add_component component_name)
236237
endif()
237238
endfunction()
238239

239-
if(IDF_TARGET MATCHES "esp32" AND CONFIG_ESP_RMAKER_TASK_STACK)
240+
maybe_add_component(esp-dsp)
241+
242+
if(CONFIG_ESP_RMAKER_WORK_QUEUE_TASK_STACK)
240243
maybe_add_component(esp_rainmaker)
241244
maybe_add_component(qrcode)
242245
endif()

0 commit comments

Comments
 (0)