Skip to content

Commit f9cf6b9

Browse files
committed
Merge branch 'release/v4.4.0'
2 parents 79e8a27 + aa57613 commit f9cf6b9

File tree

9 files changed

+41
-116
lines changed

9 files changed

+41
-116
lines changed

.github/workflows/examples.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ jobs:
88
fail-fast: false
99
matrix:
1010
os: [ubuntu-latest, windows-latest, macos-latest]
11-
python-version: [3.7]
1211
example:
1312
- "examples/arduino-ble5-advertising"
1413
- "examples/arduino-blink"
@@ -31,16 +30,15 @@ jobs:
3130
- "examples/espidf-ulp-pulse"
3231
runs-on: ${{ matrix.os }}
3332
steps:
34-
- uses: actions/checkout@v2
33+
- uses: actions/checkout@v3
3534
with:
3635
submodules: "recursive"
37-
- name: Set up Python ${{ matrix.python-version }}
38-
uses: actions/setup-python@v1
36+
- name: Set up Python
37+
uses: actions/setup-python@v3
3938
with:
40-
python-version: ${{ matrix.python-version }}
39+
python-version: "3.9"
4140
- name: Install dependencies
4241
run: |
43-
python -m pip install --upgrade pip
4442
pip install -U https://github.com/platformio/platformio/archive/develop.zip
4543
pio pkg install --global --platform symlink://.
4644
- name: Build examples

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Espressif 32: development platform for [PlatformIO](http://platformio.org)
1+
# Espressif 32: development platform for [PlatformIO](https://platformio.org)
22

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

@@ -9,7 +9,7 @@ Espressif Systems is a privately held fabless semiconductor company. They provid
99

1010
# Usage
1111

12-
1. [Install PlatformIO](http://platformio.org)
12+
1. [Install PlatformIO](https://platformio.org)
1313
2. Create PlatformIO project and configure a platform option in [platformio.ini](https://docs.platformio.org/page/projectconf.html) file:
1414

1515
## Stable version

builder/compat.py

Lines changed: 0 additions & 38 deletions
This file was deleted.

builder/frameworks/_bare.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@
2121
Import("env")
2222

2323
env.Append(
24-
ASFLAGS=["-x", "assembler-with-cpp"],
24+
ASFLAGS=[
25+
"-mlongcalls",
26+
],
27+
ASPPFLAGS=[
28+
"-x", "assembler-with-cpp",
29+
],
2530

2631
CFLAGS=["-std=gnu99"],
2732

@@ -60,6 +65,3 @@
6065
"-Wl,--gc-sections"
6166
]
6267
)
63-
64-
# copy CCFLAGS to ASFLAGS (-x assembler-with-cpp mode)
65-
env.Append(ASFLAGS=env.get("CCFLAGS", [])[:])

builder/frameworks/espidf.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,6 @@ def prepare_build_envs(config, default_env, debug_allowed=True):
617617
build_env.AppendUnique(CPPDEFINES=defines, CPPPATH=includes)
618618
if sys_includes:
619619
build_env.Append(CCFLAGS=[("-isystem", inc) for inc in sys_includes])
620-
build_env.Append(ASFLAGS=build_env.get("CCFLAGS", [])[:])
621620
build_env.ProcessUnFlags(default_env.get("BUILD_UNFLAGS"))
622621
if is_build_type_debug:
623622
build_env.ConfigureDebugFlags()
@@ -885,7 +884,13 @@ def find_default_component(target_configs):
885884
for config in target_configs:
886885
if "__pio_env" in config:
887886
return config
888-
return ""
887+
sys.stderr.write(
888+
"Error! Failed to find the default IDF component with build information for "
889+
"generic files.\nCheck that the `EXTRA_COMPONENT_DIRS` option is not overridden "
890+
"in your CMakeLists.txt.\nSee an example with an extra component here "
891+
"https://docs.platformio.org/en/latest/frameworks/espidf.html#esp-idf-components\n"
892+
)
893+
env.Exit(1)
889894

890895

891896
def create_version_file():

builder/main.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ def __fetch_fs_size(target, source, env):
161161

162162

163163
env = DefaultEnvironment()
164-
env.SConscript("compat.py", exports="env")
165164
platform = env.PioPlatform()
166165
board = env.BoardConfig()
167166
mcu = board.get("build.mcu", "esp32")
@@ -228,9 +227,6 @@ def __fetch_fs_size(target, source, env):
228227
env.Replace(PROGNAME="firmware")
229228

230229
env.Append(
231-
# copy CCFLAGS to ASFLAGS (-x assembler-with-cpp mode)
232-
ASFLAGS=env.get("CCFLAGS", [])[:],
233-
234230
BUILDERS=dict(
235231
ElfToBin=Builder(
236232
action=env.VerboseAction(" ".join([

monitor/filter_exception_decoder.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,19 @@
1717
import subprocess
1818
import sys
1919

20-
from platformio.compat import path_to_unicode, WINDOWS
2120
from platformio.project.exception import PlatformioException
22-
from platformio.project.helpers import load_project_ide_data
23-
from platformio.commands.device import DeviceMonitorFilter
21+
from platformio.public import (
22+
DeviceMonitorFilterBase,
23+
load_build_metadata,
24+
)
2425

2526
# By design, __init__ is called inside miniterm and we can't pass context to it.
2627
# pylint: disable=attribute-defined-outside-init
2728

29+
IS_WINDOWS = sys.platform.startswith("win")
2830

29-
class Esp32ExceptionDecoder(DeviceMonitorFilter):
31+
32+
class Esp32ExceptionDecoder(DeviceMonitorFilterBase):
3033
NAME = "esp32_exception_decoder"
3134

3235
def __call__(self):
@@ -51,9 +54,9 @@ def __call__(self):
5154
return self
5255

5356
def setup_paths(self):
54-
self.project_dir = path_to_unicode(os.path.abspath(self.project_dir))
57+
self.project_dir = os.path.abspath(self.project_dir)
5558
try:
56-
data = load_project_ide_data(self.project_dir, self.environment)
59+
data = load_build_metadata(self.project_dir, self.environment)
5760
self.firmware_path = data["prog_path"]
5861
if not os.path.isfile(self.firmware_path):
5962
sys.stderr.write(
@@ -109,7 +112,7 @@ def rx(self, text):
109112

110113
def get_backtrace(self, match):
111114
trace = ""
112-
enc = "mbcs" if WINDOWS else "utf-8"
115+
enc = "mbcs" if IS_WINDOWS else "utf-8"
113116
args = [self.addr2line_path, u"-fipC", u"-e", self.firmware_path]
114117
try:
115118
for i, addr in enumerate(match.group(1).split()):

platform.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
"RISC-V"
1313
],
1414
"engines": {
15-
"platformio": "^5"
15+
"platformio": "^6"
1616
},
1717
"repository": {
1818
"type": "git",
1919
"url": "https://github.com/platformio/platform-espressif32.git"
2020
},
21-
"version": "4.3.0",
21+
"version": "4.4.0",
2222
"frameworks": {
2323
"arduino": {
2424
"package": "framework-arduinoespressif32",

platform.py

Lines changed: 10 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
import copy
1615
import os
1716
import urllib
1817
import sys
1918
import json
2019
import re
2120
import requests
2221

23-
from platformio import fs
24-
from platformio.managers.platform import PlatformBase
25-
from platformio.util import get_systype
22+
from platformio.public import PlatformBase, to_unix_path
23+
24+
25+
IS_WINDOWS = sys.platform.startswith("win")
2626

2727

2828
class Espressif32Platform(PlatformBase):
2929
def configure_default_packages(self, variables, targets):
3030
if not variables.get("board"):
31-
return PlatformBase.configure_default_packages(self, variables, targets)
31+
return super().configure_default_packages(variables, targets)
3232

3333
board_config = self.board_config(variables.get("board"))
3434
mcu = variables.get("board_build.mcu", board_config.get("build.mcu", "esp32"))
@@ -92,7 +92,7 @@ def configure_default_packages(self, variables, targets):
9292
for p in self.packages:
9393
if p in ("tool-cmake", "tool-ninja", "toolchain-%sulp" % mcu):
9494
self.packages[p]["optional"] = False
95-
elif p in ("tool-mconf", "tool-idf") and "windows" in get_systype():
95+
elif p in ("tool-mconf", "tool-idf") and IS_WINDOWS:
9696
self.packages[p]["optional"] = False
9797

9898
for available_mcu in ("esp32", "esp32s2", "esp32s3"):
@@ -143,10 +143,10 @@ def configure_default_packages(self, variables, targets):
143143
self.packages["tool-mbctool"]["type"] = "uploader"
144144
self.packages["tool-mbctool"]["optional"] = False
145145

146-
return PlatformBase.configure_default_packages(self, variables, targets)
146+
return super().configure_default_packages(variables, targets)
147147

148148
def get_boards(self, id_=None):
149-
result = PlatformBase.get_boards(self, id_)
149+
result = super().get_boards(id_)
150150
if not result:
151151
return result
152152
if id_:
@@ -266,60 +266,19 @@ def configure_debug_session(self, debug_config):
266266

267267
load_cmds = [
268268
'monitor program_esp "{{{path}}}" {offset} verify'.format(
269-
path=fs.to_unix_path(item["path"]), offset=item["offset"]
269+
path=to_unix_path(item["path"]), offset=item["offset"]
270270
)
271271
for item in flash_images
272272
]
273273
load_cmds.append(
274274
'monitor program_esp "{%s.bin}" %s verify'
275275
% (
276-
fs.to_unix_path(debug_config.build_data["prog_path"][:-4]),
276+
to_unix_path(debug_config.build_data["prog_path"][:-4]),
277277
build_extra_data.get("application_offset", "0x10000"),
278278
)
279279
)
280280
debug_config.load_cmds = load_cmds
281281

282-
def configure_debug_options(self, initial_debug_options, ide_data):
283-
"""
284-
Deprecated. Remove method when PlatformIO Core 5.2 is released
285-
"""
286-
ide_extra_data = ide_data.get("extra", {})
287-
flash_images = ide_extra_data.get("flash_images", [])
288-
debug_options = copy.deepcopy(initial_debug_options)
289-
290-
if "openocd" in debug_options["server"].get("executable", ""):
291-
debug_options["server"]["arguments"].extend(
292-
[
293-
"-c",
294-
"adapter_khz %s" % (initial_debug_options.get("speed") or "5000"),
295-
]
296-
)
297-
298-
ignore_conds = [
299-
initial_debug_options["load_cmds"] != ["load"],
300-
not flash_images,
301-
not all([os.path.isfile(item["path"]) for item in flash_images]),
302-
]
303-
304-
if any(ignore_conds):
305-
return debug_options
306-
307-
load_cmds = [
308-
'monitor program_esp "{{{path}}}" {offset} verify'.format(
309-
path=fs.to_unix_path(item["path"]), offset=item["offset"]
310-
)
311-
for item in flash_images
312-
]
313-
load_cmds.append(
314-
'monitor program_esp "{%s.bin}" %s verify'
315-
% (
316-
fs.to_unix_path(ide_data["prog_path"][:-4]),
317-
ide_extra_data.get("application_offset", "0x10000"),
318-
)
319-
)
320-
debug_options["load_cmds"] = load_cmds
321-
return debug_options
322-
323282
@staticmethod
324283
def extract_toolchain_versions(tool_deps):
325284
def _parse_version(original_version):

0 commit comments

Comments
 (0)