PlatformIO Community

ESP-IDF project won't upload, but a different ESP-Arduino project works fine

My old ESP-Arduino uploads fine via ESP-PROG.

The working platform.ini looks like this:

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
build_unflags = -std=gnu++11
build_flags = -std=gnu++17
monitor_port = /dev/ttyUSB1
monitor_speed = 115200
monitor_filters = log2file, default
upload_port = /dev/ttyUSB1
lib_deps = 
	bblanchon/ArduinoJson@^6.18.3
	https://github.com/me-no-dev/ESPAsyncWebServer.git
	https://github.com/me-no-dev/AsyncTCP.git

When I try to upload my new project built in ESP-IDF to the same board, without touching the hardware, I get the following error:

Serial port /dev/ttyUSB1
Connecting......................................

A fatal error occurred: Failed to connect to ESP32: Serial data stream stopped: Possible serial noise or corruption.
For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html
*** [upload] Error 2

This is what the monitor output while I’m trying to upload looks like:

ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x1 (DOWNLOAD_BOOT(UART0/UART1/SDIO_FEI_REO_V2))
waiting for download
�␁ ␁␁ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x1 (DOWNLOAD_BOOT(UART0/UART1/SDIO_FEI_REO_V2))
waiting for download
␁␇␁

The esp-idf platform.io file is very similar to the working one for ESP-Arduino:

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = espidf
build_unflags = -std=gnu++11
build_flags = -std=gnu++17
monitor_port = /dev/ttyUSB1
monitor_speed = 115200
monitor_filters = log2file, default
upload_port = /dev/ttyUSB1
lib_deps = 

I would really appreciate any idea what could be going on? I’m completely out of ideas.

When you rollback to platform = espressif32 @ 3.5.0 in the platformio.ini, does upload with a ESP-IDF project work again?

Hi Max,

Thanks for your suggestion! Strangely, I got this to work by lowering the monitor_speed to 9600. Even more strangely, after gradually increasing it, speeds up to 460800 work well now.