PlatformIO Community

Unable to flash ESP-07 correctly

Hi,

I’m unable to run my compiled/flashed code with platformIO on my esp-07 (1MB). Esptool does flash the binary, but it boots with garbage:

rl␀d���␂�c␃�n␌␄␄�␄$�␌B|����p␃��|␛"�␌#��oN�␀dNn���␌#␜p��$rdrlp�n�␐␂␌␌�␌l␄��␄␌␌B␌o�|␃�␄��␌␄b��no�␀l��l␂�␓␛oN␌�{l␎␃or���o␄␌��␃p�N�␐␂␄␌␃␄␄␌␌␄␌␌␄b␌o�|␃lB␜�␌␄��l␄␄쎄␄b��Nn�␂␄�␀l ␂␜�o��␃o��␒�␃d�|��bdܾ��|␂␓{rN␛�N��␂N�p~�ے`␃␛�r��N�c�Nbp␀�

I verified the code/board works by flashing it through arduino IDE, which works fine.
My environment looks as followed:

[env:esp07]
platform = espressif8266
board = esp07
framework = arduino
monitor_speed = 115200
monitor_port = /dev/ttyUSB0

Looks like the bootloader is stuck in a loop because a a setting has not been equalized between the Arduino IDE and PlatformIO.

Can we see a screenshot of the Arduino IDE → Tools menu that works for your board?

Wait, if it just does that once at the beginning and not in a loop, but it executes your firmware later just fine, then everything is actually correct. The ESP8266’s bootloader baud is 74480, and it initially spews out some messages. The Arduino IDE has special code to supress this, PlatformIO doesn’t supress the device’s output. But at the baud set to 115200, this will appear like garbage of course. If you’re interested in reading these messages, switch your firmware to the same baud rate and monitor_speed accordingly.

Sometimes it also spawns out fatal exceptions (I only had that once). It only prints this at the beginning, after that no serial communications.

Arduino settings:

{
    "configuration": "xtal=80,vt=flash,exception=disabled,stacksmash=disabled,ssl=all,mmu=3232,non32xfer=fast,ResetMethod=ck,CrystalFreq=26,FlashFreq=40,FlashMode=dout,eesz=1M256,led=2,sdk=nonosdk_190703,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=115200",
    "board": "esp8266:esp8266:generic",
    "port": "/dev/ttyUSB0",
    "sketch": "esp12-wireless-sensor-board.ino",
    "output": "../build"
}

PlatformIO sets this by default to QIO

so better do

board_build.flash_mode = dout

in the platformio.ini to be sure.

Otherwise,

then that’s not a problem per above.

I gave up on platformIO. I had kinda the same problem with my ESP32-C3 1MB version. Unable to flash properly, it hangs in a boot-loop after flashing.

I fully switched back the the Arduino IDE plugin in VScode, which seems to compile and flash all my targets fine.

Thanks @maxgerhardt, adding:

board_build.flash_mode = dout

to platformio.ini fixed the flashing problem for me with an ESP07 and changing:

monitor_speed = 74480

in platformio.ini enabled me to read the monitor text.

Grateful for your on-going assistance with many many issues!
Regards - Andrew