Skip to content
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

A fatal error occurred: Failed to write to target RAM (result was 01070000: Operation timed out) (ESPTOOL-725) #908

Closed
1 task done
kymatomo opened this issue Aug 18, 2023 · 5 comments

Comments

@kymatomo
Copy link

kymatomo commented Aug 18, 2023

Operating System

Windows 10

Esptool Version

v4.5.1

Python Version

Python 3.11.3

Chip Description

ESP-WROOM-32

Device Description

Dev Module on a breadboard.

Hardware Configuration

No response

How is Esptool Run

Arduino IDE, esptool.py, Arduino Cloud

Full Esptool Command Line that Was Run

esptool.py --port COM3 read_flash 0x00000 0x100000 image1M.bin

Esptool Output

esptool.py v4.6.2
Serial port COM3
Connecting....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting.......
Detecting chip type... ESP32
Chip is ESP32-D0WD-V3 (revision v3.0)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 54:43:b2:c5:0d:64
Uploading stub...

A fatal error occurred: Failed to write to target RAM (result was 01070000: Operation timed out)

py -m esptool --port COM3 write_flash_status --non-volatile 0

esptool.py v4.6.2
Serial port COM3
Connecting......
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting.......
Detecting chip type... ESP32
Chip is ESP32-D0WD-V3 (revision v3.0)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 54:43:b2:c5:0d:64
Uploading stub...
Running stub...
Stub running...

A fatal error occurred: Unable to verify flash chip connection (Packet content transfer stopped (received 138 bytes)).

More Information

I first tried it with Arduino IoT Cloud Sketch and I get this

esptool.py v4.2.1
Serial port COM3
Connecting....
Chip is ESP32-D0WD-V3 (revision 3)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 54:43:b2:c5:0d:64
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00005fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x00120fff...
Compressed 18912 bytes to 13025...
Writing at 0x00001000... (100 %)
Wrote 18912 bytes (13025 compressed) at 0x00001000 in 0.2 seconds (effective 844.7 kbit/s)...
File md5: e7d5057d627598659b7aa7b697f6cff6
Flash md5: 4ca6a95d1789c3d6317811ab47dfa684
MD5 of 0xFF is 4ca6a95d1789c3d6317811ab47dfa684
A fatal error occurred: MD5 of file does not match data in flash

I open the Full Editor and get the same output. So I tried using an example code in Arduino IDE which is "WiFiScan"

esptool.py v4.5.1
Serial port COM3
Connecting....
Chip is ESP32-D0WD-V3 (revision v3.0)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 54:43:b2:c5:0d:64
Uploading stub...

A fatal error occurred: Failed to write to target RAM (result was 01070000: Operation timed out)
Failed uploading: uploading error: exit status 2'

I've tried changing baud rates and doing --no-stub but it doesnt work.

Other Steps to Reproduce

No response

I Have Read the Troubleshooting Guide

  • I confirm I have read the troubleshooting guide.
@github-actions github-actions bot changed the title A fatal error occurred: Failed to write to target RAM (result was 01070000: Operation timed out) A fatal error occurred: Failed to write to target RAM (result was 01070000: Operation timed out) (ESPTOOL-725) Aug 18, 2023
@radimkarnis
Copy link
Collaborator

Hello @Kymasola,

this issue is usually caused by delays in the UART communication, which can be a result of faulty drivers or the USB-to-UART bridge.

See this similar issue: #280 (comment)

A possibility is to use a configuration file and increase the timeouts used by esptool.

Please try to do this and let me know if that helped. Thanks!

@hhartzer
Copy link

I'm getting this error as well with 4.7.0. I tried setting mem_end_rom_timeout = 10, but it still seems to timeout rapidly.

@lawrencebensaid
Copy link

Any update on this? I have the same issue. Feels like I've tried everything..

@Stan-T889
Copy link

Uploading stub...

A fatal error occurred: Failed to write to target RAM (result was 01070000: Operation timed out)
Failed chip erase: uploading error: exit status 2

The same syndrom in my lab. After updating the CP2104 driver, the result is the same. Doubt that the problem is chip related, due to " ... chip is ESP32-D0WD-V3 (revision v3.1) "

@kiler129
Copy link

@lawrencebensaid @Stan-T889:

If you're on macOS this is most likely issue with WCH CH3xx UART chipset. Either use a different one (e.g. legitimate FTDI, RPi or similar), or if you trust it you can install https://github.com/WCHSoftGroup/ch34xser_macos
This isn't a new problem and nothing to do with esptool - https://meshtastic.discourse.group/t/failed-to-write-to-target-ram-result-was-01070000/3874/25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants