I am trying to understand how to configure flash size for ESP8266 board because I have Arduino Uno wifi with ATmega328 and ESP8266 with 16 MB of flash on the same PCB.
What I did first was to here find a board which has 16 MB flash (WEMOS D1 mini Pro) and after I configured the environement as:
[env:d1_mini_pro]
platform = espressif8266
board = d1_mini_pro
framework = arduino
upload_speed = 921600
everything worked as expected.
However, I then remembered some old webUI project where flash was configured like this by build_flags = -Wl,-Teagle.flash.4m1m.ld
:
; eagle.flash.512k0.ld 512K (no SPIFFS)
; eagle.flash.512k64.ld 512K (64K SPIFFS)
; eagle.flash.512k128.ld 512K (128K SPIFFS)
; eagle.flash.1m0.ld 1M (no SPIFFS)
; eagle.flash.1m64.ld 1M (64K SPIFFS)
; eagle.flash.1m128.ld 1M (128K SPIFFS)
; eagle.flash.1m144.ld 1M (144K SPIFFS)
; eagle.flash.1m160.ld 1M (160K SPIFFS)
; eagle.flash.1m192.ld 1M (192K SPIFFS)
; eagle.flash.1m256.ld 1M (256K SPIFFS)
; eagle.flash.1m512.ld 1M (512K SPIFFS)
; eagle.flash.2m.ld 2M (1M SPIFFS)
; eagle.flash.4m1m.ld 4M (1M SPIFFS)
; eagle.flash.4m2m.ld 4M (2M SPIFFS)
; eagle.flash.4m.ld 4M (3M SPIFFS)
; eagle.flash.8m.ld 8M (7M SPIFFS)
; eagle.flash.16m.ld 16M (15M SPIFFS)
[env:myboard]
platform = espressif8266
board = esp12e
build_flags = -Wl,-Teagle.flash.4m1m.ld
...
but here in PlatformIO documentation it says the right way of configuring the size is by using:
[env:myenv]
board_build.ldscript = eagle.flash.*.ld
I was trying to find the documentation about -T
build flag but I couldn’t find it anywhere.
My questions are:
-
Where is the documentation about
-T
build flag? -
Is there any difference between configuring the flash size by using the mentioned build flag and using
board_build.ldscript
option?