Skip to content

Commit fb43d25

Browse files
committed
Merge branch 'release/v6.1.10'
2 parents f47083b + 8b6a4b8 commit fb43d25

38 files changed

+313
-490
lines changed

.github/workflows/core.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
fail-fast: false
99
matrix:
1010
os: [ubuntu-20.04, windows-latest, macos-latest]
11-
python-version: ["3.6", "3.9", "3.11"]
11+
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
1212

1313
runs-on: ${{ matrix.os }}
1414

@@ -27,12 +27,17 @@ jobs:
2727
python -m pip install --upgrade pip
2828
pip install tox
2929
30+
- name: Core System Info
31+
run: |
32+
tox -e py
33+
3034
- name: Python Lint
3135
if: ${{ matrix.python-version != '3.6' }}
3236
run: |
3337
tox -e lint
3438
3539
- name: Integration Tests
40+
if: ${{ matrix.python-version == '3.9' }}
3641
run: |
3742
tox -e testcore
3843

HISTORY.rst

+12-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,18 @@ Release Notes
1313
PlatformIO Core 6
1414
-----------------
1515

16-
**A professional collaborative platform for declarative, safety-critical, and test-driven embedded development.**
16+
Unlock the true potential of embedded software development with
17+
PlatformIO's collaborative ecosystem, embracing declarative principles,
18+
test-driven methodologies, and modern toolchains for unrivaled success.
19+
20+
6.1.10 (2023-08-11)
21+
~~~~~~~~~~~~~~~~~~~
22+
23+
* Resolved an issue that caused generated projects for `PlatformIO IDE for VSCode <https://docs.platformio.org/en/latest/integration/ide/vscode.html>`__ to break when the ``-iprefix`` compiler flag was used
24+
* Resolved an issue encountered while utilizing the `pio pkg exec <https://docs.platformio.org/en/latest/core/userguide/pkg/cmd_exec.html>`__ command on the Windows platform to execute Python scripts from a package
25+
* Implemented a crucial improvement to the `pio run <https://docs.platformio.org/en/latest/core/userguide/cmd_run.html>`__ command, guaranteeing that the ``monitor`` target is not executed if any of the preceding targets, such as ``upload``, encounter failures
26+
* `Cppcheck <https://docs.platformio.org/en/latest/plus/check-tools/cppcheck.html>`__ v2.11 with new checks, CLI commands and various analysis improvements
27+
* Resolved a critical issue that arose on macOS ARM platforms due to the Python "requests" module, leading to a "ModuleNotFoundError: No module named 'chardet'" (`issue #4702 <https://github.com/platformio/platformio-core/issues/4702>`_)
1728

1829
6.1.9 (2023-07-06)
1930
~~~~~~~~~~~~~~~~~~

README.rst

+4-2
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@ PlatformIO Core
3636
.. image:: https://raw.githubusercontent.com/platformio/platformio-web/develop/app/images/platformio-ide-laptop.png
3737
:target: https://platformio.org?utm_source=github&utm_medium=core
3838

39-
`PlatformIO <https://platformio.org>`_ is a professional collaborative platform for embedded development.
39+
`PlatformIO <https://platformio.org>`_: Your Gateway to Embedded Software Development Excellence.
4040

41-
**A place where Developers and Teams have true Freedom! No more vendor lock-in!**
41+
Unlock the true potential of embedded software development with
42+
PlatformIO's collaborative ecosystem, embracing declarative principles,
43+
test-driven methodologies, and modern toolchains for unrivaled success.
4244

4345
* Open source, maximum permissive Apache 2.0 license
4446
* Cross-platform IDE and Unified Debugger

platformio/__init__.py

+26-11
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,16 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
VERSION = (6, 1, 9)
15+
VERSION = (6, 1, 10)
1616
__version__ = ".".join([str(s) for s in VERSION])
1717

1818
__title__ = "platformio"
1919
__description__ = (
20-
"A professional collaborative platform for embedded development. "
21-
"Cross-platform IDE and Unified Debugger. "
22-
"Static Code Analyzer and Remote Unit Testing. "
23-
"Multi-platform and Multi-architecture Build System. "
24-
"Firmware File Explorer and Memory Inspection. "
25-
"IoT, Arduino, CMSIS, ESP-IDF, FreeRTOS, libOpenCM3, mbedOS, Pulp OS, SPL, "
26-
"STM32Cube, Zephyr RTOS, ARM, AVR, Espressif (ESP8266/ESP32), FPGA, "
27-
"MCS-51 (8051), MSP430, Nordic (nRF51/nRF52), NXP i.MX RT, PIC32, RISC-V, "
28-
"STMicroelectronics (STM8/STM32), Teensy"
20+
"Your Gateway to Embedded Software Development Excellence. "
21+
"Unlock the true potential of embedded software development "
22+
"with PlatformIO's collaborative ecosystem, embracing "
23+
"declarative principles, test-driven methodologies, and "
24+
"modern toolchains for unrivaled success."
2925
)
3026
__url__ = "https://platformio.org"
3127

@@ -46,7 +42,7 @@
4642
"contrib-piohome": "~3.4.2",
4743
"contrib-pioremote": "~1.0.0",
4844
"tool-scons": "~4.40502.0",
49-
"tool-cppcheck": "~1.270.0",
45+
"tool-cppcheck": "~1.21100.0",
5046
"tool-clangtidy": "~1.150005.0",
5147
"tool-pvs-studio": "~7.18.0",
5248
}
@@ -56,3 +52,22 @@
5652
"88.198.170.159", # platformio.org
5753
"github.com",
5854
] + __registry_mirror_hosts__
55+
56+
__install_requires__ = [
57+
# Core requirements
58+
"bottle == 0.12.*",
59+
"click >=8.0.4, <=8.2",
60+
"colorama",
61+
"marshmallow == 3.*",
62+
"pyelftools == 0.29",
63+
"pyserial == 3.5.*", # keep in sync "device/monitor/terminal.py"
64+
"requests == 2.*",
65+
"semantic_version == 2.10.*",
66+
"tabulate == 0.*",
67+
] + [
68+
# PIO Home requirements
69+
"ajsonrpc == 1.2.*",
70+
"starlette >=0.19, <0.32",
71+
"uvicorn >=0.16, <0.24",
72+
"wsproto == 1.*",
73+
]

platformio/app.py

+6
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,10 @@ def get_cid():
258258
return cid
259259

260260

261+
def get_project_id(project_dir):
262+
return hashlib.sha1(hashlib_encode_data(project_dir)).hexdigest()
263+
264+
261265
def get_user_agent():
262266
data = [
263267
"PlatformIO/%s" % __version__,
@@ -270,6 +274,8 @@ def get_user_agent():
270274
data.append("IDE/%s" % os.getenv("PLATFORMIO_IDE"))
271275
data.append("Python/%s" % platform.python_version())
272276
data.append("Platform/%s" % platform.platform())
277+
if not get_setting("enable_telemetry"):
278+
data.append("Telemetry/0")
273279
return " ".join(data)
274280

275281

platformio/builder/main.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
# append CLI arguments to build environment
3939
clivars = Variables(None)
4040
clivars.AddVariables(
41-
("PLATFORM_MANIFEST",),
4241
("BUILD_SCRIPT",),
4342
("PROJECT_CONFIG",),
4443
("PIOENV",),
@@ -72,8 +71,7 @@
7271
variables=clivars,
7372
# Propagating External Environment
7473
ENV=os.environ,
75-
TIMESTAMP=int(time()),
76-
UNIX_TIME="$TIMESTAMP", # deprecated
74+
UNIX_TIME=int(time()),
7775
BUILD_DIR=os.path.join("$PROJECT_BUILD_DIR", "$PIOENV"),
7876
BUILD_SRC_DIR=os.path.join("$BUILD_DIR", "src"),
7977
BUILD_TEST_DIR=os.path.join("$BUILD_DIR", "test"),

platformio/builder/tools/piointegration.py

+5-11
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
1615
import glob
1716
import os
1817

19-
import click
2018
import SCons.Defaults # pylint: disable=import-error
2119
import SCons.Subst # pylint: disable=import-error
2220
from SCons.Script import COMMAND_LINE_TARGETS # pylint: disable=import-error
@@ -140,9 +138,9 @@ def dump_svd_path(env):
140138
return None
141139

142140

143-
def _subst_cmd(env, cmd):
144-
args = env.subst_list(cmd, SCons.Subst.SUBST_CMD)[0]
145-
return " ".join([SCons.Subst.quote_spaces(arg) for arg in args])
141+
def _split_flags_string(env, s):
142+
args = env.subst_list(s, SCons.Subst.SUBST_CMD)[0]
143+
return [str(arg) for arg in args]
146144

147145

148146
def DumpIntegrationData(*args):
@@ -155,12 +153,8 @@ def DumpIntegrationData(*args):
155153
],
156154
"defines": dump_defines(projenv),
157155
"includes": projenv.DumpIntegrationIncludes(),
158-
"cc_flags": click.parser.split_arg_string(
159-
_subst_cmd(projenv, "$CFLAGS $CCFLAGS $CPPFLAGS")
160-
),
161-
"cxx_flags": click.parser.split_arg_string(
162-
_subst_cmd(projenv, "$CXXFLAGS $CCFLAGS $CPPFLAGS")
163-
),
156+
"cc_flags": _split_flags_string(projenv, "$CFLAGS $CCFLAGS $CPPFLAGS"),
157+
"cxx_flags": _split_flags_string(projenv, "$CXXFLAGS $CCFLAGS $CPPFLAGS"),
164158
"cc_path": where_is_program(
165159
globalenv.subst("$CC"), globalenv.subst("${ENV['PATH']}")
166160
),

platformio/builder/tools/pioplatform.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@
3333
@util.memoized()
3434
def _PioPlatform():
3535
env = DefaultEnvironment()
36-
p = PlatformFactory.new(os.path.dirname(env["PLATFORM_MANIFEST"]))
37-
p.configure_project_packages(env["PIOENV"], COMMAND_LINE_TARGETS)
38-
return p
36+
return PlatformFactory.from_env(env["PIOENV"], targets=COMMAND_LINE_TARGETS)
3937

4038

4139
def PioPlatform(_):

platformio/builder/tools/piosize.py

+48-36
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def _get_symbol_locations(env, elf_path, addrs):
5353
locations = [line for line in result["out"].split("\n") if line]
5454
assert len(addrs) == len(locations)
5555

56-
return dict(zip(addrs, [l.strip() for l in locations]))
56+
return dict(zip(addrs, [loc.strip() for loc in locations]))
5757

5858

5959
def _get_demangled_names(env, mangled_names):
@@ -73,31 +73,7 @@ def _get_demangled_names(env, mangled_names):
7373
)
7474

7575

76-
def _determine_section(sections, symbol_addr):
77-
for section, info in sections.items():
78-
if not _is_flash_section(info) and not _is_ram_section(info):
79-
continue
80-
if symbol_addr in range(info["start_addr"], info["start_addr"] + info["size"]):
81-
return section
82-
return "unknown"
83-
84-
85-
def _is_ram_section(section):
86-
return (
87-
section.get("type", "") in ("SHT_NOBITS", "SHT_PROGBITS")
88-
and section.get("flags", "") == "WA"
89-
)
90-
91-
92-
def _is_flash_section(section):
93-
return section.get("type", "") == "SHT_PROGBITS" and "A" in section.get("flags", "")
94-
95-
96-
def _is_valid_symbol(symbol_name, symbol_type, symbol_address):
97-
return symbol_name and symbol_address != 0 and symbol_type != "STT_NOTYPE"
98-
99-
100-
def _collect_sections_info(elffile):
76+
def _collect_sections_info(env, elffile):
10177
sections = {}
10278
for section in elffile.iter_sections():
10379
if section.is_null() or section.name.startswith(".debug"):
@@ -107,13 +83,18 @@ def _collect_sections_info(elffile):
10783
section_flags = describe_sh_flags(section["sh_flags"])
10884
section_size = section.data_size
10985

110-
sections[section.name] = {
86+
section_data = {
87+
"name": section.name,
11188
"size": section_size,
11289
"start_addr": section["sh_addr"],
11390
"type": section_type,
11491
"flags": section_flags,
11592
}
11693

94+
sections[section.name] = section_data
95+
sections[section.name]["in_flash"] = env.pioSizeIsFlashSection(section_data)
96+
sections[section.name]["in_ram"] = env.pioSizeIsRamSection(section_data)
97+
11798
return sections
11899

119100

@@ -136,7 +117,7 @@ def _collect_symbols_info(env, elffile, elf_path, sections):
136117
symbol_size = s["st_size"]
137118
symbol_type = symbol_info["type"]
138119

139-
if not _is_valid_symbol(s.name, symbol_type, symbol_addr):
120+
if not env.pioSizeIsValidSymbol(s.name, symbol_type, symbol_addr):
140121
continue
141122

142123
symbol = {
@@ -145,7 +126,7 @@ def _collect_symbols_info(env, elffile, elf_path, sections):
145126
"name": s.name,
146127
"type": symbol_type,
147128
"size": symbol_size,
148-
"section": _determine_section(sections, symbol_addr),
129+
"section": env.pioSizeDetermineSection(sections, symbol_addr),
149130
}
150131

151132
if s.name.startswith("_Z"):
@@ -175,12 +156,36 @@ def _collect_symbols_info(env, elffile, elf_path, sections):
175156
return symbols
176157

177158

178-
def _calculate_firmware_size(sections):
159+
def pioSizeDetermineSection(_, sections, symbol_addr):
160+
for section, info in sections.items():
161+
if not info.get("in_flash", False) and not info.get("in_ram", False):
162+
continue
163+
if symbol_addr in range(info["start_addr"], info["start_addr"] + info["size"]):
164+
return section
165+
return "unknown"
166+
167+
168+
def pioSizeIsValidSymbol(_, symbol_name, symbol_type, symbol_address):
169+
return symbol_name and symbol_address != 0 and symbol_type != "STT_NOTYPE"
170+
171+
172+
def pioSizeIsRamSection(_, section):
173+
return (
174+
section.get("type", "") in ("SHT_NOBITS", "SHT_PROGBITS")
175+
and section.get("flags", "") == "WA"
176+
)
177+
178+
179+
def pioSizeIsFlashSection(_, section):
180+
return section.get("type", "") == "SHT_PROGBITS" and "A" in section.get("flags", "")
181+
182+
183+
def pioSizeCalculateFirmwareSize(_, sections):
179184
flash_size = ram_size = 0
180185
for section_info in sections.values():
181-
if _is_flash_section(section_info):
186+
if section_info.get("in_flash", False):
182187
flash_size += section_info.get("size", 0)
183-
if _is_ram_section(section_info):
188+
if section_info.get("in_ram", False):
184189
ram_size += section_info.get("size", 0)
185190

186191
return ram_size, flash_size
@@ -210,8 +215,8 @@ def DumpSizeData(_, target, source, env): # pylint: disable=unused-argument
210215
sys.stderr.write("Elf file doesn't contain DWARF information")
211216
env.Exit(1)
212217

213-
sections = _collect_sections_info(elffile)
214-
firmware_ram, firmware_flash = _calculate_firmware_size(sections)
218+
sections = _collect_sections_info(env, elffile)
219+
firmware_ram, firmware_flash = env.pioSizeCalculateFirmwareSize(sections)
215220
data["memory"]["total"] = {
216221
"ram_size": firmware_ram,
217222
"flash_size": firmware_flash,
@@ -226,9 +231,11 @@ def DumpSizeData(_, target, source, env): # pylint: disable=unused-argument
226231

227232
symbol_size = symbol.get("size", 0)
228233
section = sections.get(symbol.get("section", ""), {})
229-
if _is_ram_section(section):
234+
if not section:
235+
continue
236+
if section.get("in_ram", False):
230237
files[file_path]["ram_size"] += symbol_size
231-
if _is_flash_section(section):
238+
if section.get("in_flash", False):
232239
files[file_path]["flash_size"] += symbol_size
233240

234241
files[file_path]["symbols"].append(symbol)
@@ -250,5 +257,10 @@ def exists(_):
250257

251258

252259
def generate(env):
260+
env.AddMethod(pioSizeIsRamSection)
261+
env.AddMethod(pioSizeIsFlashSection)
262+
env.AddMethod(pioSizeCalculateFirmwareSize)
263+
env.AddMethod(pioSizeDetermineSection)
264+
env.AddMethod(pioSizeIsValidSymbol)
253265
env.AddMethod(DumpSizeData)
254266
return env

0 commit comments

Comments
 (0)