Skip to main content

flashing a bootloader on arduino clones via icsp using atmel-ice

First of all, you'll need to wire up the connectors between Atmel-ICE AVR port and the Arduino ICSP port. Below is spreadsheet from Atmel-ICE User Guide.

/images/spreadsheet-atmel-ice.png

You also need to know the ICSP Pin Header pinout, which is below:

/images/ICSPHeader.jpg

Pin number 1 is usually marked on the PCB, if not, good luck figuring it out.

Arduino Nano v3 is based on the ATMega328P MCU, which has part ID m328p. You'll also need the path to the corresponding bootloader, which comes with your Arduino installation.

Overriding the baud rate with the -B option is also sometimes needed, try multiple values before giving up. (9600, 19200, 115200, etc.)

$ avrdude -c atmelice_isp -p m328p -B 9600 -U flash:w:$ARDUINO_PATH/packages/arduino/hardware/avr/1.8.2/bootloaders/optiboot/optiboot_atmega328.hex

If you want to use a different programmer, other than the wiring you'll need to find the correct entry for programmer ID in /etc/avrdude.conf instead of using atmelice_isp.