Take into account "memory_type" option to properly select boot mode (#913)

Use correct bootloader `opi` when `"boot": "opi"` is not set for Arduino framework

Resolves #837, enhances #904
This commit is contained in:
Jason2866
2022-09-26 11:11:48 +02:00
committed by GitHub
parent ad4f417ad3
commit 4f51150708
+5 -1
View File
@@ -59,7 +59,11 @@ def _get_board_flash_mode(env):
def _get_board_boot_mode(env):
return env.BoardConfig().get("build.boot", "$BOARD_FLASH_MODE")
memory_type = env.BoardConfig().get("build.arduino.memory_type", "")
build_boot = env.BoardConfig().get("build.boot", "$BOARD_FLASH_MODE")
if ["arduino"] == env.get("PIOFRAMEWORK") and memory_type in ("opi_opi", "opi_qspi"):
build_boot = "opi"
return build_boot
def _parse_size(value):