Recipe
When an upload fails, in order
Use when: a sketch won't compile, won't upload, or uploads but doesn't work, on an Uno R4 Minima or an ESP32-S3-DevKitC-1
Goal: the one stage that failed, found and fixed, with every earlier stage known to work
Taught in When flashing fails
Quick recipe
-
1
If not, fix the first
error:line. Check that the right board is selected and that every library the sketch includes is installed.Why: nothing past this point matters until there is a build.
-
2
Unplug, replug, compare the lists. No new port: try a data cable, another socket, then (bridge chips only) the chip maker's driver.
- Linux says Permission denied — join dialout (uucp on Arch), log out and in.
- a native-USB port that was there and vanished after an upload — the sketch has stopped its USB; go to step 4.
Why: the upload tool needs a port it can open.
-
3
Select them again. Close any other serial monitor.
Why: a busy port or a stale selection fails the same way as a missing one.
-
4
Force the bootloader. ESP32-S3: hold Boot, press and release Reset, release Boot, upload. Uno R4: double-tap Reset right after plugging in, select the port again, upload.
Why: a crashed sketch can't hand over to the bootloader, but the bootloader can always be reached by hand.
-
5
Check the wiring and the pin number for this board. Check which port
Serialuses (USB CDC On Boot on the ESP32-S3) and the monitor's baud. If the ESP32-S3 waited in download mode, press Reset once.Why: a successful upload proves only that the bytes arrived.
Common mistakes
- Changing cable, port and settings all at once, so the real fix stays unknown.
- Reading the last error instead of the first.
- Reinstalling the IDE when the compiler already worked.
- Assuming a lit power LED proves the cable carries data.