Hello Friends of tiny MCUs.
I'd like to compile the Arduino Bootloader "ATmegaBOOT_168" and flash it to an Arduino Duemilanove using Atmel Studio 6.2 ( I am new to Atmel Studio - bloady thing).
Therefore I've copied the file to a Project and added the missing definitions that normally come from the Makefile.
#define BAUD_RATE 57600
#define F_CPU 16000000L
#define MAX_TIME_COUNT F_CPU>>4
#define NUM_LED_FLASHES 3
#define EEWE 1
The file compiles fine and I am able to upload the bootloader using avrdude (added as external tool). I recognize that the bootloader is running because it repeats blinking the LED three times as defined.
But when I try to upload a Sketch using Arduino 1.6.4, I get the message that there are some verification errors AFTER the upload (and the sketch does not start).
avrdude: verification error, first mismatch at byte 0x0002
0x34 != 0x5c
avrdude: verification error; content mismatch
Does anybody know how to set up an Atmel Studio Project in order to compile the bootloader for Arduino correctly?
Does anybody know how to set up this Project to use the Arduino's Version of the avr toolchain and libraries so I do not need to define EEWE at all ( I know that there are version differences and maybe some Arduino-specific changes??)
Thanks a lot in advance.
You ask why?
Because I'd like to play around with the bootloader in order to dig deeper into this rabbit hole.