|
80 | 80 | flash_speed = board.get("build.f_flash", "40000000L") |
81 | 81 | flash_frequency = str(flash_speed.replace("000000L", "")) |
82 | 82 | flash_mode = board.get("build.flash_mode", "dio") |
| 83 | +boot_mode = board.get("build.boot", None) |
83 | 84 | idf_variant = mcu.lower() |
84 | 85 | flag_custom_sdkonfig = False |
85 | 86 | flag_custom_component_add = False |
@@ -337,9 +338,16 @@ def generate_board_specific_config(): |
337 | 338 | else: |
338 | 339 | flash_memory_type = memory_type |
339 | 340 |
|
340 | | - # Check for additional flash configuration indicators |
341 | | - boot_mode = board.get("build", {}).get("boot", None) |
342 | | - flash_mode = board.get("build", {}).get("flash_mode", None) |
| 341 | + # Add flash mode to sdkconfig |
| 342 | + if flash_mode: |
| 343 | + flash_mode_lower = flash_mode.lower() |
| 344 | + board_config_flags.append(f"CONFIG_ESPTOOLPY_FLASHMODE_{flash_mode.upper()}=y") |
| 345 | + |
| 346 | + # Disable other flash mode options |
| 347 | + flash_modes = ["qio", "qout", "dio", "dout"] |
| 348 | + for mode in flash_modes: |
| 349 | + if mode != flash_mode_lower: |
| 350 | + board_config_flags.append(f"# CONFIG_ESPTOOLPY_FLASHMODE_{mode.upper()} is not set") |
343 | 351 |
|
344 | 352 | # Override flash_memory_type if boot mode indicates OPI |
345 | 353 | if boot_mode == "opi" or flash_mode in ["dout", "opi"]: |
|
0 commit comments