Skip to content

Flash Read Failed - OTA Update #7936

Closed
Closed
@malyjak

Description

@malyjak

Board

ESP 32 Dev Module

Device Description

DevKitC on plain breadboard

Hardware Configuration

None

Version

v2.0.7

IDE Name

Arduino IDE

Operating System

Windows 11

Flash frequency

80MHz

PSRAM enabled

no

Upload speed

921600

Description

After calling

Update.begin(UPDATE_SIZE_UNKNOWN, cmd)

from Update library, where cmd is:

cmd = (filename == "filesystem") ? U_SPIFFS : U_FLASH;

in case of U_FLASH an error is produced in serial monitor:

Flash Read Failed

and the update process is terminated.

In case of U_SPIFFS , everything goes well.

Sketch

void handleUpload(AsyncWebServerRequest *request, String filename, size_t index, uint8_t *data, size_t len, bool final)
{
  if (!index)
  {
    int cmd = (filename == "filesystem") ? U_SPIFFS : U_FLASH;
    if (!Update.begin(UPDATE_SIZE_UNKNOWN, cmd))
    {
      Update.printError(Serial);
      return request->send(400, "text/plain", "OTA could not begin");
    }
  }

  // Flash the new firmware.
  if (len)
  {
    if (Update.write(data, len) != len) {
      return request->send(400, "text/plain", "OTA could not write");
    }
  }

  if (final)
  {
    if (Update.end(true))
    {
      Serial.println("Update successful!");
      Serial.println("Rebooting...");
    }
    else
    {
      Update.printError(Serial);
    }
  }
} // End: handleUpload()

Debug Message

Flash Read Failed

Other Steps to Reproduce

I'm using https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json in Arduino IDE 1.8.19 to get this BSP. The reason for 1.8.19 is that I need https://github.com/me-no-dev/arduino-esp32fs-plugin to save web server data on the file system and 2.x seems not to support external tools.

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.

Metadata

Metadata

Assignees

Labels

Priority: High 🗻Issues with high priority which needs to be solved first.Status: Needs investigationWe need to do some research before taking next steps on this issue

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions