Fix “Failed to write to target RAM (result was 01070000: Operation timed out)”
The ROM bootloader timed out while esptool loaded its stub into RAM. Enter download mode by hand, lower the upload speed and fix power and cable.
Community draft — report a mistake
What you see
esptool.py v4.6.2
Serial port COM8
Connecting...
Chip is ESP32-S3 (revision v0.1)
Features: WiFi, BLE
Crystal is 40MHz
MAC: 34:85:18:xx:xx:xx
Uploading stub...
A fatal error occurred: Failed to write to target RAM (result was 01070000: Operation timed out)
Failed uploading: uploading error: exit status 2esptool.py v4.6.2 Serial port COM8 Connecting... Chip is ESP32-S3 (revision v0.1) Features: WiFi, BLE Crystal is 40MHz MAC: 34:85:18:xx:xx:xx 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
Before flashing, esptool copies a small “stub” loader into the ESP32’s RAM. The chip’s ROM bootloader handles that copy, and if a block does not arrive in time it answers with code 0x0107, “Operation timed out”.
Something interrupted the conversation in its first few seconds: a reset, a power dip or a slow link. Check them in that order.
Quick fix — try in order
- 1
Enter download mode by hand and retry
Hold BOOT, tap RESET, release BOOT. A sketch that keeps resetting the chip interrupts the stub upload.
- 2
Lower Upload Speed to 115200
Marginal cables and USB-serial chips time out here first.
- 3
Give the board proper power
Unplug LED strips, servos, displays and anything on 5 V. A brownout while RAM is being written resets the chip and the write times out.
- 4
Update the ESP32 core
Boards Manager → esp32 by Espressif → latest. Early esptool versions had stub timing bugs with first-revision ESP32-S3 chips.
Why it happens
What is the “stub”?
esptool uploads a small helper program into the chip's RAM first, then talks to it for the actual flashing. This error means writing that helper into RAM failed.
What is 01070000?
The status bytes returned by the ROM. 0x0107 means “Operation timed out” — the ROM gave up waiting for the next block of data.
USB 3 hubs
Some hubs add latency the ROM's tight timeout cannot tolerate. Plug in directly.
Board-specific notes
ESP32-S3 revision v0.1: Early S3 boards hit this more often. Uploading through the UART port of a DevKitC-1 instead of the native USB port is a reliable workaround.
Did this fix it?
Thanks — that helps us keep this page right.