This is an old revision of the document!
You need to make sure that you can flash the arduino bootloader again onto the chip.
For this you need an programmer like the AVR Dragon.
This is the wiring connection for the AVR Dragon to the Trigorilla ISP connector:
AVR Dragon ISP (pin) | Trigorilla ISP connector (pin) |
---|---|
1: MISO | 1: D50 (Mega2560 pin 22) |
2: VTG | 2: +5v |
3: SCK | 3: D52 (Mega2560 pin 20) |
4: MOSI | 4: D51 (Mega2560 pin 21) |
5: RESET | 5 RESET (Mega2560 pin 30) |
6: GND | 6: GND |
To flash the bootloader, download and install avrdude:
gunzip -c avrdude-6.3.tar.gz | tar xf - cd avrdude-6.0 ./configure make su root -c 'make install'
In /etc/udev/rules.d add (obviously as root user) the following file: 45-atmel.rules
# Atmel Corp. Dragon ATTR{idVendor}=="03eb", ATTR{idProduct}=="2107", MODE="660", GROUP="dialout"
Then reload udev rules with:
sudo udevadm control --reload-rules && udevadm trigger
Steps and information below basically follow the description from here.
A bootloader can be found in the arduino directory from where you downloaded the arduino IDE itself. The location for Arduino-1.8.5 is:
Original bootloader:
arduino-1.8.5/hardware/arduino/avr/bootloaders/stk500v2/Mega2560-prod-firmware-2011-06-29.hex
or the newer one that fixes the WDT and the !!! problems1):
arduino-1.8.5/hardware/arduino/avr/bootloaders/stk500v2/stk500boot_v2_mega2560.hex
avrdude -p m2560 -P usb -c dragon_isp -v
avrdude -p m2560 -c dragon_isp -P usb -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xD8:m -Ulfuse:w:0xFF:m -e -v
avrdude -p m2560 -c dragon_isp -P usb -Uflash:w:stk500boot_v2_mega2560.hex:i -Ulock:w:0x0f:m -v