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",