-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESP32-S2 read_flash fails on linux (ESPTOOL-590) #823
Comments
I have also been testing this. The problem occurs even if the board is started up in bootloader mode on power up (hold down BOOT button and plug in), so it doesn't have to do with any odd setup the firmware may do. I tested on an Adafruit Feather ESP32-S2, on two Windows 11 machines, Ubuntu 22.04, and an M1 Mac running macOS 13.1. On the Windows and Ubuntu machines, the stall described above occurs at the same location. On the Mac the I tested with esptool versions back to 3.0 and up to 4.4 on Linux, with the same behavior. My guess is that the contents of flash does not matter, as long as the non-all-1's part is large enough (CircuitPython is pretty big). If flash is completely erased, is the data sent back to the host pretty short (e.g., is it run-length encoded?)? |
Hi @overflo23 @dhalbert, The fact that this is OS-dependent may point to a driver issue, we'll see. |
@radimkarnis Maybe related to the Flash speed increase to 240Mhz in stub loader. |
@Jason2866 this report states that this happens even in esptool v3 - the CPU freq increase is not implemented in that version. So 100% not related. |
I am having the same issue on Windows (10), Linux (Ubuntu 22.04), and macOS (Ventura?). I've tried several different versions of I'm using a Bus Pirate v3.6 for UART, which is in passthrough mode. I've ordered a different device to see if it still happens. The really interesting thing is that by removing Using
Using stub
Using stub with less than 174 bytes
|
I tried this again with a HiLetgo CP2102, and it worked flawlessly on Windows, Ubuntu, and macOS. It's really interesting that this problem only occurs at offsets >2MB and the default baud rate for the Bus Pirate. Per the Bus Pirate's documentation, 115200 should be stable, while any rate greater than 115200 may encounter some buffer issues. So it was a cheap fix but definitely disappointing results for such a widely revered specialized piece of hardware. |
I am also having trouble with the read_flash command with the 2MB boundary read error. The operating environment in which the error is reproduced is ESP-TOOL Version 4.7.0 running at the CMD prompt on Windows 10 Pro (22H2 ). The following log is a record of the error. D:> A fatal error occurred: Failed to read flash block (result was 01090000: CRC or checksum was invalid) D:>esptool --no-stub --baud 115200 read_flash 0x1fffff 1 flash-c6.bin D:> ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー D:> D:>esptool --no-stub --baud 115200 read_flash 0x200000 1 flash-c6.bin A fatal error occurred: Failed to read flash block (result was 01090000: CRC or checksum was invalid) D:> ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー D:> D:>esptool --no-stub --baud 115200 read_flash 0x200000 1 flash-c6.bin A fatal error occurred: Failed to read flash block (result was 01090000: CRC or checksum was invalid) D:> ーーーーーーーーーーーーー |
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
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
The text was updated successfully, but these errors were encountered: