Wdt problem after upload to Sonoff S20 (ESP8266)

I’ve experienced som problems with Sonoff S20. Upload OK but then watchdog timeout after restart.
Did some searching and fiddling by changing build options (using options from ESP Easy source) but no luck. Current platform.ini is:

[env:esp12e_1m]
platform = espressif8266
framework = arduino
board = esp12e
upload_speed=460800
build_flags = -Wl,-Tesp8266.flash.1m128.ld -D PLUGIN_BUILD_NORMAL -D

I then tried flashing using esptool instead using then binary built by PlatformIO and it worked!

esptool.py --port /dev/tty.usbserial-A50285BI --baud 460800 write_flash --flash_size=8m -fm dio 0 ~/Dropbox/Hem/Arduino/S20Indicator/.pioenvs/esp12e_1m/firmware.bin

How can I make PlatformIO upload in a way that works similar to when I used esptool?

Also, since reflashing Sonoff devices is rather common, it would be nice to have them available as “boards”.

Could you provide an output of pio run -t upload -v? We will see detail uploading log.

Could you make PR to?