🛠 Réparer une UNO muette : 16U2, DFU et programmation ICSP
Objectives
Regain control of your board when uploading fails: understand the two processors on the UNO (the ATmega328P application processor with its STK500/Optiboot bootloader, and the ATmega16U2 which acts as the USB-to-serial bridge and has its own DFU bootloader), know how to restore either one, and bypass the bootloader via ICSP.
Hardware
- 1 "dead" Arduino UNO R3 (USB port invisible, or upload timeout)
- 1 second Arduino (UNO/other) as an ISP programmer + 6 Dupont wires, or a USBasp/AVRISP programmer
- Arduino IDE with arduino-core AVR, or arduino-cli + avrdude via command line
- On older R1/R2 boards: the chip is an ATmega8U2, the DFU procedure is different — check the reference marked on the chip.
Complete Code
- Diagnosis — is the 328P alive? Is an already uploaded sketch running? (Pulsing LED = bootloader OK, problem on the port/IDE side). 2) ICSP programming using a second UNO as ISP:
Câblage ISP (UNO programmateur -> UNO cible), broches identiques broche à broche :
1 (MOSI) -> 1 (MOSI) 2 (VCC 5V) -> 2 (VCC)
3 (GND) -> 3 (GND) 4 (MISO) -> 4 (MISO)
5 (SCK) -> 5 (SCK) 6 (RESET) -> 6 (RESET)
# Avec arduino-cli (une fois la carte cible « Arduino Uno » sélectionnée) :
arduino-cli core install arduino:avr
arduino-cli program --protocol arduino --board arduino:avr:uno firmware.hex
# Bootloader : « Graver la séquence d'initialisation » dans l'IDE, ou :
arduino-cli burn-bootloader -b arduino:avr:uno -p /dev/ttyACM0 # via ISP d'une carte ISP
# Si le port USB a disparu (16U2 bloqué par un reflash raté) :
# court-circuiter les deux broches du jump « RESET-ATMEGA16U2 » (à côté de la puce),
# brancher l'USB, puis flasher le firmware USB via DFU :
dfu-programmer atmega16u2 erase
dfu-programmer atmega16u2 flash atmega16u2-mk3-arduino-1.0.1.hex
dfu-programmer atmega16u2 reset
Expected Verification
After burning the bootloader via ICSP: the 328P blinks its bootloader again (LED L blinking rapidly at startup) and uploading via USB works again. After reflashing the 16U2 via DFU: the serial port reappears in the device manager. The final test: upload Blink, then unplug/replug — the LED starts on its own.
Common Errors
- Confusing the two chips: a disappearing USB port = 16U2 (DFU); an upload timeout while the port exists = 328P (bootloader, to be burned via ICSP).
- Reflashing the 16U2 in DFU and using the wrong firmware (mk2 vs mk3, or 8U2 on an R3): the port remains invisible until the next successful DFU — hence the 16U2 reset jumpers, which should not be confused with the 328P reset.
- Forgetting to power the target board in ISP (pin 2 VCC): avrdude responds "target not responding".
- Clones: different regulator and USB chip, official Arduino firmwares do not apply — look for the clone manufacturer's firmware.
- Powering via jack at 20 V during the procedure: the linear regulator heats up, and VIN has NO reverse polarity protection — never inject power via VIN without an external diode.
Other tutorials for this board
Code examples for this board
clignotante.inoArduinobouton-poussoir.inoArduinopwm-fade.inoArduinocapteur-lumiere-ldr.inoArduinoservo-balayage.inoArduinoruban-neopixel.inoArduino