Skip to content

Commit 4f51150

Browse files
authored
Take into account "memory_type" option to properly select boot mode (platformio#913)
Use correct bootloader `opi` when `"boot": "opi"` is not set for Arduino framework Resolves platformio#837, enhances platformio#904
1 parent ad4f417 commit 4f51150

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

builder/main.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@ def _get_board_flash_mode(env):
5959

6060

6161
def _get_board_boot_mode(env):
62-
return env.BoardConfig().get("build.boot", "$BOARD_FLASH_MODE")
62+
memory_type = env.BoardConfig().get("build.arduino.memory_type", "")
63+
build_boot = env.BoardConfig().get("build.boot", "$BOARD_FLASH_MODE")
64+
if ["arduino"] == env.get("PIOFRAMEWORK") and memory_type in ("opi_opi", "opi_qspi"):
65+
build_boot = "opi"
66+
return build_boot
6367

6468

6569
def _parse_size(value):

0 commit comments

Comments
 (0)