Skip to content

ESP32-S2 read_flash fails on linux (ESPTOOL-590) #823

@overflo23

Description

@overflo23

Operating System

Ubuntu 22.04.1 LTS

Esptool Version

3.0 - 4.4

Python Version

Python 3.10.6

Chip Description

ESP32-S2FH4 (revision v0.0) / ESP32-S2FNR2 (revision v0.0)

Device Description

ESP32-S2 mini

Hardware Configuration

no

How is Esptool Run

shell

Full Esptool Command Line that Was Run

esptool.py read_flash 0 0x400000 /tmp/foo.bin

Esptool Output

stall while reading flash at a certain page
running with --no-stub works till 0x200000 then it hangs.
reading from > 0x200000 with --no-stub returns:
A fatal error occurred: Failed to read flash block (result was 01090000: CRC or checksum was invalid)

when running in normal mode it goes like this:

esptool.foo.py  read_flash 0 0x400000 /tmp/foo.bin 
esptool.py v4.4
Found 1 serial ports
Serial port /dev/ttyACM0
Connecting...
Detecting chip type... Unsupported detection protocol, switching and trying again...
Detecting chip type... ESP32-S2
Chip is ESP32-S2FNR2 (revision v0.0)
Features: WiFi, Embedded Flash 4MB, Embedded PSRAM 2MB, ADC and temperature sensor calibration in BLK2 of efuse V1
Crystal is 40MHz
MAC: 84:f7:03:eb:86:80
Uploading stub...
Running stub...
Stub running...
933888 (22 %)

stalled, hangs right there, wont continue.
--
after posting on the adafruit circuitpython forums i was sent to a similar bug report here:
https://github.com/espressif/esptool/issues/658

this seems to be the same bug.

the weirdest thing:
if i run it on a mac with OSX, it works.
i can read0->0x400000 with no errors.

More Information

i tried different things.
flash_erase -> read -> works retuns 4 MB of 0xff as expected
installing tinyuf2-lolin_s2_mini-0.11.0 with write_flash works, starts up, opens its volume..
after that i can read back all data from 0->0x400000 without error including the tinyuf2 bootloader
than i installed circuitpython-8.0-beta6 (but this doesnt really matter)
the led flashed as the flash is written, reboot -> works as expected.

but now i cant dump the flash anymore.
it hangs at 933888

manually i can read till 937984 after that the read hangs a random locations.
937984 - 933888 = 4095
is this a pagesize?

Other Steps to Reproduce

see "more information" for steps o reproduce

I Have Read the Troubleshooting Guide

  • I confirm I have read the troubleshooting guide.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions