Skip to content

Commit cdf9bfd

Browse files
committed
Merge branch 'release/v6.0.0'
2 parents c7e0e37 + 1b54fc7 commit cdf9bfd

File tree

582 files changed

+145627
-353
lines changed

Some content is hidden

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

582 files changed

+145627
-353
lines changed

boards/adafruit_feather_esp32s3.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"build": {
33
"arduino":{
44
"ldscript": "esp32s3_out.ld",
5-
"partitions": "partitions.csv"
5+
"partitions": "partitions-4MB-tinyuf2.csv"
66
},
77
"core": "esp32",
88
"extra_flags": [

boards/adafruit_feather_esp32s3_nopsram.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"build": {
33
"arduino":{
44
"ldscript": "esp32s3_out.ld",
5+
"partitions": "partitions-4MB-tinyuf2.csv",
56
"memory_type": "qio_qspi"
67
},
78
"core": "esp32",

boards/adafruit_feather_esp32s3_tft.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"build": {
33
"arduino": {
44
"ldscript": "esp32s3_out.ld",
5-
"partitions": "partitions.csv"
5+
"partitions": "partitions-4MB-tinyuf2.csv"
66
},
77
"core": "esp32",
88
"extra_flags": [

boards/deneyapminiv2.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"ldscript": "esp32s2_out.ld"
55
},
66
"core": "esp32",
7-
"extra_flags": "-",
87
"extra_flags": [
98
"-DBOARD_HAS_PSRAM",
109
"-DARDUINO_DYMv2",

builder/frameworks/espidf.py

Lines changed: 64 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import subprocess
2626
import sys
2727
import os
28+
import pkg_resources
2829

2930
import click
3031
import semantic_version
@@ -49,6 +50,9 @@
4950
mcu = board.get("build.mcu", "esp32")
5051
idf_variant = mcu.lower()
5152

53+
# Required until Arduino switches to v5
54+
IDF5 = platform.get_package_version(
55+
"framework-espidf").split(".")[1].startswith("5")
5256
FRAMEWORK_DIR = platform.get_package_dir("framework-espidf")
5357
TOOLCHAIN_DIR = platform.get_package_dir(
5458
"toolchain-%s" % ("riscv32-esp" if mcu == "esp32c3" else ("xtensa-%s" % mcu))
@@ -576,6 +580,16 @@ def generate_project_ld_script(sdk_config, ignore_targets=None):
576580
)
577581

578582

583+
# A temporary workaround to avoid modifying CMake mainly for the "heap" library.
584+
# The "tlsf.c" source file in this library has an include flag relative
585+
# to CMAKE_CURRENT_SOURCE_DIR which breaks PlatformIO builds that have a
586+
# different working directory
587+
def _fix_component_relative_include(config, build_flags, source_index):
588+
source_file_path = config["sources"][source_index]["path"]
589+
build_flags = build_flags.replace("..", os.path.dirname(source_file_path) + "/..")
590+
return build_flags
591+
592+
579593
def prepare_build_envs(config, default_env, debug_allowed=True):
580594
build_envs = []
581595
target_compile_groups = config.get("compileGroups")
@@ -597,6 +611,10 @@ def prepare_build_envs(config, default_env, debug_allowed=True):
597611
for cc in compile_commands:
598612
build_flags = cc.get("fragment")
599613
if not build_flags.startswith("-D"):
614+
if build_flags.startswith("-include") and ".." in build_flags:
615+
source_index = cg.get("sourceIndexes")[0]
616+
build_flags = _fix_component_relative_include(
617+
config, build_flags, source_index)
600618
build_env.AppendUnique(**build_env.ParseFlags(build_flags))
601619
build_env.AppendUnique(CPPDEFINES=defines, CPPPATH=includes)
602620
if sys_includes:
@@ -639,9 +657,17 @@ def compile_source_files(
639657
else:
640658
obj_path = os.path.join(obj_path, os.path.basename(src_path))
641659

660+
preserve_source_file_extension = board.get(
661+
"build.esp-idf.preserve_source_file_extension", False
662+
)
663+
642664
objects.append(
643665
build_envs[compile_group_idx].StaticObject(
644-
target=os.path.splitext(obj_path)[0] + ".o",
666+
target=(
667+
obj_path
668+
if preserve_source_file_extension
669+
else os.path.splitext(obj_path)[0]
670+
) + ".o",
645671
source=os.path.realpath(src_path),
646672
)
647673
)
@@ -1029,7 +1055,14 @@ def _get_installed_pip_packages():
10291055
result = {}
10301056
packages = {}
10311057
pip_output = subprocess.check_output(
1032-
[env.subst("$PYTHONEXE"), "-m", "pip", "list", "--format=json"]
1058+
[
1059+
env.subst("$PYTHONEXE"),
1060+
"-m",
1061+
"pip",
1062+
"list",
1063+
"--format=json",
1064+
"--disable-pip-version-check",
1065+
]
10331066
)
10341067
try:
10351068
packages = json.loads(pip_output)
@@ -1047,15 +1080,19 @@ def _get_installed_pip_packages():
10471080
"future": ">=0.15.2",
10481081
"pyparsing": ">=2.0.3,<2.4.0",
10491082
"kconfiglib": "==13.7.1",
1050-
"idf-component-manager": "~=1.0"
1083+
"idf-component-manager": "~=1.0",
10511084
}
10521085

1086+
if IDF5:
1087+
# Remove specific versions for IDF5 as not required
1088+
deps = {dep: "" for dep in deps}
1089+
10531090
installed_packages = _get_installed_pip_packages()
10541091
packages_to_install = []
10551092
for package, spec in deps.items():
10561093
if package not in installed_packages:
10571094
packages_to_install.append(package)
1058-
else:
1095+
elif spec:
10591096
version_spec = semantic_version.Spec(spec)
10601097
if not version_spec.match(installed_packages[package]):
10611098
packages_to_install.append(package)
@@ -1064,21 +1101,34 @@ def _get_installed_pip_packages():
10641101
env.Execute(
10651102
env.VerboseAction(
10661103
(
1067-
'"$PYTHONEXE" -m pip install -U --force-reinstall '
1068-
+ " ".join(['"%s%s"' % (p, deps[p]) for p in packages_to_install])
1104+
'"$PYTHONEXE" -m pip install -U '
1105+
+ " ".join(
1106+
[
1107+
'"%s%s"' % (p, deps[p])
1108+
for p in packages_to_install
1109+
]
1110+
)
10691111
),
10701112
"Installing ESP-IDF's Python dependencies",
10711113
)
10721114
)
10731115

1074-
# a special "esp-windows-curses" python package is required on Windows for Menuconfig
1075-
if "windows" in get_systype():
1076-
import pkg_resources
1116+
if "windows" in get_systype() and "windows-curses" not in installed_packages:
1117+
env.Execute(
1118+
env.VerboseAction(
1119+
"$PYTHONEXE -m pip install windows-curses",
1120+
"Installing windows-curses package",
1121+
)
1122+
)
10771123

1078-
if "esp-windows-curses" not in {pkg.key for pkg in pkg_resources.working_set}:
1124+
# A special "esp-windows-curses" python package is required on Windows
1125+
# for Menuconfig on IDF <5
1126+
if not IDF5 and "esp-windows-curses" not in {
1127+
pkg.key for pkg in pkg_resources.working_set
1128+
}:
10791129
env.Execute(
10801130
env.VerboseAction(
1081-
'$PYTHONEXE -m pip install "file://%s/tools/kconfig_new/esp-windows-curses" windows-curses'
1131+
'$PYTHONEXE -m pip install "file://%s/tools/kconfig_new/esp-windows-curses"'
10821132
% FRAMEWORK_DIR,
10831133
"Installing windows-curses package",
10841134
)
@@ -1471,4 +1521,6 @@ def _skip_prj_source_files(node):
14711521
)
14721522

14731523
# Propagate application offset to debug configurations
1474-
env["INTEGRATION_EXTRA_DATA"].update({"application_offset": env.subst("$ESP32_APP_OFFSET")})
1524+
env["INTEGRATION_EXTRA_DATA"].update(
1525+
{"application_offset": env.subst("$ESP32_APP_OFFSET")}
1526+
)

builder/frameworks/ulp.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,10 @@ def get_component_includes(target_config):
7777

7878

7979
def generate_ulp_config(target_config):
80-
riscv_ulp_enabled = sdk_config.get("ESP32S2_ULP_COPROC_RISCV", False)
80+
riscv_ulp_enabled = sdk_config.get("ULP_COPROC_TYPE_RISCV", False)
8181

8282
ulp_sources = collect_ulp_sources()
83+
ulp_sources.sort()
8384
cmd = (
8485
os.path.join(platform.get_package_dir("tool-cmake"), "bin", "cmake"),
8586
"-DCMAKE_GENERATOR=Ninja",
@@ -89,8 +90,8 @@ def generate_ulp_config(target_config):
8990
"components",
9091
"ulp",
9192
"cmake",
92-
"toolchain-%s-ulp%s.cmake"
93-
% (idf_variant, "-riscv" if riscv_ulp_enabled else ""),
93+
"toolchain-%sulp%s.cmake"
94+
% ("" if riscv_ulp_enabled else idf_variant + "-", "-riscv" if riscv_ulp_enabled else ""),
9495
),
9596
'-DULP_S_SOURCES="%s"' % ";".join(ulp_sources),
9697
"-DULP_APP_NAME=ulp_main",

builder/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ def __fetch_fs_size(target, source, env):
261261
action=env.VerboseAction(" ".join([
262262
'"$PYTHONEXE" "$OBJCOPY"',
263263
"--chip", mcu, "elf2image",
264-
"--flash_mode", "$BOARD_FLASH_MODE",
264+
"--flash_mode", "${__get_board_flash_mode(__env__)}",
265265
"--flash_freq", "${__get_board_f_flash(__env__)}",
266266
"--flash_size", board.get("upload.flash_size", "4MB"),
267267
"-o", "$TARGET", "$SOURCES"

examples/espidf-aws-iot/platformio.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,9 @@ board_build.embed_txtfiles =
1818
src/certs/private.pem.key
1919
src/certs/certificate.pem.crt
2020
src/certs/aws-root-ca.pem
21+
22+
# IDF v5 is not supported by ASW-IoT SDK
23+
# https://github.com/espressif/esp-aws-iot/blob/bbaf03d7d1fbf8a3f91dc18489d7bd27d5b9e9df/README.md?plain=1#L21
24+
platform_packages =
25+
framework-espidf @ ~3.40403.0
26+
toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
idf_component_register(SRCS "esp_eddystone_api.c"
22
"esp_eddystone_demo.c"
3-
INCLUDE_DIRS "")
3+
INCLUDE_DIRS "")
4+
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")

examples/espidf-ble-eddystone/src/esp_eddystone_api.c

Lines changed: 32 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
/*
2-
This example code is in the Public Domain (or CC0 licensed, at your option.)
3-
4-
Unless required by applicable law or agreed to in writing, this
5-
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
6-
CONDITIONS OF ANY KIND, either express or implied.
7-
*/
2+
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
3+
*
4+
* SPDX-License-Identifier: Unlicense OR CC0-1.0
5+
*/
86

97

108
/****************************************************************************
@@ -62,21 +60,21 @@ Byte offset Field Description
6260
0 Frame Type Value = 0x00
6361
1 Ranging Data Calibrated Tx power at 0 m
6462
2 NID[0] 10-byte Namespace
65-
3 NID[1]
66-
4 NID[2]
67-
5 NID[3]
68-
6 NID[4]
69-
7 NID[5]
70-
8 NID[6]
71-
9 NID[7]
72-
10 NID[8]
73-
11 NID[9]
63+
3 NID[1]
64+
4 NID[2]
65+
5 NID[3]
66+
6 NID[4]
67+
7 NID[5]
68+
8 NID[6]
69+
9 NID[7]
70+
10 NID[8]
71+
11 NID[9]
7472
12 BID[0] 6-byte Instance
75-
13 BID[1]
76-
14 BID[2]
77-
15 BID[3]
78-
16 BID[4]
79-
17 BID[5]
73+
13 BID[1]
74+
14 BID[2]
75+
15 BID[3]
76+
16 BID[4]
77+
17 BID[5]
8078
18 RFU Reserved for future use, must be0x00
8179
19 RFU Reserved for future use, must be0x00
8280
*********************************************/
@@ -135,7 +133,7 @@ static esp_err_t esp_eddystone_url_received(const uint8_t* buf, uint8_t len, esp
135133
//ERROR:too long url
136134
return -1;
137135
}
138-
res->inform.url.tx_power = buf[pos++];
136+
res->inform.url.tx_power = buf[pos++];
139137
url_res = esp_eddystone_resolve_url_scheme(buf+pos, buf+len-1);
140138
memcpy(&res->inform.url.url, url_res, strlen(url_res));
141139
res->inform.url.url[strlen(url_res)] = '\0';
@@ -148,17 +146,17 @@ Byte offset Field Description
148146
0 Frame Type Value = 0x20
149147
1 Version TLM version, value = 0x00
150148
2 VBATT[0] Battery voltage, 1 mV/bit
151-
3 VBATT[1]
149+
3 VBATT[1]
152150
4 TEMP[0] Beacon temperature
153-
5 TEMP[1]
151+
5 TEMP[1]
154152
6 ADV_CNT[0] Advertising PDU count
155-
7 ADV_CNT[1]
156-
8 ADV_CNT[2]
157-
9 ADV_CNT[3]
153+
7 ADV_CNT[1]
154+
8 ADV_CNT[2]
155+
9 ADV_CNT[3]
158156
10 SEC_CNT[0] Time since power-on or reboot
159-
11 SEC_CNT[1]
160-
12 SEC_CNT[2]
161-
13 SEC_CNT[3]
157+
11 SEC_CNT[1]
158+
12 SEC_CNT[2]
159+
13 SEC_CNT[3]
162160
************************************************/
163161
/* decode and store received TLM */
164162
static esp_err_t esp_eddystone_tlm_received(const uint8_t* buf, uint8_t len, esp_eddystone_result_t* res)
@@ -211,14 +209,14 @@ esp_err_t esp_eddystone_decode(const uint8_t* buf, uint8_t len, esp_eddystone_re
211209
return -1;
212210
}
213211
uint8_t pos=0;
214-
while(res->common.srv_data_type != EDDYSTONE_SERVICE_UUID)
212+
while(res->common.srv_data_type != EDDYSTONE_SERVICE_UUID)
215213
{
216214
pos++;
217-
if(pos >= len ) {
215+
if(pos >= len ) {
218216
return -1;
219217
}
220218
uint8_t ad_type = buf[pos++];
221-
switch(ad_type)
219+
switch(ad_type)
222220
{
223221
case ESP_BLE_AD_TYPE_FLAG: {
224222
res->common.flags = buf[pos++];
@@ -227,7 +225,7 @@ esp_err_t esp_eddystone_decode(const uint8_t* buf, uint8_t len, esp_eddystone_re
227225
case ESP_BLE_AD_TYPE_16SRV_CMPL: {
228226
uint16_t uuid = little_endian_read_16(buf, pos);
229227
if(uuid != EDDYSTONE_SERVICE_UUID) {
230-
return -1;
228+
return -1;
231229
}
232230
res->common.srv_uuid = uuid;
233231
pos += 2;
@@ -237,7 +235,7 @@ esp_err_t esp_eddystone_decode(const uint8_t* buf, uint8_t len, esp_eddystone_re
237235
uint16_t type = little_endian_read_16(buf, pos);
238236
pos += 2;
239237
uint8_t frame_type = buf[pos++];
240-
if(type != EDDYSTONE_SERVICE_UUID || !(frame_type == EDDYSTONE_FRAME_TYPE_UID || frame_type == EDDYSTONE_FRAME_TYPE_URL ||
238+
if(type != EDDYSTONE_SERVICE_UUID || !(frame_type == EDDYSTONE_FRAME_TYPE_UID || frame_type == EDDYSTONE_FRAME_TYPE_URL ||
241239
frame_type == EDDYSTONE_FRAME_TYPE_TLM)) {
242240
return -1;
243241
}
@@ -251,4 +249,3 @@ esp_err_t esp_eddystone_decode(const uint8_t* buf, uint8_t len, esp_eddystone_re
251249
}
252250
return esp_eddystone_get_inform(buf+pos, len-pos, res);
253251
}
254-

0 commit comments

Comments
 (0)