Bootloader and Fuse Configuration

If this is the first time you have programmed a FireFly node, make sure the fuses are set correctly. Once the fuses are set, they should remain programmed unless there is a downloading problem later. If you want to be able to program the FireFly node without an external programmer, then you need to load a serial bootloader

Fuse configuration

A set of standard fuse configurations can be found in nano-RK/tools/fuse-conf/. For the FireFly3, you can use the Atmel MKII or AVR dragon programmer (replace avrispmkII with dragon_isp for the dragon programmer) to set the fuses. Standard fuse settings can be found in the "firefly3_x/ft-set-fuses-bootloader-mkII" script, or by running:

avrdude -b115200 -F -p atmega128 -P usb  -c avrispmkII -V -U lfuse:w:0xEC:m -v
avrdude -b115200 -F -p atmega128 -P usb  -c avrispmkII -V -U hfuse:w:0xDA:m -v
avrdude -b115200 -F -p atmega128 -P usb  -c avrispmkII -V -U efuse:w:0xFF:m -v

Serial Bootloader

Next, you need to load the serial bootloader which can be found in nano-rk/tools/ff3_serial_bootloader. The main.hex file contains an already compiled bootloader image. You can load this with the Atmel MKII by running the following command:

avrdude -b 115200 -F -p atmega128 -P usb -c avrispmkII -V -U flash:w:main.hex