Skip to content

Commit

Permalink
Tasmota Arduino Core 3.1.0.240926
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason2866 authored Sep 26, 2024
1 parent ca8f5c6 commit 5e7ceeb
Show file tree
Hide file tree
Showing 11 changed files with 123 additions and 214 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install wheel
pip install -U https://github.com/Jason2866/platformio-core/archive/refs/tags/v6.1.16+free.zip
pip install -U https://github.com/Jason2866/platformio-core/archive/refs/tags/v6.1.16.tar.gz
pio pkg install --global --platform symlink://.
- name: git clone Tasmota and add to examples
if: "matrix.example == 'examples/tasmota' && matrix.os != 'windows-2022'"
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ Espressif Systems is a privately held fabless semiconductor company. They provid
1. [Install PlatformIO](http://platformio.org)
2. Create PlatformIO project and configure a platform option in [platformio.ini](http://docs.platformio.org/page/projectconf.html) file:

### Tasmota release Arduino 3.0.5 / IDF 5.1.4+

### Tasmota release Arduino 3.1.0.240926 and IDF 5.3.1+
Support for the ESP32/ESP32solo1, ESP32C2, ESP32C3, ESP32C6, ESP32S2, ESP32S3 and ESP32-H2
```
[platformio]
platform = https://github.com/tasmota/platform-espressif32/releases/download/2024.09.10/platform-espressif32.zip
platform = https://github.com/tasmota/platform-espressif32/releases/download/2024.09.30/platform-espressif32.zip
framework = arduino
```
to use the ESP32 Solo1 Arduino framework add in your env
Expand Down
34 changes: 34 additions & 0 deletions boards/esp32-p4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"build": {
"core": "esp32",
"extra_flags": [
"-DBOARD_HAS_PSRAM"
],
"f_cpu": "360000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"mcu": "esp32p4",
"variant": "esp32p4"
},
"connectivity": [
"bluetooth",
"openthread"
],
"debug": {
"openocd_target": "esp32p4.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "Espressif ESP32-P4 generic",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 327680,
"maximum_size": 4194304,
"require_upload_port": true,
"speed": 460800
},
"url": "https://docs.espressif.com",
"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 ("esp32c2","esp32c3","esp32c6","esp32h2")
if mcu in ("esp32c2","esp32c3","esp32c6","esp32h2","esp32p4")
else "xtensa-%s-elf-objcopy" % mcu,
"--input-target",
"binary",
"--output-target",
"elf32-littleriscv" if mcu in ("esp32c2","esp32c3","esp32c6","esp32h2") else "elf32-xtensa-le",
"elf32-littleriscv" if mcu in ("esp32c2","esp32c3","esp32c6","esp32h2","esp32p4") else "elf32-xtensa-le",
"--binary-architecture",
"riscv" if mcu in ("esp32c2","esp32c3","esp32c6","esp32h2") else "xtensa",
"riscv" if mcu in ("esp32c2","esp32c3","esp32c6","esp32h2","esp32p4") else "xtensa",
"--rename-section",
".data=.rodata.embedded",
"$SOURCE",
Expand Down
61 changes: 47 additions & 14 deletions builder/frameworks/espidf.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@
IDF_ENV_VERSION = "1.0.0"
FRAMEWORK_DIR = platform.get_package_dir("framework-espidf")
TOOLCHAIN_DIR = platform.get_package_dir(
"toolchain-%s" % ("riscv32-esp" if mcu in ("esp32c2", "esp32c3", "esp32c6", "esp32h2") else ("xtensa-%s" % mcu))
"toolchain-xtensa-esp-elf"
if mcu in ("esp32", "esp32s2", "esp32s3")
else "toolchain-riscv32-esp"
)


Expand Down Expand Up @@ -250,12 +252,6 @@ def populate_idf_env_vars(idf_env):
os.path.dirname(get_python_exe()),
]

# if mcu in ("esp32", "esp32s2", "esp32s3"):
# additional_packages.append(
# os.path.join(platform.get_package_dir("toolchain-esp32ulp"), "bin"),
# )


idf_env["PATH"] = os.pathsep.join(additional_packages + [idf_env["PATH"]])

# Some users reported that the `IDF_TOOLS_PATH` var can seep into the
Expand Down Expand Up @@ -507,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 ("esp32c2", "esp32c3", "esp32c6", "esp32h2", "esp32p4"):
if mcu not in ("esp32", "esp32s2", "esp32s3"):
result.append(os.path.join(framework_components_dir, "riscv", "linker.lf"))

# Add extra linker fragments
Expand Down Expand Up @@ -1662,7 +1658,7 @@ def _skip_prj_source_files(node):
(
board.get(
"upload.bootloader_offset",
"0x0" if mcu in ["esp32c2", "esp32c3", "esp32c6", "esp32s3", "esp32h2"] else ("0x2000" if mcu in ["esp32p4"] else "0x1000"),
"0x1000" if mcu in ["esp32", "esp32s2"] else ("0x2000" if mcu in ["esp32p4"] else "0x0"),
),
os.path.join("$BUILD_DIR", "bootloader.bin"),
),
Expand Down Expand Up @@ -1802,17 +1798,54 @@ def _skip_prj_source_files(node):
]
)

def _parse_size(value):
if isinstance(value, int):
return value
elif value.isdigit():
return int(value)
elif value.startswith("0x"):
return int(value, 16)
elif value[-1].upper() in ("K", "M"):
base = 1024 if value[-1].upper() == "K" else 1024 * 1024
return int(value[:-1]) * base
return value

#
# Configure application partition offset
#

env.Replace(
ESP32_APP_OFFSET=get_app_partition_offset(
env.subst("$PARTITIONS_TABLE_CSV"), partition_table_offset
)
)
partitions_csv = env.subst("$PARTITIONS_TABLE_CSV")
result = []
next_offset = 0
bound = int(board.get("upload.offset_address", "0x10000"), 16) # default 0x10000
with open(partitions_csv) as fp:
for line in fp.readlines():
line = line.strip()
if not line or line.startswith("#"):
continue
tokens = [t.strip() for t in line.split(",")]
if len(tokens) < 5:
continue
partition = {
"name": tokens[0],
"type": tokens[1],
"subtype": tokens[2],
"offset": tokens[3] or next_offset,
"size": tokens[4],
"flags": tokens[5] if len(tokens) > 5 else None
}
result.append(partition)
next_offset = _parse_size(partition["offset"])
if (partition["subtype"] == "ota_0"):
bound = next_offset
next_offset = (next_offset + bound - 1) & ~(bound - 1)

env.Replace(ESP32_APP_OFFSET=str(hex(bound)))

#
# Propagate application offset to debug configurations
#

env["INTEGRATION_EXTRA_DATA"].update(
{"application_offset": env.subst("$ESP32_APP_OFFSET")}
)
5 changes: 2 additions & 3 deletions builder/frameworks/ulp.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def prepare_ulp_env_vars(env):
ulp_env.PrependENVPath("IDF_PATH", FRAMEWORK_DIR)

toolchain_path = platform.get_package_dir(
"toolchain-xtensa-%s" % idf_variant
"toolchain-xtensa-esp-elf"
if idf_variant not in ("esp32c6", "esp32p4")
else "toolchain-riscv32-esp"
)
Expand Down Expand Up @@ -116,8 +116,7 @@ def _generate_ulp_configuration_action(env, target, source):
"-DIDF_PATH=" + fs.to_unix_path(FRAMEWORK_DIR),
"-DSDKCONFIG_HEADER=" + os.path.join(BUILD_DIR, "config", "sdkconfig.h"),
"-DPYTHON=" + env.subst("$PYTHONEXE"),
"-DULP_COCPU_IS_RISCV=%s" % ("ON" if riscv_ulp_enabled else "OFF"),
"-DULP_COCPU_IS_LP_CORE=%s" % ("ON" if lp_core_ulp_enabled else "OFF"),
"-DSDKCONFIG_CMAKE=" + os.path.join(BUILD_DIR, "config", "sdkconfig.cmake"),
"-GNinja",
"-B",
ULP_BUILD_DIR,
Expand Down
4 changes: 2 additions & 2 deletions builder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def __fetch_fs_size(target, source, env):
mcu = board.get("build.mcu", "esp32")
toolchain_arch = "xtensa-%s" % mcu
filesystem = board.get("build.filesystem", "littlefs")
if mcu in ("esp32c2", "esp32c3", "esp32c6", "esp32h2"):
if mcu in ("esp32c2", "esp32c3", "esp32c6", "esp32h2", "esp32p4"):
toolchain_arch = "riscv32-esp"

if "INTEGRATION_EXTRA_DATA" not in env:
Expand All @@ -261,7 +261,7 @@ def __fetch_fs_size(target, source, env):
GDB=join(
platform.get_package_dir(
"tool-riscv32-esp-elf-gdb"
if mcu in ("esp32c2", "esp32c3", "esp32c6", "esp32h2")
if mcu in ("esp32c2", "esp32c3", "esp32c6", "esp32h2", "esp32p4")
else "tool-xtensa-esp-elf-gdb"
)
),
Expand Down
6 changes: 6 additions & 0 deletions examples/arduino-blink/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,9 @@ platform = espressif32
framework = arduino
board = esp32-h2-devkitm-1
monitor_speed = 115200

[env:esp32-p4]
platform = espressif32
framework = arduino
board = esp32-p4
monitor_speed = 115200
1 change: 0 additions & 1 deletion examples/espidf-blink/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ framework = espidf
board = esp32dev
monitor_speed = 115200
build_flags =
; https://docs.espressif.com/projects/esp-idf/en/latest/get-started/get-started-wrover-kit.html#rgb-led
-D CONFIG_BLINK_GPIO=2
-D CONFIG_BLINK_LED_GPIO=2
-D CONFIG_BLINK_PERIOD=1000
Expand Down
40 changes: 14 additions & 26 deletions platform.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
"RISC-V"
],
"engines": {
"platformio": ">=6.1.14"
"platformio": ">=6.1.15"
},
"repository": {
"type": "git",
"url": "https://github.com/tasmota/platform-espressif32.git"
},
"version": "2024.09.10",
"version": "2024.09.30",
"frameworks": {
"arduino": {
"script": "builder/frameworks/arduino.py"
Expand All @@ -33,55 +33,43 @@
"type": "framework",
"optional": true,
"owner": "tasmota",
"version": "https://github.com/tasmota/arduino-esp32/releases/download/3.0.5/framework-arduinoespressif32.zip"
"version": "https://github.com/tasmota/arduino-esp32/releases/download/v3.1.0.240926/framework-arduinoespressif32.zip"
},
"framework-arduino-solo1": {
"type": "framework",
"optional": true,
"owner": "tasmota",
"version": "https://github.com/tasmota/arduino-esp32/releases/download/3.0.5/framework-arduinoespressif32-solo1.zip"
"version": "https://github.com/tasmota/arduino-esp32/releases/download/v3.1.0.240926/framework-arduinoespressif32-solo1.zip"
},
"framework-arduino-ITEAD": {
"type": "framework",
"optional": true,
"owner": "tasmota",
"version": "https://github.com/tasmota/arduino-esp32/releases/download/3.0.5/framework-arduinoespressif32-ITEAD.zip"
"version": "https://github.com/tasmota/arduino-esp32/releases/download/v3.1.0.240926/framework-arduinoespressif32-ITEAD.zip"
},
"framework-espidf": {
"type": "framework",
"optional": true,
"owner": "tasmota",
"version": "https://github.com/tasmota/esp-idf/releases/download/v5.1.4.240912/esp-idf-v5.1.4.zip"
"owner": "Jason2866",
"version": "https://github.com/tasmota/esp-idf/releases/download/v5.3.1.240924/esp-idf-v5.3.1.zip"
},
"toolchain-xtensa-esp32": {
"toolchain-xtensa-esp-elf": {
"type": "toolchain",
"optional": true,
"owner": "espressif",
"version": "12.2.0+20230208"
},
"toolchain-xtensa-esp32s2": {
"type": "toolchain",
"optional": true,
"owner": "espressif",
"version": "12.2.0+20230208"
},
"toolchain-xtensa-esp32s3": {
"type": "toolchain",
"optional": true,
"owner": "espressif",
"version": "12.2.0+20230208"
"owner": "platformio",
"version": "13.2.0+20240530"
},
"toolchain-riscv32-esp": {
"type": "toolchain",
"optional": true,
"owner": "espressif",
"version": "12.2.0+20230208"
"owner": "platformio",
"version": "13.2.0+20240530"
},
"toolchain-esp32ulp": {
"type": "toolchain",
"optional": true,
"owner": "platformio",
"version": "~1.23500.0"
"version": "~1.23800.0"
},
"tool-xtensa-esp-elf-gdb": {
"type": "debugger",
Expand All @@ -98,7 +86,7 @@
"tool-esptoolpy": {
"type": "uploader",
"owner": "tasmota",
"version": "https://github.com/tasmota/esptool/releases/download/v4.7.6/esptool.zip"
"version": "https://github.com/Jason2866/esptool/releases/download/v4.8.0/esptool.zip"
},
"tool-dfuutil-arduino": {
"type": "uploader",
Expand Down
Loading

0 comments on commit 5e7ceeb

Please sign in to comment.