Skip to content

Commit 87ecdd8

Browse files
authored
205merge (#29)
* Tasmota github as source * --dont-append-digest * esptool v4.1 * 2.0.5dev * platformio": ">=6.1.0 * Update espidf.py * Add default nameOnDisk value for external CMake projects * Build 918 newest wifi libs from idf44 * Tasmota IDF 4.4.3 * Tasmota release Core 2.0.4.1 * Merge firmware before flashing via OpenOCD * Merge firmware before flashing via OpenOCD * Update arduino.py * Update espidf.py * update boards 1/2 * Update Boards 2/2 * v2.0.4.1 * Mode qio * Board supports qio * OpenOCD has now apple ARM support * rm custom OpenOCD * fix install OpenOCD * Allow overriding reset operation via project file * flash options from env for uploadfs * revert * flash options from env for uploadfs * no .DS_Store * fix boot flash mode * refactor * Esptool.py v4.2.1 * Update bootloader image headers before debugging or uploading via deb… …ug tools This approach is less intrusive than merging the entire application into one binary implemented in #006d64e8b268e479703a0aac7eed8bef1ebea587 In this implementation we safely copy the required bootloader binary to the build directory, adjust the headers via esptoolpy and the "merge_bin" command according to --flash-size and --flash-mode arguments. * better specs * replace deprecated flash modes * Board support faster flash mode * now "memory_type": "qio_opi" * qio * opi flash needs flash mode `dout` flash mode `dio `works for `qout` as mode too * 8 MB * Tasmota/205 * Update IDF to 4.4.3.1 * Use S2 / S3 / C3 as board * cmake v3.21 * core pre 2.0.5 * Move the process of patching bootloader to the Arduino build script * Remove obsolete workaround for propagating debug configurations * Update platform.py * Update platform.json * Update sdkconfig.defaults * PSK needed for wifi * Update Arduino / IDF * Update platform.json * Update platform.json * Update main.py * Update platform.py * flash mode `dout` for opi * rm litter * 16MB flash * framework now as zip * Apple ARM toolchain 8.4.0-2021r2-patch4 * more "pythonic"
1 parent 30e8ff1 commit 87ecdd8

File tree

4 files changed

+17
-74
lines changed

4 files changed

+17
-74
lines changed

boards/esp32s3camlcd.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,13 @@
77
"boot": "opi",
88
"core": "esp32",
99
"extra_flags": [
10-
"-DARDUINO_RUNNING_CORE=1",
11-
"-DARDUINO_EVENT_RUNNING_CORE=1",
1210
"-DBOARD_HAS_PSRAM",
1311
"-DARDUINO_ESP32S3_CAM_LCD",
1412
"-DARDUINO_USB_MODE=1"
1513
],
1614
"f_cpu": "240000000L",
1715
"f_flash": "80000000L",
18-
"flash_mode": "qio",
16+
"flash_mode": "dout",
1917
"hwids": [
2018
[
2119
"0X303A",
@@ -38,7 +36,7 @@
3836
],
3937
"name": "ESP32S3 CAM LCD",
4038
"upload": {
41-
"flash_size": "4MB",
39+
"flash_size": "16MB",
4240
"maximum_ram_size": 327680,
4341
"maximum_size": 16777216,
4442
"require_upload_port": true,

builder/main.py

Lines changed: 3 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ def _get_board_f_flash(env):
5151
def _get_board_flash_mode(env):
5252
memory_type = env.BoardConfig().get("build.arduino.memory_type", "qio_qspi")
5353
mode = env.subst("$BOARD_FLASH_MODE")
54-
if mode == "qio" or mode == "qout":
55-
return "dio"
56-
if memory_type == "opi_opi" or memory_type == "opi_qspi":
54+
if memory_type in ("opi_opi", "opi_qspi"):
5755
return "dout"
56+
if mode in ("qio", "qout"):
57+
return "dio"
5858
return mode
5959

6060

@@ -324,47 +324,6 @@ def __fetch_fs_size(target, source, env):
324324
"Calculate program size",
325325
)
326326

327-
# Arduino core v2.0.4 contains updated bootloader images that have innacurate default
328-
# headers. This results in bootloops if firmware is flashed via OpenOCD (e.g. debugging
329-
# or uploading via debug tools). For this reason, before uploading or debugging we need
330-
# to adjust the bootloader binary according to --flash-size and --flash-mode arguments.
331-
# Note: This behavior doesn't occur if uploading is done via esptoolpy, as esptoolpy
332-
# overrides the binary image headers before flashing.
333-
bootloader_patch_required = bool(
334-
env.get("PIOFRAMEWORK", []) == ["arduino"]
335-
and (
336-
"debug" in env.GetBuildType()
337-
or env.subst("$UPLOAD_PROTOCOL") in board.get("debug.tools", {})
338-
)
339-
)
340-
341-
if bootloader_patch_required:
342-
result = []
343-
for offset, image in env.get("FLASH_EXTRA_IMAGES", []):
344-
# 0x1000 for ESP32/S2, 0x0 for others
345-
default_bootloader_offsets = ("0x0", "0x0000", "0x1000")
346-
if offset in default_bootloader_offsets:
347-
original_bootloader_path = env.subst(image)
348-
image = join(env.subst("$BUILD_DIR"), "patched_bootloader.bin")
349-
env.AddPreAction(
350-
target_elf,
351-
env.VerboseAction(" ".join([
352-
'"$PYTHONEXE"',
353-
join(platform.get_package_dir("tool-esptoolpy") or "", "esptool.py"),
354-
"--chip", mcu, "merge_bin",
355-
"-o", '"%s"' % image,
356-
"--flash_mode", _get_board_flash_mode(env),
357-
"--flash_freq", _get_board_f_flash(env),
358-
"--flash_size", board.get("upload.flash_size", "4MB"),
359-
"--target-offset", offset,
360-
offset, '"%s"' % original_bootloader_path
361-
]), "Updating bootloader headers")
362-
)
363-
364-
result.append((offset, image))
365-
366-
env.Replace(FLASH_EXTRA_IMAGES=result)
367-
368327
#
369328
# Target: Upload firmware or FS image
370329
#
@@ -550,13 +509,6 @@ def __fetch_fs_size(target, source, env):
550509
print("Warning! '-Wl,-T' option for specifying linker scripts is deprecated. "
551510
"Please use 'board_build.ldscript' option in your 'platformio.ini' file.")
552511

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

platform.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"type": "framework",
3838
"optional": true,
3939
"owner": "tasmota",
40-
"version": "https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/987/framework-arduinoespressif32-IDF_Arduino-83797312d3.tar.gz"
40+
"version": "https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/990/framework-arduinoespressif32-IDF_Arduino-bce2fe1fd3.zip"
4141
},
4242
"framework-espidf": {
4343
"type": "framework",
@@ -73,25 +73,25 @@
7373
"type": "toolchain",
7474
"optional": true,
7575
"owner": "tasmota",
76-
"version": "https://github.com/Jason2866/crosstool-NG/releases/download/8.4.0/toolchain-xtensa-esp32.tar.gz"
76+
"version": "https://github.com/Jason2866/crosstool-NG/releases/download/v8.4.0/xtensa-esp32-elf.tar.gz"
7777
},
7878
"toolchain-xtensa-esp32s2-arm": {
7979
"type": "toolchain",
8080
"optional": true,
8181
"owner": "tasmota",
82-
"version": "https://github.com/Jason2866/crosstool-NG/releases/download/8.4.0/toolchain-xtensa-esp32s2.tar.gz"
82+
"version": "https://github.com/Jason2866/crosstool-NG/releases/download/v8.4.0/xtensa-esp32s2-elf.tar.gz"
8383
},
8484
"toolchain-xtensa-esp32s3-arm": {
8585
"type": "toolchain",
8686
"optional": true,
8787
"owner": "tasmota",
88-
"version": "https://github.com/Jason2866/crosstool-NG/releases/download/8.4.0/toolchain-xtensa-esp32s3.tar.gz"
88+
"version": "https://github.com/Jason2866/crosstool-NG/releases/download/v8.4.0/xtensa-esp32s3-elf.tar.gz"
8989
},
9090
"toolchain-riscv32-esp-arm": {
9191
"type": "toolchain",
9292
"optional": true,
9393
"owner": "tasmota",
94-
"version": "https://github.com/Jason2866/crosstool-NG/releases/download/8.4.0/toolchain-riscv32-esp.tar.gz"
94+
"version": "https://github.com/Jason2866/crosstool-NG/releases/download/v8.4.0/riscv32-esp-elf.tar.gz"
9595
},
9696
"toolchain-esp32ulp": {
9797
"type": "toolchain",

platform.py

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -275,23 +275,16 @@ def configure_debug_session(self, debug_config):
275275
if any(ignore_conds):
276276
return
277277

278-
merged_firmware = build_extra_data.get("merged_firmware", False)
279-
load_cmds = []
280-
if not merged_firmware:
281-
load_cmds.extend([
282-
'monitor program_esp "{{{path}}}" {offset} verify'.format(
283-
path=to_unix_path(item["path"]), offset=item["offset"]
284-
)
285-
for item in flash_images
286-
])
287-
278+
load_cmds = [
279+
'monitor program_esp "{{{path}}}" {offset} verify'.format(
280+
path=to_unix_path(item["path"]), offset=item["offset"]
281+
)
282+
for item in flash_images
283+
]
288284
load_cmds.append(
289285
'monitor program_esp "{%s.bin}" %s verify'
290286
% (
291-
to_unix_path(
292-
debug_config.build_data["prog_path"][:-4]
293-
+ ("_merged" if merged_firmware else "")
294-
),
287+
to_unix_path(debug_config.build_data["prog_path"][:-4]),
295288
build_extra_data.get("application_offset", "0x10000"),
296289
)
297290
)

0 commit comments

Comments
 (0)