diff --git a/HISTORY.rst b/HISTORY.rst index d2a35725..0a355928 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -8,9 +8,12 @@ PlatformIO 2.0 ~~~~~~~~~~~~~~~~~~ * Added ``board_f_flash`` option to `Project Configuration File platformio.ini `__ - which allows to specify `custom flash frequency `_ + which allows to specify `custom flash chip frequency `_ for Espressif development platform (`issue #501 `_) +* Added ``board_flash_mode`` option to `Project Configuration File platformio.ini `__ + which allows to specify `custom flash chip mode `_ + for Espressif development platform * Fixed issue with ``CPPDEFINES`` which contain space and break PlatformIO IDE Linter (`IDE issue #34 `_) diff --git a/platformio/boards/espressif.json b/platformio/boards/espressif.json index 8fb9617e..d922a3ec 100644 --- a/platformio/boards/espressif.json +++ b/platformio/boards/espressif.json @@ -5,6 +5,7 @@ "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP01", "f_cpu": "80000000L", "f_flash": "40000000L", + "flash_mode": "qio", "ldscript": "esp8266.flash.512k64.ld", "mcu": "esp8266", "variant": "generic" @@ -29,6 +30,7 @@ "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP01", "f_cpu": "80000000L", "f_flash": "40000000L", + "flash_mode": "qio", "ldscript": "esp8266.flash.1m256.ld", "mcu": "esp8266", "variant": "generic" @@ -53,6 +55,7 @@ "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12", "f_cpu": "80000000L", "f_flash": "40000000L", + "flash_mode": "dio", "ldscript": "esp8266.flash.4m1m.ld", "mcu": "esp8266", "variant": "nodemcu" @@ -77,6 +80,7 @@ "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12", "f_cpu": "80000000L", "f_flash": "40000000L", + "flash_mode": "dio", "ldscript": "esp8266.flash.4m1m.ld", "mcu": "esp8266", "variant": "nodemcu" @@ -101,6 +105,7 @@ "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12", "f_cpu": "80000000L", "f_flash": "40000000L", + "flash_mode": "qio", "ldscript": "esp8266.flash.4m1m.ld", "mcu": "esp8266", "variant": "adafruit" @@ -125,6 +130,7 @@ "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_MOD_WIFI_ESP8266", "f_cpu": "80000000L", "f_flash": "40000000L", + "flash_mode": "qio", "ldscript": "esp8266.flash.2m.ld", "mcu": "esp8266", "variant": "generic" @@ -149,6 +155,7 @@ "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_THING", "f_cpu": "80000000L", "f_flash": "40000000L", + "flash_mode": "qio", "ldscript": "esp8266.flash.512k64.ld", "mcu": "esp8266", "variant": "thing" @@ -173,6 +180,7 @@ "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP210", "f_cpu": "80000000L", "f_flash": "40000000L", + "flash_mode": "qio", "ldscript": "esp8266.flash.4m1m.ld", "mcu": "esp8266", "variant": "generic" @@ -197,6 +205,7 @@ "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12", "f_cpu": "80000000L", "f_flash": "40000000L", + "flash_mode": "dio", "ldscript": "esp8266.flash.4m1m.ld", "mcu": "esp8266", "variant": "d1" @@ -221,6 +230,7 @@ "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12", "f_cpu": "80000000L", "f_flash": "40000000L", + "flash_mode": "dio", "ldscript": "esp8266.flash.4m1m.ld", "mcu": "esp8266", "variant": "d1_mini" @@ -245,6 +255,7 @@ "extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP12", "f_cpu": "80000000L", "f_flash": "40000000L", + "flash_mode": "qio", "ldscript": "esp8266.flash.4m1m.ld", "mcu": "esp8266", "variant": "espino" diff --git a/platformio/builder/main.py b/platformio/builder/main.py index 7b325287..6c7209bb 100644 --- a/platformio/builder/main.py +++ b/platformio/builder/main.py @@ -52,6 +52,7 @@ commonvars.AddVariables( ("BOARD_MCU",), ("BOARD_F_CPU",), ("BOARD_F_FLASH",), + ("BOARD_FLASH_MODE",), # upload options ("UPLOAD_PORT",), diff --git a/platformio/builder/scripts/espressif.py b/platformio/builder/scripts/espressif.py index 590f8d6a..0499c68a 100644 --- a/platformio/builder/scripts/espressif.py +++ b/platformio/builder/scripts/espressif.py @@ -149,7 +149,7 @@ env.Append( '"%s"' % join("$PLATFORMFW_DIR", "bootloaders", "eboot", "eboot.elf"), "-bo", "$TARGET", - "-bm", "dio", + "-bm", "$BOARD_FLASH_MODE", "-bf", "${__get_board_f_flash(__env__)}", "-bz", "${__get_flash_size(__env__)}", "-bs", ".text",