From 861518679ac2868429f4296d11e8d43391080723 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Wed, 13 Jul 2022 14:33:13 +0200 Subject: [PATCH] Optimize factory firmware generation to use all settings from boards.json manifest. Set boot flash modes correctly for all flash modes --- pio-tools/post_esp32.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pio-tools/post_esp32.py b/pio-tools/post_esp32.py index 7c7b8c1ea..fde5f30e7 100644 --- a/pio-tools/post_esp32.py +++ b/pio-tools/post_esp32.py @@ -132,8 +132,14 @@ def esp32_create_combined_bin(source, target, env): else: esp32_fetch_safeboot_bin(tasmota_platform) flash_size = env.BoardConfig().get("upload.flash_size", "4MB") - flash_freq = "keep" + flash_freq = env.BoardConfig().get("build.f_flash", "40000000L") + flash_freq = str(flash_freq).replace("L", "") + flash_freq = str(int(int(flash_freq) / 1000000)) + "m" flash_mode = env.BoardConfig().get("build.flash_mode", "dout") + if flash_mode == "qio": + flash_mode = "dio" + elif flash_mode == "qout": + flash_mode = "dout" cmd = [ "--chip", chip,