Skip to content

Commit e08b419

Browse files
committed
Merge branch 'release/v6.8.0'
2 parents 79b5a07 + 43e1b62 commit e08b419

File tree

10 files changed

+174
-36
lines changed

10 files changed

+174
-36
lines changed

boards/adafruit_feather_esp32s3_reversetft.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"-DARDUINO_ADAFRUIT_FEATHER_ESP32S3_REVTFT",
1111
"-DARDUINO_USB_CDC_ON_BOOT=1",
1212
"-DARDUINO_RUNNING_CORE=1",
13-
"-DARDUINO_EVENT_RUNNING_CORE=1"
13+
"-DARDUINO_EVENT_RUNNING_CORE=1",
14+
"-DBOARD_HAS_PSRAM"
1415
],
1516
"f_cpu": "240000000L",
1617
"f_flash": "80000000L",

boards/esp32-c6-devkitc-1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"name": "Espressif ESP32-C6-DevKitC-1",
1616
"upload": {
1717
"flash_size": "8MB",
18-
"maximum_ram_size": 524288,
18+
"maximum_ram_size": 327680,
1919
"maximum_size": 8388608,
2020
"require_upload_port": true,
2121
"speed": 460800

boards/m5stack-core-esp32-16M.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"build": {
3+
"arduino":{
4+
"ldscript": "esp32_out.ld"
5+
},
6+
"core": "esp32",
7+
"extra_flags": "-DARDUINO_M5Stack_Core_ESP32",
8+
"f_cpu": "240000000L",
9+
"f_flash": "80000000L",
10+
"flash_mode": "qio",
11+
"mcu": "esp32",
12+
"variant": "m5stack_core_esp32"
13+
},
14+
"connectivity": [
15+
"wifi",
16+
"bluetooth",
17+
"ethernet",
18+
"can"
19+
],
20+
"frameworks": [
21+
"arduino",
22+
"espidf"
23+
],
24+
"name": "M5Stack Core ESP32 16M",
25+
"upload": {
26+
"flash_size": "16MB",
27+
"maximum_ram_size": 532480,
28+
"maximum_size": 16777216,
29+
"require_upload_port": true,
30+
"speed": 460800
31+
},
32+
"url": "http://www.m5stack.com",
33+
"vendor": "M5Stack"
34+
}

builder/frameworks/espidf.py

Lines changed: 116 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -652,16 +652,30 @@ def generate_project_ld_script(sdk_config, ignore_targets=None):
652652
'--objdump "{objdump}"'
653653
).format(**args)
654654

655+
initial_ld_script = os.path.join(
656+
FRAMEWORK_DIR,
657+
"components",
658+
"esp_system",
659+
"ld",
660+
idf_variant,
661+
"sections.ld.in",
662+
)
663+
664+
if IDF5:
665+
initial_ld_script = preprocess_linker_file(
666+
initial_ld_script,
667+
os.path.join(
668+
BUILD_DIR,
669+
"esp-idf",
670+
"esp_system",
671+
"ld",
672+
"sections.ld.in",
673+
)
674+
)
675+
655676
return env.Command(
656677
os.path.join("$BUILD_DIR", "sections.ld"),
657-
os.path.join(
658-
FRAMEWORK_DIR,
659-
"components",
660-
"esp_system",
661-
"ld",
662-
idf_variant,
663-
"sections.ld.in",
664-
),
678+
initial_ld_script,
665679
env.VerboseAction(cmd, "Generating project linker script $TARGET"),
666680
)
667681

@@ -752,8 +766,8 @@ def compile_source_files(
752766
obj_path = os.path.join(obj_path, os.path.basename(src_path))
753767

754768
preserve_source_file_extension = board.get(
755-
"build.esp-idf.preserve_source_file_extension", True
756-
)
769+
"build.esp-idf.preserve_source_file_extension", "yes"
770+
) == "yes"
757771

758772
objects.append(
759773
build_envs[compile_group_idx].StaticObject(
@@ -999,12 +1013,38 @@ def find_default_component(target_configs):
9991013
env.Exit(1)
10001014

10011015

1016+
def get_framework_version():
1017+
def _extract_from_cmake_version_file():
1018+
version_cmake_file = os.path.join(
1019+
FRAMEWORK_DIR, "tools", "cmake", "version.cmake"
1020+
)
1021+
if not os.path.isfile(version_cmake_file):
1022+
return
1023+
1024+
with open(version_cmake_file, encoding="utf8") as fp:
1025+
pattern = r"set\(IDF_VERSION_(MAJOR|MINOR|PATCH) (\d+)\)"
1026+
matches = re.findall(pattern, fp.read())
1027+
if len(matches) != 3:
1028+
return
1029+
# If found all three parts of the version
1030+
return ".".join([match[1] for match in matches])
1031+
1032+
pkg = platform.get_package("framework-espidf")
1033+
version = get_original_version(str(pkg.metadata.version.truncate()))
1034+
if not version:
1035+
# Fallback value extracted directly from the cmake version file
1036+
version = _extract_from_cmake_version_file()
1037+
if not version:
1038+
version = "0.0.0"
1039+
1040+
return version
1041+
1042+
10021043
def create_version_file():
10031044
version_file = os.path.join(FRAMEWORK_DIR, "version.txt")
10041045
if not os.path.isfile(version_file):
10051046
with open(version_file, "w") as fp:
1006-
package_version = platform.get_package_version("framework-espidf")
1007-
fp.write(get_original_version(package_version) or package_version)
1047+
fp.write(get_framework_version())
10081048

10091049

10101050
def generate_empty_partition_image(binary_path, image_size):
@@ -1085,6 +1125,46 @@ def get_app_partition_offset(pt_table, pt_offset):
10851125
return app_params.get("offset", "0x10000")
10861126

10871127

1128+
def preprocess_linker_file(src_ld_script, target_ld_script):
1129+
return env.Command(
1130+
target_ld_script,
1131+
src_ld_script,
1132+
env.VerboseAction(
1133+
" ".join(
1134+
[
1135+
os.path.join(
1136+
platform.get_package_dir("tool-cmake"),
1137+
"bin",
1138+
"cmake",
1139+
),
1140+
"-DCC=%s"
1141+
% os.path.join(
1142+
TOOLCHAIN_DIR,
1143+
"bin",
1144+
"$CC",
1145+
),
1146+
"-DSOURCE=$SOURCE",
1147+
"-DTARGET=$TARGET",
1148+
"-DCONFIG_DIR=%s" % os.path.join(BUILD_DIR, "config"),
1149+
"-DLD_DIR=%s"
1150+
% os.path.join(
1151+
FRAMEWORK_DIR, "components", "esp_system", "ld"
1152+
),
1153+
"-P",
1154+
os.path.join(
1155+
"$BUILD_DIR",
1156+
"esp-idf",
1157+
"esp_system",
1158+
"ld",
1159+
"linker_script_generator.cmake",
1160+
),
1161+
]
1162+
),
1163+
"Generating LD script $TARGET",
1164+
),
1165+
)
1166+
1167+
10881168
def generate_mbedtls_bundle(sdk_config):
10891169
bundle_path = os.path.join("$BUILD_DIR", "x509_crt_bundle")
10901170
if os.path.isfile(env.subst(bundle_path)):
@@ -1236,7 +1316,7 @@ def get_idf_venv_dir():
12361316
# unnecessary reinstallation of Python dependencies in cases when Arduino
12371317
# as an IDF component requires a different version of the IDF package and
12381318
# hence a different set of Python deps or their versions
1239-
idf_version = get_original_version(platform.get_package_version("framework-espidf"))
1319+
idf_version = get_framework_version()
12401320
return os.path.join(
12411321
env.subst("$PROJECT_CORE_DIR"), "penv", ".espidf-" + idf_version
12421322
)
@@ -1330,19 +1410,30 @@ def get_python_exe():
13301410
#
13311411

13321412
if not board.get("build.ldscript", ""):
1333-
linker_script = env.Command(
1334-
os.path.join("$BUILD_DIR", "memory.ld"),
1335-
board.get(
1336-
"build.esp-idf.ldscript",
1413+
initial_ld_script = board.get("build.esp-idf.ldscript", os.path.join(
1414+
FRAMEWORK_DIR,
1415+
"components",
1416+
"esp_system",
1417+
"ld",
1418+
idf_variant,
1419+
"memory.ld.in",
1420+
))
1421+
1422+
if IDF5:
1423+
initial_ld_script = preprocess_linker_file(
1424+
initial_ld_script,
13371425
os.path.join(
1338-
FRAMEWORK_DIR,
1339-
"components",
1426+
BUILD_DIR,
1427+
"esp-idf",
13401428
"esp_system",
13411429
"ld",
1342-
idf_variant,
13431430
"memory.ld.in",
1344-
),
1345-
),
1431+
)
1432+
)
1433+
1434+
linker_script = env.Command(
1435+
os.path.join("$BUILD_DIR", "memory.ld"),
1436+
initial_ld_script,
13461437
env.VerboseAction(
13471438
'$CC -I"$BUILD_DIR/config" -I"%s" -C -P -x c -E $SOURCE -o $TARGET'
13481439
% os.path.join(FRAMEWORK_DIR, "components", "esp_system", "ld"),
@@ -1504,7 +1595,9 @@ def get_python_exe():
15041595

15051596
# Extra flags which need to be explicitly specified in LINKFLAGS section because SCons
15061597
# cannot merge them correctly
1507-
extra_flags = filter_args(link_args["LINKFLAGS"], ["-T", "-u"])
1598+
extra_flags = filter_args(
1599+
link_args["LINKFLAGS"], ["-T", "-u", "-Wl,--start-group", "-Wl,--end-group"]
1600+
)
15081601
link_args["LINKFLAGS"] = sorted(list(set(link_args["LINKFLAGS"]) - set(extra_flags)))
15091602

15101603
# remove the main linker script flags '-T memory.ld'

builder/frameworks/ulp.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
import os
16+
import sys
1617

1718
from platformio import fs
1819
from platformio.util import get_systype
@@ -60,7 +61,7 @@ def prepare_ulp_env_vars(env):
6061

6162
def collect_ulp_sources():
6263
return [
63-
fs.to_unix_path(os.path.join(ulp_env.subst("$PROJECT_DIR"), "ulp", f))
64+
os.path.join(ulp_env.subst("$PROJECT_DIR"), "ulp", f)
6465
for f in os.listdir(os.path.join(ulp_env.subst("$PROJECT_DIR"), "ulp"))
6566
if f.endswith((".c", ".S", ".s"))
6667
]
@@ -98,7 +99,7 @@ def _generate_ulp_configuration_action(env, target, source):
9899
"-riscv" if riscv_ulp_enabled else "",
99100
),
100101
),
101-
"-DULP_S_SOURCES=%s" % ";".join([s.get_abspath() for s in source]),
102+
"-DULP_S_SOURCES=%s" % ";".join([fs.to_unix_path(s.get_abspath()) for s in source]),
102103
"-DULP_APP_NAME=ulp_main",
103104
"-DCOMPONENT_DIR=" + os.path.join(ulp_env.subst("$PROJECT_DIR"), "ulp"),
104105
"-DCOMPONENT_INCLUDES=%s" % ";".join(get_component_includes(target_config)),
@@ -113,7 +114,12 @@ def _generate_ulp_configuration_action(env, target, source):
113114
os.path.join(FRAMEWORK_DIR, "components", "ulp", "cmake"),
114115
)
115116

116-
exec_command(cmd)
117+
print(555, cmd)
118+
119+
result = exec_command(cmd)
120+
if result["returncode"] != 0:
121+
sys.stderr.write(result["err"] + "\n")
122+
env.Exit(1)
117123

118124
ulp_sources = collect_ulp_sources()
119125
ulp_sources.sort()

builder/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def _to_unix_slashes(path):
204204
def fetch_fs_size(env):
205205
fs = None
206206
for p in _parse_partitions(env):
207-
if p["type"] == "data" and p["subtype"] in ("spiffs", "fat"):
207+
if p["type"] == "data" and p["subtype"] in ("spiffs", "fat", "littlefs"):
208208
fs = p
209209
if not fs:
210210
sys.stderr.write(

examples/espidf-hello-world/platformio.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ board = esp32-c3-devkitm-1
2323

2424
[env:esp32-c6-devkitc-1]
2525
board = esp32-c6-devkitc-1
26+
board_build.cmake_extra_args =
27+
-DSDKCONFIG_DEFAULTS="sdkconfig.defaults.esp32c6"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y
2+
CONFIG_ESPTOOLPY_FLASHSIZE="8MB"

platform.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"type": "git",
1919
"url": "https://github.com/platformio/platform-espressif32.git"
2020
},
21-
"version": "6.7.0",
21+
"version": "6.8.0",
2222
"frameworks": {
2323
"arduino": {
2424
"package": "framework-arduinoespressif32",
@@ -52,19 +52,19 @@
5252
"optional": true,
5353
"owner": "espressif",
5454
"version": "8.4.0+2021r2-patch5",
55-
"optionalVersions": ["13.2.0+20230928"]
55+
"optionalVersions": ["13.2.0+20240530"]
5656
},
5757
"toolchain-xtensa-esp-elf": {
5858
"type": "toolchain",
5959
"optional": true,
6060
"owner": "platformio",
61-
"version": "13.2.0+20230928"
61+
"version": "13.2.0+20240530"
6262
},
6363
"toolchain-esp32ulp": {
6464
"type": "toolchain",
6565
"optional": true,
6666
"owner": "platformio",
67-
"version": "~1.23500.0"
67+
"version": "~1.23800.0"
6868
},
6969
"tool-xtensa-esp-elf-gdb": {
7070
"type": "debugger",
@@ -82,13 +82,13 @@
8282
"type": "framework",
8383
"optional": true,
8484
"owner": "platformio",
85-
"version": "~3.20016.0"
85+
"version": "~3.20017.0"
8686
},
8787
"framework-espidf": {
8888
"type": "framework",
8989
"optional": true,
9090
"owner": "platformio",
91-
"version": "~3.50201.0",
91+
"version": "~3.50300.0",
9292
"optionalVersions": ["~3.40407.0"]
9393
},
9494
"tool-esptoolpy": {

platform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def configure_default_packages(self, variables, targets):
137137
self.packages["toolchain-riscv32-esp"]["owner"] = "platformio"
138138
self.packages["toolchain-riscv32-esp"][
139139
"version"
140-
] = "13.2.0+20230928"
140+
] = "13.2.0+20240530"
141141

142142
if "arduino" in frameworks:
143143
# Disable standalone GDB packages for Arduino and Arduino/IDF projects

0 commit comments

Comments
 (0)