Skip to content

Commit ad4f417

Browse files
authored
Fix flash mode for opi (platformio#904)
opi needs to be flashed in mode `dout` to work. Changed flash mode for `qout` since it can be flashed in `dio`. This is the way espressif now does in IDF
1 parent 0abe8d3 commit ad4f417

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

builder/main.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,12 @@ def _get_board_f_flash(env):
4949

5050

5151
def _get_board_flash_mode(env):
52+
memory_type = env.BoardConfig().get("build.arduino.memory_type", "qio_qspi")
5253
mode = env.subst("$BOARD_FLASH_MODE")
53-
if mode == "qio":
54-
return "dio"
55-
elif mode == "qout":
54+
if memory_type in ("opi_opi", "opi_qspi"):
5655
return "dout"
56+
if mode in ("qio", "qout"):
57+
return "dio"
5758
return mode
5859

5960

0 commit comments

Comments
 (0)