Skip to content

Arduino ESP32 v3.3 based on ESP-IDF v5.5 (master) #10884

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 43 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
88cda9f
feat(idf): Add initial support for IDF v5.5 and ESP32-C5
me-no-dev Jan 21, 2025
bf90cbd
fix(examples): Add changes required to some examples
me-no-dev Jan 21, 2025
af5abd5
fix(c5): Update bootloader location
me-no-dev Jan 22, 2025
0894d7d
fix(report): Add missing chip names
me-no-dev Jan 22, 2025
100ed8e
fix(c5): Update debug log in setCpuFrequencyMhz
P-R-O-C-H-Y Jan 22, 2025
d9d3bf4
add c5 bootloader location to pioarduino script (#10889)
Jason2866 Jan 22, 2025
8af81cd
fix(ci): Fix/stop some examples for C5
me-no-dev Jan 22, 2025
9fbcb34
fix(c5): Update PIN_RGB_LED in pins_arduino.h
P-R-O-C-H-Y Jan 22, 2025
f45cd7b
fix(psram): Add support for ESP32-C5 PSRAM
me-no-dev Jan 27, 2025
75de09e
fix(board): Update ESP32-C5 Dev Kit Pinout
me-no-dev Feb 3, 2025
6283c15
IDF master (#10887)
me-no-dev Feb 18, 2025
042015e
IDF master (#10981)
me-no-dev Feb 18, 2025
e30e3c3
IDF master (#10999)
me-no-dev Feb 25, 2025
3fe2fe5
IDF master 0461e2ff (#11018)
me-no-dev Feb 26, 2025
d66eeb7
c5 flash base address is 0x2000 (#11037)
Jason2866 Mar 5, 2025
7c1ac1a
feat(wifi): Add support for 2.4GHz and 5GHz band switching (#11045)
me-no-dev Mar 10, 2025
d81c195
Merge branch 'master' into release/v3.3.x
me-no-dev Mar 27, 2025
dac2dd9
Merge branch 'master' into release/v3.3.x
me-no-dev Mar 28, 2025
a61961d
IDF master (#11150)
me-no-dev Mar 28, 2025
998bf80
Merge branch 'master' into release/v3.3.x
me-no-dev Mar 29, 2025
ae2ae8d
Merge branch 'master' into release/v3.3.x
lucasssvaz Apr 14, 2025
42ae242
fix C5 compile (#11255)
Jason2866 Apr 21, 2025
5d0c4b3
Merge branch 'master' into release/v3.3.x
me-no-dev Apr 22, 2025
03e9c45
IDF master (#11204)
me-no-dev Apr 23, 2025
23f3600
Merge branch 'master' into release/v3.3.x
me-no-dev Apr 23, 2025
c9efce6
Merge branch 'master' into release/v3.3.x
me-no-dev Apr 29, 2025
b115ace
IDF master (#11289)
me-no-dev Apr 30, 2025
602f1f6
IDF master (#11342)
me-no-dev May 7, 2025
a83bb93
Merge branch 'master' into release/v3.3.x
me-no-dev May 13, 2025
bc08c49
Update version for wifi remote (#11344)
Jason2866 May 13, 2025
69cd5a0
IDF master 7cf5dacd (#11358)
me-no-dev May 15, 2025
d69ad5e
Merge branch 'master' into release/v3.3.x
me-no-dev May 15, 2025
5540afa
feat(ci): Run push CI against IDF v5.5
me-no-dev May 15, 2025
3f63a49
fix(build): Add dependency on esp_http_client
me-no-dev May 19, 2025
15038e6
Merge branch 'master' into release/v3.3.x
me-no-dev May 27, 2025
b769846
Merge branch 'master' into release/v3.3.x
me-no-dev May 30, 2025
6ce7e25
IDF release/v5.5 (#11369)
me-no-dev May 30, 2025
a6bba43
fix(c5): Enable components for ESP32-C5
me-no-dev May 30, 2025
0ab9a0f
feat(zigbee): Update to esp-zigbee-sdk 1.6.5 and fix ci.json files (#…
P-R-O-C-H-Y Jun 4, 2025
e9813c6
Merge branch 'master' into release/v3.3.x
me-no-dev Jun 4, 2025
89ff465
feat(esptool): Upgrade to esptool v5 (#11433)
lucasssvaz Jun 10, 2025
aaeabb5
Merge branch 'master' into release/v3.3.x
me-no-dev Jun 10, 2025
0f72681
Merge branch 'master' into release/v3.3.x
me-no-dev Jun 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/scripts/on-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ if [ "$BUILD_LOG" -eq 1 ]; then
fi

#build sketches for different targets
build "esp32c5" "$CHUNK_INDEX" "$CHUNKS_CNT" "$BUILD_LOG" "$LOG_LEVEL" "$SKETCHES_FILE" "${SKETCHES_ESP32[@]}"
build "esp32p4" "$CHUNK_INDEX" "$CHUNKS_CNT" "$BUILD_LOG" "$LOG_LEVEL" "$SKETCHES_FILE" "${SKETCHES_ESP32[@]}"
build "esp32s3" "$CHUNK_INDEX" "$CHUNKS_CNT" "$BUILD_LOG" "$LOG_LEVEL" "$SKETCHES_FILE" "${SKETCHES_ESP32[@]}"
build "esp32s2" "$CHUNK_INDEX" "$CHUNKS_CNT" "$BUILD_LOG" "$LOG_LEVEL" "$SKETCHES_FILE" "${SKETCHES_ESP32[@]}"
Expand Down
5 changes: 5 additions & 0 deletions .github/scripts/sketch_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ function build_sketch { # build_sketch <ide_path> <user_path> <path-to-ino> [ext
esp32c6_opts=$(echo "$debug_level,$fqbn_append" | sed 's/^,*//;s/,*$//;s/,\{2,\}/,/g')
esp32h2_opts=$(echo "$debug_level,$fqbn_append" | sed 's/^,*//;s/,*$//;s/,\{2,\}/,/g')
esp32p4_opts=$(echo "PSRAM=enabled,USBMode=default,$debug_level,$fqbn_append" | sed 's/^,*//;s/,*$//;s/,\{2,\}/,/g')
esp32c5_opts=$(echo "$debug_level,$fqbn_append" | sed 's/^,*//;s/,*$//;s/,\{2,\}/,/g')

# Select the common part of the FQBN based on the target. The rest will be
# appended depending on the passed options.
Expand Down Expand Up @@ -191,6 +192,10 @@ function build_sketch { # build_sketch <ide_path> <user_path> <path-to-ino> [ext
[ -n "${options:-$esp32p4_opts}" ] && opt=":${options:-$esp32p4_opts}"
fqbn="espressif:esp32:esp32p4$opt"
;;
"esp32c5")
[ -n "${options:-$esp32c5_opts}" ] && opt=":${options:-$esp32c5_opts}"
fqbn="espressif:esp32:esp32c5$opt"
;;
*)
echo "ERROR: Invalid chip: $target"
exit 1
Expand Down
236 changes: 236 additions & 0 deletions .github/scripts/update_esptool.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,236 @@
#!/usr/bin/env python3

# This script is used to re-package the esptool if needed and update the JSON file
# for the Arduino ESP32 platform.
#
# The script has only been tested on macOS.
#
# For regular esptool releases, the generated packages already contain the correct permissions,
# extensions and are uploaded to the GitHub release assets. In this case, the script will only
# update the JSON file with the information from the GitHub release.
#
# The script can be used in two modes:
# 1. Local build: The build artifacts must be already downloaded and extracted in the base_folder.
# This is useful for esptool versions that are not yet released and that are grabbed from the
# GitHub build artifacts.
# 2. Release build: The script will get the release information from GitHub and update the JSON file.
# This is useful for esptool versions that are already released and that are uploaded to the
# GitHub release assets.
#
# For local build, the artifacts must be already downloaded and extracted in the base_folder
# set with the -l option.
# For example, a base folder "esptool" should contain the following folders extracted directly
# from the GitHub build artifacts:
# esptool/esptool-linux-aarch64
# esptool/esptool-linux-amd64
# esptool/esptool-linux-armv7
# esptool/esptool-macos-amd64
# esptool/esptool-macos-arm64
# esptool/esptool-windows-amd64

import argparse
import json
import os
import shutil
import stat
import tarfile
import zipfile
import hashlib
import requests
from pathlib import Path

def compute_sha256(filepath):
sha256 = hashlib.sha256()
with open(filepath, "rb") as f:
for block in iter(lambda: f.read(4096), b""):
sha256.update(block)
return f"SHA-256:{sha256.hexdigest()}"

def get_file_size(filepath):
return os.path.getsize(filepath)

def update_json_for_host(tmp_json_path, version, host, url, archiveFileName, checksum, size):
with open(tmp_json_path) as f:
data = json.load(f)

for pkg in data.get("packages", []):
for tool in pkg.get("tools", []):
if tool.get("name") == "esptool_py":
tool["version"] = version

if url is None:
# If the URL is not set, we need to find the old URL and update it
for system in tool.get("systems", []):
if system.get("host") == host:
url = system.get("url").replace(system.get("archiveFileName"), archiveFileName)
break
else:
print(f"No old URL found for host {host}. Using empty URL.")
url = ""

# Preserve existing systems order and update or append the new system
systems = tool.get("systems", [])
system_updated = False
for i, system in enumerate(systems):
if system.get("host") == host:
systems[i] = {
"host": host,
"url": url,
"archiveFileName": archiveFileName,
"checksum": checksum,
"size": str(size),
}
system_updated = True
break

if not system_updated:
systems.append({
"host": host,
"url": url,
"archiveFileName": archiveFileName,
"checksum": checksum,
"size": str(size),
})
tool["systems"] = systems

with open(tmp_json_path, "w") as f:
json.dump(data, f, indent=2, sort_keys=False, ensure_ascii=False)
f.write("\n")

def update_tools_dependencies(tmp_json_path, version):
with open(tmp_json_path) as f:
data = json.load(f)

for pkg in data.get("packages", []):
for platform in pkg.get("platforms", []):
for dep in platform.get("toolsDependencies", []):
if dep.get("name") == "esptool_py":
dep["version"] = version

with open(tmp_json_path, "w") as f:
json.dump(data, f, indent=2, sort_keys=False, ensure_ascii=False)
f.write("\n")

def create_archives(version, base_folder):
archive_files = []

for dirpath in Path(base_folder).glob("esptool-*"):
if not dirpath.is_dir():
continue

base = dirpath.name[len("esptool-"):]

if "windows" in dirpath.name:
zipfile_name = f"esptool-v{version}-{base}.zip"
print(f"Creating {zipfile_name} from {dirpath} ...")
with zipfile.ZipFile(zipfile_name, "w", zipfile.ZIP_DEFLATED) as zipf:
for root, _, files in os.walk(dirpath):
for file in files:
full_path = os.path.join(root, file)
zipf.write(full_path, os.path.relpath(full_path, start=dirpath))
archive_files.append(zipfile_name)
else:
tarfile_name = f"esptool-v{version}-{base}.tar.gz"
print(f"Creating {tarfile_name} from {dirpath} ...")
for root, dirs, files in os.walk(dirpath):
for name in dirs + files:
os.chmod(os.path.join(root, name), stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR |
stat.S_IRGRP | stat.S_IXGRP |
stat.S_IROTH | stat.S_IXOTH)
with tarfile.open(tarfile_name, "w:gz") as tar:
tar.add(dirpath, arcname=dirpath.name)
archive_files.append(tarfile_name)

return archive_files

def determine_hosts(archive_name):
if "linux-amd64" in archive_name:
return ["x86_64-pc-linux-gnu"]
elif "linux-armv7" in archive_name:
return ["arm-linux-gnueabihf"]
elif "linux-aarch64" in archive_name:
return ["aarch64-linux-gnu"]
elif "macos-amd64" in archive_name:
return ["x86_64-apple-darwin"]
elif "macos-arm64" in archive_name:
return ["arm64-apple-darwin"]
elif "windows-amd64" in archive_name:
return ["x86_64-mingw32", "i686-mingw32"]
else:
return []

def update_json_from_local_build(tmp_json_path, version, base_folder, archive_files):
for archive in archive_files:
print(f"Processing archive: {archive}")
hosts = determine_hosts(archive)
if not hosts:
print(f"Skipping unknown archive type: {archive}")
continue

archive_path = Path(archive)
checksum = compute_sha256(archive_path)
size = get_file_size(archive_path)

for host in hosts:
update_json_for_host(tmp_json_path, version, host, None, archive_path.name, checksum, size)

def update_json_from_release(tmp_json_path, version, release_info):
assets = release_info.get("assets", [])
for asset in assets:
if (asset.get("name").endswith(".tar.gz") or asset.get("name").endswith(".zip")) and "esptool" in asset.get("name"):
asset_fname = asset.get("name")
print(f"Processing asset: {asset_fname}")
hosts = determine_hosts(asset_fname)
if not hosts:
print(f"Skipping unknown archive type: {asset_fname}")
continue

asset_url = asset.get("browser_download_url")
asset_checksum = asset.get("digest")
asset_size = asset.get("size")
if asset_checksum is None:
asset_checksum = ""
print(f"Asset {asset_fname} has no checksum. Please set the checksum in the JSON file.")

for host in hosts:
update_json_for_host(tmp_json_path, version, host, asset_url, asset_fname, asset_checksum, asset_size)

def get_release_info(version):
url = f"https://api.github.com/repos/espressif/esptool/releases/tags/v{version}"
response = requests.get(url)
response.raise_for_status()
return response.json()

def main():
parser = argparse.ArgumentParser(description="Repack esptool and update JSON metadata.")
parser.add_argument("version", help="Version of the esptool (e.g. 5.0.dev1)")
parser.add_argument("-l", "--local", dest="base_folder", help="Enable local build mode and set the base folder with unpacked artifacts")
args = parser.parse_args()

script_dir = Path(__file__).resolve().parent
json_path = (script_dir / "../../package/package_esp32_index.template.json").resolve()
tmp_json_path = Path(str(json_path) + ".tmp")
shutil.copy(json_path, tmp_json_path)

local_build = args.base_folder is not None

if local_build:
os.chdir(args.base_folder)
os.environ['COPYFILE_DISABLE'] = 'true' # this disables including resource forks in tar files on macOS
# Clear any existing archive files
for file in Path(args.base_folder).glob("esptool-*.*"):
file.unlink()
archive_files = create_archives(args.version, args.base_folder)
update_json_from_local_build(tmp_json_path, args.version, args.base_folder, archive_files)
else:
release_info = get_release_info(args.version)
update_json_from_release(tmp_json_path, args.version, release_info)

print(f"Updating esptool version fields to {args.version}")
update_tools_dependencies(tmp_json_path, args.version)

shutil.move(tmp_json_path, json_path)
print(f"Done. JSON updated at {json_path}")

if __name__ == "__main__":
main()
3 changes: 2 additions & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ on:
- "!.github/scripts/upload_*"
- "variants/esp32/**/*"
- "variants/esp32c3/**/*"
- "variants/esp32c5/**/*"
- "variants/esp32c6/**/*"
- "variants/esp32h2/**/*"
- "variants/esp32p4/**/*"
Expand Down Expand Up @@ -247,7 +248,7 @@ jobs:
# See https://hub.docker.com/r/espressif/idf/tags and
# https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/tools/idf-docker-image.html
# for details.
idf_ver: ["release-v5.4"]
idf_ver: ["release-v5.5"]
idf_target:
[
"esp32",
Expand Down
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# idf.py build

set(min_supported_idf_version "5.3.0")
set(max_supported_idf_version "5.4.99")
set(max_supported_idf_version "5.5.99")
set(idf_version "${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}.${IDF_VERSION_PATCH}")

if ("${idf_version}" AND NOT "$ENV{ARDUINO_SKIP_IDF_VERSION_CHECK}")
Expand Down Expand Up @@ -359,13 +359,13 @@ endforeach()
set(includedirs variants/${CONFIG_ARDUINO_VARIANT}/ cores/esp32/ ${ARDUINO_LIBRARIES_INCLUDEDIRS})
set(srcs ${CORE_SRCS} ${ARDUINO_LIBRARIES_SRCS})
set(priv_includes cores/esp32/libb64)
set(requires spi_flash esp_partition mbedtls wpa_supplicant esp_adc esp_eth http_parser esp_ringbuf esp_driver_gptimer esp_driver_usb_serial_jtag driver)
set(requires spi_flash esp_partition mbedtls wpa_supplicant esp_adc esp_eth http_parser esp_ringbuf esp_driver_gptimer esp_driver_usb_serial_jtag driver esp_http_client esp_https_ota)
set(priv_requires fatfs nvs_flash app_update spiffs bootloader_support bt esp_hid usb esp_psram ${ARDUINO_LIBRARIES_REQUIRES})

if(NOT CONFIG_ARDUINO_SELECTIVE_COMPILATION OR CONFIG_ARDUINO_SELECTIVE_OpenThread)
#if(CONFIG_SOC_IEEE802154_SUPPORTED) # Does not work!
#if(CONFIG_OPENTHREAD_ENABLED) # Does not work!
if(IDF_TARGET STREQUAL "esp32c6" OR IDF_TARGET STREQUAL "esp32h2") # Sadly only this works
if(IDF_TARGET STREQUAL "esp32c6" OR IDF_TARGET STREQUAL "esp32h2" OR IDF_TARGET STREQUAL "esp32c5") # Sadly only this works
list(APPEND requires openthread)
endif()
endif()
Expand Down
Loading
Loading