Recipe
Upload firmware to a board
Use when: you have a sketch that compiles and a board on a USB cable, and want the board running it
Goal: the board running the new program, confirmed by what it does
Taught in Bootloaders and uploading
Quick recipe
-
1
In the IDE pick the exact board (ESP32S3 Dev Module, Arduino UNO R4 Minima); with arduino-cli use its FQBN.
Why: the board decides the compiler, the addresses and the upload tool.
-
2
Choose the port that appears when you plug the board in.
- no port — check the cable, then force upload mode (step 5).
- two new ports (a DevKitC-1 plugged in by both connectors) — pick the one for the connector you mean to use.
Why: the upload tool sends to exactly one port.
-
3
Click Verify, or run
arduino-cli compile --fqbn <fqbn> <sketch>. Fix the first error before anything else.Why: an upload can only send a build that exists.
-
4
Click Upload, or run
arduino-cli upload -p <port> --fqbn <fqbn> <sketch>. Wait for the tool's "done" message.Why: the tool restarts the board into its bootloader, sends the image and restarts it again.
-
5
ESP32-S3: hold Boot, press and release Reset, release Boot, then upload. Uno R4: double-tap Reset right after plugging in, then upload (the port name may change; select it again).
Why: a crashed sketch can't answer the tool's request to restart, but the bootloader always can.
-
6
Watch the board do what the sketch says. If it waited in download mode, press Reset once to start the new program.
Why: "upload complete" proves the bytes arrived, not that the program behaves.
Common mistakes
- Uploading with the wrong board selected: it compiles for the wrong chip.
- Keeping a serial monitor open in another program, which holds the port.
- Wiring a strapping pin so it is pulled low at reset, which sends the ESP32-S3 into download mode every time.