Hi,
I want to build the bootloader sources for ATMEGA2560; so I got back the sources under /stk500v2/ folder in bootloaders folder.
I create Eclipse project with AVR setting, etc. I got back the compiler and linker options from makefile file under /stk500v2/ to set C/C++ setting. However the .hex file generated is different with the orginal stk500boot_v2_mega2560.hex. It's bigger. I can't understand why.
This is some Eclipse messages in the console view:
Building file: ../src/stk500boot.c
Invoking: AVR Compiler
avr-gcc -w -Os -fpack-struct -fshort-enums -fno-jump-tables -std=gnu99 -funsigned-char -funsigned-bitfields -Wstrict-prototypes -Wa,-adhlns=../src/stk500boot.lst -mmcu=atmega2560 -DF_CPU=16000000UL -MMD -MP -MF"src/stk500boot.d" -MT"src/stk500boot.d" -c -o "src/stk500boot.o" "../src/stk500boot.c"
Finished building: ../src/stk500boot.c
Building target: kelvin_bootloader_atmega2560.elf
Invoking: AVR C++ Linker
avr-g++ -Wl,-Map,kelvin_bootloader_atmega2560.map,--cref -Wl,-Map=kelvin_bootloader_atmega2560.map,--cref -lm -Wl,--section-start=.text=3E000 -mmcu=atmega2560 -o "kelvin_bootloader_atmega2560.elf" ./src/stk500boot.o
Finished building target: kelvin_bootloader_atmega2560.elf
Invoking: AVR Create Extended Listing
avr-objdump -h -S kelvin_bootloader_atmega2560.elf >"kelvin_bootloader_atmega2560.lss"
Finished building: kelvin_bootloader_atmega2560.lss
Create Flash image (ihex format)
avr-objcopy -R .eeprom -R .fuse -R .lock -R .signature -O ihex kelvin_bootloader_atmega2560.elf "kelvin_bootloader_atmega2560.hex"
Finished building: kelvin_bootloader_atmega2560.hex
I attached the original bootloader file and the mine generated.
Thank you for your help guys !
Anthony
kelvin_bootloader_atmega2560.hex (25.2 KB)
stk500boot_v2_mega2560.hex (20.5 KB)