Skip to content

Commit

Permalink
Platformio Arduino espressif32 v3.0.2 based on IDF 5.1.4 (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason2866 authored Jul 15, 2024
1 parent 68ad40f commit 9f33068
Show file tree
Hide file tree
Showing 139 changed files with 1,549 additions and 3,074 deletions.
21 changes: 0 additions & 21 deletions .github/stale.yml

This file was deleted.

28 changes: 17 additions & 11 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,48 @@
name: Examples

on: [push, pull_request]
on:
workflow_dispatch: # Manually start a workflow
push:
paths-ignore:
- '.github/**' # Ignore changes towards the .github directory
- '**.md' # Do no build if *.md files changes

jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-22.04, windows-2022, macos-14]
example:
- "examples/arduino-ble5-advertising"
- "examples/arduino-blink"
- "examples/arduino-rmt-blink"
- "examples/arduino-usb-keyboard"
- "examples/arduino-wifiscan"
- "examples/espidf-arduino-blink"
- "examples/espidf-arduino-wifiscan"
- "examples/espidf-ble-eddystone"
- "examples/espidf-arduino-littlefs"
- "examples/espidf-blink"
- "examples/espidf-coap-server"
- "examples/espidf-exceptions"
- "examples/espidf-hello-world"
- "examples/espidf-http-request"
- "examples/espidf-peripherals-uart"
- "examples/espidf-peripherals-usb"
- "examples/espidf-storage-sdcard"
- "examples/espidf-storage-spiffs"
- "examples/espidf-ulp-adc"
- "examples/espidf-ulp-pulse"
- "examples/espidf-ulp"
- "examples/espidf-ulp-riscv"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: "3.9"
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel
pip install -U https://github.com/platformio/platformio/archive/develop.zip
pio pkg install --global --platform symlink://.
- name: Build examples
Expand Down
30 changes: 0 additions & 30 deletions .github/workflows/tests.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.pyc
.DS_Store
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Espressif 32: development platform for [PlatformIO](https://platformio.org)
# Fork of Platformio Espressif 32: development platform for [PlatformIO](https://platformio.org)

[![Build Status](https://github.com/platformio/platform-espressif32/workflows/Examples/badge.svg)](https://github.com/platformio/platform-espressif32/actions)
[![Build Status](https://github.com/pioarduino/platform-espressif32/workflows/Examples/badge.svg)](https://github.com/pioarduino/platform-espressif32/actions)

ESP32 is a series of low-cost, low-power system on a chip microcontrollers with integrated Wi-Fi and Bluetooth. ESP32 integrates an antenna switch, RF balun, power amplifier, low-noise receive amplifier, filters, and power management modules.

Expand All @@ -13,14 +13,13 @@ ESP32 is a series of low-cost, low-power system on a chip microcontrollers with
2. Create PlatformIO project and configure a platform option in [platformio.ini](https://docs.platformio.org/page/projectconf.html) file:

## Stable version
espressif Arduino 3.0.2 and IDF 5.1.4

See `platform` [documentation](https://docs.platformio.org/en/latest/projectconf/sections/env/options/platform/platform.html#projectconf-env-platform) for details.

```ini
[env:stable]
; recommended to pin to a version, see https://github.com/platformio/platform-espressif32/releases
; platform = espressif32 @ ^6.0.1
platform = espressif32
platform = https://github.com/pioarduino/platform-espressif32/releases/download/2024.07.00/platform-espressif32.zip
board = ...
...
```
Expand All @@ -29,11 +28,11 @@ board = ...

```ini
[env:development]
platform = https://github.com/platformio/platform-espressif32.git
platform = https://github.com/pioarduino/platform-espressif32.git#Arduino/IDF51
board = ...
...
```

# Configuration

Please navigate to [documentation](https://docs.platformio.org/page/platforms/espressif32.html).
Please navigate to [documentation](https://docs.platformio.org/page/platforms/espressif32.html).
3 changes: 1 addition & 2 deletions boards/4d_systems_esp32s3_gen4_r8n16.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld",
"memory_type": "qio_opi",
"partitions": "default_16MB.csv"
"partitions": "esp_sr_16.csv"
},
"core": "esp32",
"extra_flags": [
Expand Down
30 changes: 30 additions & 0 deletions boards/esp32-c2-devkitm-1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"build": {
"core": "esp32",
"f_cpu": "120000000L",
"f_flash": "60000000L",
"flash_mode": "qio",
"mcu": "esp32c2",
"variant": "esp32c2"
},
"connectivity": [
"wifi"
],
"debug": {
"openocd_target": "esp32c2.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "Espressif ESP32-C2-DevKitM-1",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 278528,
"maximum_size": 4194304,
"require_upload_port": true,
"speed": 460800
},
"url": "https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp8684/esp8684-devkitm-1/user_guide.html",
"vendor": "Espressif"
}
7 changes: 6 additions & 1 deletion boards/esp32-c6-devkitc-1.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@
"f_cpu": "160000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"mcu": "esp32c6"
"mcu": "esp32c6",
"variant": "esp32c6"
},
"connectivity": [
"wifi"
],
"debug": {
"openocd_target": "esp32c6.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "Espressif ESP32-C6-DevKitC-1",
Expand Down
1 change: 1 addition & 0 deletions boards/esp32-c6-devkitm-1.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"openocd_target": "esp32c6.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "Espressif ESP32-C6-DevKitM-1",
Expand Down
38 changes: 38 additions & 0 deletions boards/esp32-h2-devkitm-1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"build": {
"core": "esp32",
"f_cpu": "96000000L",
"f_flash": "64000000L",
"f_image": "48000000L",
"flash_mode": "qio",
"mcu": "esp32h2",
"variant": "esp32h2",
"hwids": [
[
"0x303A",
"0x1001"
]
]
},
"connectivity": [
"bluetooth",
"zigbee"
],
"debug": {
"openocd_target": "esp32h2.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "Espressif ESP32-H2-DevKit",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 327680,
"maximum_size": 4194304,
"require_upload_port": true,
"speed": 460800
},
"url": "https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp32h2/esp32-h2-devkitm-1/index.html",
"vendor": "Espressif"
}
37 changes: 37 additions & 0 deletions boards/esp32-solo1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"build": {
"arduino":{
"ldscript": "esp32_out.ld"
},
"core": "esp32",
"extra_flags": "-DARDUINO_ESP32_DEV -DARDUINO_USB_CDC_ON_BOOT=0 -DCORE32SOLO1",
"f_cpu": "80000000L",
"f_flash": "40000000L",
"flash_mode": "dio",
"mcu": "esp32",
"variant": "esp32"
},
"connectivity": [
"wifi",
"bluetooth",
"ethernet",
"can"
],
"debug": {
"openocd_target": "esp32-solo-1.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "Espressif Generic ESP32-solo1 4M Flash",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 327680,
"maximum_size": 4194304,
"require_upload_port": true,
"speed": 460800
},
"url": "https://en.wikipedia.org/wiki/ESP32",
"vendor": "Espressif"
}
6 changes: 3 additions & 3 deletions builder/frameworks/_embed_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,14 @@ def transform_to_asm(target, source, env):
" ".join(
[
"riscv32-esp-elf-objcopy"
if mcu in ("esp32c3", "esp32c6")
if mcu in ("esp32c2","esp32c3","esp32c6","esp32h2")
else "xtensa-%s-elf-objcopy" % mcu,
"--input-target",
"binary",
"--output-target",
"elf32-littleriscv" if mcu in ("esp32c3","esp32c6") else "elf32-xtensa-le",
"elf32-littleriscv" if mcu in ("esp32c2","esp32c3","esp32c6","esp32h2") else "elf32-xtensa-le",
"--binary-architecture",
"riscv" if mcu in ("esp32c3","esp32c6") else "xtensa",
"riscv" if mcu in ("esp32c2","esp32c3","esp32c6","esp32h2") else "xtensa",
"--rename-section",
".data=.rodata.embedded",
"$SOURCE",
Expand Down
1 change: 0 additions & 1 deletion builder/frameworks/arduino.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,3 @@
SConscript(
join(DefaultEnvironment().PioPlatform().get_package_dir(
"framework-arduinoespressif32"), "tools", "platformio-build.py"))
env["INTEGRATION_EXTRA_DATA"].update({"application_offset": env.subst("$ESP32_APP_OFFSET")})
21 changes: 7 additions & 14 deletions builder/frameworks/espidf.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,7 @@
IDF_ENV_VERSION = "1.0.0"
FRAMEWORK_DIR = platform.get_package_dir("framework-espidf")
TOOLCHAIN_DIR = platform.get_package_dir(
"toolchain-riscv32-esp"
if mcu in ("esp32c3", "esp32c6")
else (
(
"toolchain-xtensa-esp-elf"
if "arduino" not in env.subst("$PIOFRAMEWORK")
else "toolchain-xtensa-%s" % mcu
)
)
"toolchain-%s" % ("riscv32-esp" if mcu in ("esp32c2", "esp32c3", "esp32c6", "esp32h2") else ("xtensa-%s" % mcu))
)


Expand All @@ -91,7 +83,7 @@
):
print("Warning! Debugging an IDF project requires PlatformIO Core >= 6.1.11!")

# Arduino framework as a component is not compatible with ESP-IDF >=4.1
# Arduino framework as a component is not compatible with ESP-IDF >5.2
if "arduino" in env.subst("$PIOFRAMEWORK"):
ARDUINO_FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoespressif32")
# Possible package names in 'package@version' format is not compatible with CMake
Expand Down Expand Up @@ -256,7 +248,7 @@ def populate_idf_env_vars(idf_env):
os.path.dirname(get_python_exe()),
]

if mcu not in ("esp32c3", "esp32c6"):
if mcu not in ("esp32c2", "esp32c3", "esp32c6","esp32h2"):
additional_packages.append(
os.path.join(platform.get_package_dir("toolchain-esp32ulp"), "bin"),
)
Expand Down Expand Up @@ -511,7 +503,7 @@ def extract_linker_script_fragments_backup(framework_components_dir, sdk_config)
sys.stderr.write("Error: Failed to extract paths to linker script fragments\n")
env.Exit(1)

if mcu in ("esp32c3", "esp32c6"):
if mcu in ("esp32c2", "esp32c3", "esp32c6", "esp32h2"):
result.append(os.path.join(framework_components_dir, "riscv", "linker.lf"))

# Add extra linker fragments
Expand Down Expand Up @@ -1201,6 +1193,7 @@ def _get_installed_pip_packages(python_exe_path):
return

deps = {
"wheel": ">=0.35.1",
# https://github.com/platformio/platformio-core/issues/4614
"urllib3": "<2",
# https://github.com/platformio/platform-espressif32/issues/635
Expand Down Expand Up @@ -1606,7 +1599,7 @@ def _skip_prj_source_files(node):
(
board.get(
"upload.bootloader_offset",
"0x0" if mcu in ("esp32c3", "esp32c6", "esp32s3") else "0x1000",
"0x0" if mcu in ("esp32c2", "esp32c3", "esp32c6", "esp32s3", "esp32h2") else "0x1000",
),
os.path.join("$BUILD_DIR", "bootloader.bin"),
),
Expand Down Expand Up @@ -1717,7 +1710,7 @@ def _skip_prj_source_files(node):
#

ulp_dir = os.path.join(PROJECT_DIR, "ulp")
if os.path.isdir(ulp_dir) and os.listdir(ulp_dir) and mcu not in ("esp32c3", "esp32c6"):
if os.path.isdir(ulp_dir) and os.listdir(ulp_dir) and mcu not in ("esp32c2", "esp32c3", "esp32c6", "esp32h2"):
env.SConscript("ulp.py", exports="env sdk_config project_config idf_variant")

#
Expand Down
Loading

0 comments on commit 9f33068

Please sign in to comment.