Here you can find a detailed explanation of the problem. Unfortunately, the solution provided there works well only for 5V 16MHz configuration. To solve the issue for the 3.3V 8Mhz boards several extra steps are required.
Arduino distro includes precompiled versions of the optiboot bootloader for several most common targets (including atmega328 5V 16MHz). However there is no precompiled binary for the 3.3V 8MHz version.
So, we need:
- optiboot bootloader source code (can be found on github or in the <arduino-root>/hardware/arduino/avr/bootloaders/optiboot)
- old avr-gcc-4.3.2 toolchain (because the latest versions of avr-gcc produce a bit larger binary file, >512 bytes). E.g. an old Arduino-1.0.5 distro can be used.
pro.menu.cpu.8MHzatmega328.bootloader.file=atmega/ATmegaBOOT_168_atmega328_pro_8MHz.hex
with
pro.menu.cpu.8MHzatmega328.bootloader.file=optiboot/optiboot_atmega328_pro_8MHz.hex
In <arduino-root>/hardware/arduino/avr/bootloaders/optiboot/Makefile replace
atmega328_pro8: CFLAGS += '-DLED_START_FLASHES=3' '-DBAUD_RATE=115200'with
atmega328_pro8: CFLAGS += '-DLED_START_FLASHES=3' '-DBAUD_RATE=57600'
then setup correct paths for the avr-gcc toolchain:
Now we can compile optiboot bootloader for atmega328 3.3V 8MHz configuration using atmega328_pro8 target:
$ cd <arduino-root>/hardware/arduino/avr/bootloaders/optiboot
$ make atmega328_pro8
Then you can burn the bootloader from standard Arduino IDE menu using any ISP programmer.