ESP32-S2 fails ArduinoOTA uploads with a "Flash Read Failed"

noebl1
Posts: 6
Joined: Sun Aug 08, 2021 2:53 pm

ESP32-S2 fails ArduinoOTA uploads with a "Flash Read Failed"

Postby noebl1 » Fri Nov 19, 2021 8:19 pm

I'm using an ESP32-S2 with PlatformIO to try to get an ArduinoOTA working, but fails every time with "Flash Read Failed" after the upload hits 100%:

Code: Select all

Configuring upload protocol...
AVAILABLE: esp-prog, espota, esptool, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa
CURRENT: upload_protocol = espota
Uploading .pio/build/esp32dev/firmware.bin
15:10:17 [DEBUG]: Options: {'esp_ip': '192.168.5.141', 'host_ip': '0.0.0.0', 'esp_port': 3232, 'host_port': 50000, 'auth': '', 'image': '.pio/build/esp32dev/firmware.bin', 'spiffs': False, 'debug': True, 'progress': True, 'timeout': 10}
15:10:17 [INFO]: Starting on 0.0.0.0:50000
15:10:17 [INFO]: Upload size: 737712
Sending invitation to 192.168.5.141 

15:10:17 [INFO]: Waiting for device...
Uploading: [============================================================] 100% Done...

15:10:38 [INFO]: Waiting for result...
15:10:38 [INFO]: Result: Flash Read Failed


15:10:38 [INFO]: Result: 
15:10:38 [INFO]: Result: 
15:10:38 [INFO]: Result: 
15:10:38 [INFO]: Result: 
15:10:38 [ERROR]: Error response from device
*** [upload] Error 1

How I am configuring the Arduino setup:

Code: Select all

ArduinoOTA
    .onStart([]() {
      String type;
      if (ArduinoOTA.getCommand() == U_FLASH)
         type = "sketch";
      else // U_SPIFFS
        type = "filesystem";

      // NOTE: if updating SPIFFS this would be the place to unmount SPIFFS using SPIFFS.end()
      Serial.println("Start updating " + type);
    })
    .onEnd([]() {
      Serial.println("\nEnd");
    })
    .onProgress([](unsigned int progress, unsigned int total) {
      Serial.printf("Progress: %u%%\r", (progress / (total / 100)));
    })
    .onError([](ota_error_t error) {
      Serial.printf("Error[%u]: ", error);
      if (error == OTA_AUTH_ERROR) Serial.println("Auth Failed");
      else if (error == OTA_BEGIN_ERROR) Serial.println("Begin Failed");
      else if (error == OTA_CONNECT_ERROR) Serial.println("Connect Failed");
      else if (error == OTA_RECEIVE_ERROR) Serial.println("Receive Failed");
      else if (error == OTA_END_ERROR) Serial.println("End Failed");
    });

    ArduinoOTA.begin();
Last here's my platformio ini file:

Code: Select all

[env:esp32dev]
platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#2.0.1
platform = espressif32
board = esp32dev
framework = arduino
board_build.mcu = esp32s2
monitor_speed = 115200
monitor_port = /dev/ttyUSB0
; upload_port = /dev/ttyUSB0
	
upload_port = 192.168.5.141
upload_protocol = espota
upload_flags = 
 	--host_port=50000

I'm seeing this on two different ESP32-S2 boards, is there something in the configuration I am doing incorrectly? Thank you!

Who is online

Users browsing this forum: No registered users and 30 guests