From e6ded2bffe4e0c8eb579232fb1be19e955868090 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Sun, 4 Sep 2022 15:20:21 +0200 Subject: [PATCH] octal flash needs flashed in mode `dout` (#16436) * octal flash needs flashed in mode `dout` flash modes `qio, qout, dio` can all be flashed in mode `dio` --- pio-tools/post_esp32.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pio-tools/post_esp32.py b/pio-tools/post_esp32.py index d4a425ac2..5ec9093ed 100644 --- a/pio-tools/post_esp32.py +++ b/pio-tools/post_esp32.py @@ -136,9 +136,11 @@ def esp32_create_combined_bin(source, target, env): flash_freq = str(flash_freq).replace("L", "") flash_freq = str(int(int(flash_freq) / 1000000)) + "m" flash_mode = env.BoardConfig().get("build.flash_mode", "dio") - if flash_mode == "qio": + memory_type = env.BoardConfig().get("build.arduino.memory_type", "qio_qspi") + + if flash_mode == "qio" or flash_mode == "qout": flash_mode = "dio" - elif flash_mode == "qout": + if memory_type == "opi_opi" or memory_type == "opi_qspi": flash_mode = "dout" cmd = [ "--chip",