Introduction

The bootloader is a small piece of software that allows sketches to be uploaded onto an Arduino board. It is preprogrammed into the microcontrollers on these boards. If the bootloader becomes corrupted or is intentionally removed, it can be restored by burning (also known as flashing or programming) a new bootloader onto the board.


If your Arduino board (such as the UNO, Mega, or classic Nano) is not functioning properly or you are unable to upload new sketches, the bootloader may be the problem. You can re-burn the bootloader using another working Arduino as an ISP (In-System Programmer). This guide will explain how to do this using the Arduino IDE and jumper wires.


What You Need

ItemQuantity
A working Arduino board (e.g., UNO)1
The target Arduino board (UNO, Mega, or Nano)1
Jumper wires (male-to-male)6 or more
Arduino IDE (latest version recommended)Installed on PC

Step-by-Step Instructions

Step 1: Connect the boards

AVR boards are programmed using the SPI interface, which includes COPI, CIPO, and SCK signals. On many boards, such as the UNO, Mega, and Nano, these signals are accessible in two locations.

  • The digital and power pins are the most commonly used pins on an Arduino, and you will only need six standard male-to-male jumper wires.
  • The ICSP header features CIPO, COPI, and SCK, which are found in a consistent physical location. Female-to-female jumper cables are required to connect to these pins.


Option A: Using the digital and power pins

For each row in the table below, connect the programmer pin to the corresponding target pin.

PROGRAMMER BOARDTARGET BOARD
PIN 10RESET
COPI
UNO: PIN 11
Nano: PIN 11
Mega: PIN 51
COPI
UNO: PIN 11
Nano: PIN 11
Mega: PIN 51
CIPO
UNO: PIN 12
Nano: PIN 12
Mega: PIN 50
CIPO
UNO: PIN 12
Nano: PIN 12
Mega: PIN 50
SCK
UNO: PIN 13
Nano: PIN 13
Mega: PIN 52
SCK
UNO: PIN 13
Nano: PIN 13
Mega: PIN 52
5V5V
GNDGND

Once the boards are connected, you can proceed to burn the bootloader using Arduino IDE.

Option B: Using the ICSP header pins


Note that the orientation of the header relative to the USB port is different on the Nano.

  1. Connect every programmer ICSP pin except RESET to the equivalent ICSP pin on the target.
  2. Connect PIN 10 on the programmer board to any RESET pin on the target.

Step 2: Burn the bootloader in Arduino IDE

With the board connections properly configured, we can now use the Arduino IDE to upload the bootloader.

  1. Open Arduino IDE.

  2. Connect the programmer board to the computer.

  3. Select your programmer board in Tools > Board, for example, Tools > Board > Arduino AVR Boards > Arduino Uno.

  4. Select the port the board is connecting to in Tools > Port.

  5. Open File > Examples > 11.ArduinoISP > ArduinoISP.

    IDE with ArduinoISP example selected in the menu

  6. Click Upload button Upload to upload the sketch to the board.

  7. Select the target board in Tools > Board.

  8. Select Tools > Programmer > Arduino as ISP.

  9. We can now start the burning process. It’s a good idea to enable verbose upload output in preferences since there will be no console output during the process otherwise. To start the process, select Tools > Burn Bootloader.

    IDE with Burn Bootloader selected in the menu

  10. Wait for the process to complete, which may take up to one minute. Once finished, the message "Done burning bootloader" will appear at the top of the console or in a notification pop-up at the bottom right, depending on your IDE version.


Troubleshooting

Error: Missing programmer

avrdude: Yikes!  Invalid device signature.         Double check connections and try again, or use -F to override         this check. 
Error while burning the bootloader: Failed chip erase: uploading error: exit    status 1


  • Check your selection in Tools > Programmer.
  • Error: Failed chip erase: uploading error: exit status 1

Error while burning the bootloader: Failed chip erase: uploading error: exit status 1
  • Make sure you’ve selected the target board in Tools > Board.
  • Make sure you’ve connected the RESET pin correctly.

avrdude: Error: Could not find USBtiny device

Error while burning bootloader. avrdude: Error: Could not find USBtiny device (0x2341/0x49) 

Make sure you’ve selected Arduino as ISP in Tools > Programmer, and not ArduinoISP or other similar options.


References