Skip to content

Commit 7a69f63

Browse files
committed
Merge branch 'release/v5.1.1'
2 parents a28daed + bc3b2ad commit 7a69f63

File tree

8 files changed

+22
-79
lines changed

8 files changed

+22
-79
lines changed

.github/stale.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ exemptLabels:
99
- feature
1010
- enhancement
1111
- board request
12+
- package update
1213
# Label to use when marking an issue as stale
1314
staleLabel: stale
1415
# Comment to post when marking an issue as stale. Set to `false` to disable

boards/denky_d4.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
],
1111
"f_cpu": "240000000L",
1212
"f_flash": "80000000L",
13-
"flash_mode": "dio",
13+
"flash_mode": "qio",
1414
"mcu": "esp32",
1515
"variant": "ch_denky"
1616
},
@@ -26,11 +26,11 @@
2626
],
2727
"name": "Denky D4 (PICO-V3-02)",
2828
"upload": {
29-
"flash_size": "4MB",
29+
"flash_size": "8MB",
3030
"maximum_ram_size": 327680,
31-
"maximum_size": 4194304,
31+
"maximum_size": 8388608,
3232
"require_upload_port": true,
33-
"speed": 460800
33+
"speed": 2000000
3434
},
3535
"url": "https://en.wikipedia.org/wiki/ESP32",
3636
"vendor": "Denky"

boards/dfrobot_beetle_esp32c3.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"core": "esp32",
77
"extra_flags": [
88
"-DARDUINO_ESP32C3_DEV",
9-
"-DARDUINO_USB_MODE=1"
9+
"-DARDUINO_USB_MODE=1",
10+
"-DARDUINO_USB_CDC_ON_BOOT=1"
1011
],
1112
"f_cpu": "160000000L",
1213
"f_flash": "80000000L",

boards/esp32-s3-devkitc-1.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
],
1414
"f_cpu": "240000000L",
1515
"f_flash": "80000000L",
16-
"flash_mode": "dio",
16+
"flash_mode": "qio",
1717
"hwids": [
1818
[
19-
"0X303A",
19+
"0x303A",
2020
"0x1001"
2121
]
2222
],

boards/lolin_c3_mini.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
]
2020
],
2121
"mcu": "esp32c3",
22-
"variant": "esp32c3"
22+
"variant": "lolin_c3_mini"
2323
},
2424
"connectivity": [
2525
"wifi"

builder/main.py

Lines changed: 4 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -160,18 +160,6 @@ def __fetch_fs_size(target, source, env):
160160
return (target, source)
161161

162162

163-
def merge_binaries(source, target, env, for_signature):
164-
return " ".join([
165-
'"$PYTHONEXE"',
166-
join(platform.get_package_dir("tool-esptoolpy") or "", "esptool.py"),
167-
"--chip", mcu, "merge_bin",
168-
"-o", "$TARGET",
169-
"--flash_mode", "$BOARD_FLASH_MODE",
170-
"--flash_size", board.get("upload.flash_size", "4MB"),
171-
"$ESP32_APP_OFFSET", "$SOURCES"
172-
] + ['"%s"' % itm for img in env.get("FLASH_EXTRA_IMAGES", []) for itm in img])
173-
174-
175163
env = DefaultEnvironment()
176164
platform = env.PioPlatform()
177165
board = env.BoardConfig()
@@ -181,21 +169,6 @@ def merge_binaries(source, target, env, for_signature):
181169
if mcu == "esp32c3":
182170
toolchain_arch = "riscv32-esp"
183171

184-
# Arduino core v2.0.4 contains updated bootloader images that have innacurate default
185-
# headers. This results in bootloops if firmware is flashed via OpenOCD (e.g. debugging
186-
# or uploading via debug tools). For this reason, before uploading or debugging we need
187-
# to merge binaries via esptoolpy so that the image headers will be adjusted according to
188-
# --flash-size and --flash-mode arguments.
189-
# Note: This behavior doesn't occur if uploading is done via esptoolpy, as esptoolpy
190-
# overrides the binary image headers before flashing.
191-
firmware_merge_required = bool(
192-
env.get("PIOFRAMEWORK", []) == ["arduino"]
193-
and (
194-
"debug" in env.GetBuildType()
195-
or env.subst("$UPLOAD_PROTOCOL") in board.get("debug.tools", {})
196-
)
197-
)
198-
199172
if "INTEGRATION_EXTRA_DATA" not in env:
200173
env["INTEGRATION_EXTRA_DATA"] = {}
201174

@@ -291,10 +264,6 @@ def merge_binaries(source, target, env, for_signature):
291264
source_factory=env.Dir,
292265
suffix=".bin",
293266
),
294-
MergeBin=Builder(
295-
generator=merge_binaries,
296-
suffix=".bin",
297-
),
298267
)
299268
)
300269

@@ -306,7 +275,6 @@ def merge_binaries(source, target, env, for_signature):
306275
#
307276

308277
target_elf = None
309-
target_firm_merged = None
310278
if "nobuild" in COMMAND_LINE_TARGETS:
311279
target_elf = join("$BUILD_DIR", "${PROGNAME}.elf")
312280
if set(["uploadfs", "uploadfsota"]) & set(COMMAND_LINE_TARGETS):
@@ -325,14 +293,6 @@ def merge_binaries(source, target, env, for_signature):
325293
else:
326294
target_firm = env.ElfToBin(
327295
join("$BUILD_DIR", "${PROGNAME}"), target_elf)
328-
if firmware_merge_required:
329-
# Note: Default offset address must be set to 0x0 because debugging
330-
# relies on OpenOCD that requires merged firmware
331-
env["INTEGRATION_EXTRA_DATA"].update(
332-
{"application_offset": "0x0", "merged_firmware": True}
333-
)
334-
target_firm_merged = env.MergeBin(join(
335-
"$BUILD_DIR", "${PROGNAME}_merged"), target_firm)
336296
env.Depends(target_firm, "checkprogsize")
337297

338298
env.AddPlatformTarget("buildfs", target_firm, target_firm, "Build Filesystem Image")
@@ -408,8 +368,8 @@ def merge_binaries(source, target, env, for_signature):
408368
"--chip", mcu,
409369
"--port", '"$UPLOAD_PORT"',
410370
"--baud", "$UPLOAD_SPEED",
411-
"--before", "default_reset",
412-
"--after", "hard_reset",
371+
"--before", board.get("upload.before_reset", "default_reset"),
372+
"--after", board.get("upload.after_reset", "hard_reset"),
413373
"write_flash", "-z",
414374
"--flash_mode", "${__get_board_flash_mode(__env__)}",
415375
"--flash_freq", "${__get_board_f_flash(__env__)}",
@@ -470,10 +430,6 @@ def merge_binaries(source, target, env, for_signature):
470430

471431

472432
elif upload_protocol in debug_tools:
473-
if firmware_merge_required:
474-
# Only merged firmware with proper headers will work when uploading is done via
475-
# debug probes. The firmware offset address must be adjusted to 0x0 accordingly.
476-
target_firm = target_firm_merged
477433
openocd_args = ["-d%d" % (2 if int(ARGUMENTS.get("PIOVERBOSE", 0)) else 1)]
478434
openocd_args.extend(
479435
debug_tools.get(upload_protocol).get("server").get("arguments", []))
@@ -487,13 +443,12 @@ def merge_binaries(source, target, env, for_signature):
487443
"$FS_START"
488444
if "uploadfs" in COMMAND_LINE_TARGETS
489445
else board.get(
490-
"upload.offset_address",
491-
"0x0" if firmware_merge_required else "$ESP32_APP_OFFSET"
446+
"upload.offset_address", "$ESP32_APP_OFFSET"
492447
)
493448
),
494449
]
495450
)
496-
if "uploadfs" not in COMMAND_LINE_TARGETS and not firmware_merge_required:
451+
if "uploadfs" not in COMMAND_LINE_TARGETS:
497452
for image in env.get("FLASH_EXTRA_IMAGES", []):
498453
openocd_args.extend(
499454
[
@@ -551,13 +506,6 @@ def merge_binaries(source, target, env, for_signature):
551506
print("Warning! '-Wl,-T' option for specifying linker scripts is deprecated. "
552507
"Please use 'board_build.ldscript' option in your 'platformio.ini' file.")
553508

554-
#
555-
# A temporary workaround to propagate additional data to the debug configuration routine
556-
#
557-
558-
Import("projenv")
559-
projenv["INTEGRATION_EXTRA_DATA"] = env.get("INTEGRATION_EXTRA_DATA")
560-
561509
#
562510
# Default targets
563511
#

platform.json

Lines changed: 1 addition & 1 deletion
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": "5.1.0",
21+
"version": "5.1.1",
2222
"frameworks": {
2323
"arduino": {
2424
"package": "framework-arduinoespressif32",

platform.py

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -261,23 +261,16 @@ def configure_debug_session(self, debug_config):
261261
if any(ignore_conds):
262262
return
263263

264-
merged_firmware = build_extra_data.get("merged_firmware", False)
265-
load_cmds = []
266-
if not merged_firmware:
267-
load_cmds.extend([
268-
'monitor program_esp "{{{path}}}" {offset} verify'.format(
269-
path=to_unix_path(item["path"]), offset=item["offset"]
270-
)
271-
for item in flash_images
272-
])
273-
264+
load_cmds = [
265+
'monitor program_esp "{{{path}}}" {offset} verify'.format(
266+
path=to_unix_path(item["path"]), offset=item["offset"]
267+
)
268+
for item in flash_images
269+
]
274270
load_cmds.append(
275271
'monitor program_esp "{%s.bin}" %s verify'
276272
% (
277-
to_unix_path(
278-
debug_config.build_data["prog_path"][:-4]
279-
+ ("_merged" if merged_firmware else "")
280-
),
273+
to_unix_path(debug_config.build_data["prog_path"][:-4]),
281274
build_extra_data.get("application_offset", "0x10000"),
282275
)
283276
)

0 commit comments

Comments
 (0)