Closed vanbwodonk closed 6 years ago
Strange, but you used avr-gcc 4.9.3. I compiled under linux/ubuntu with 4.9.2 version. Can you compile your repo with 4.9.3 without my makefile patch?
make atmega128 AVR_FREQ=16000000L BAUD_RATE=1000000 UART=0 LED=B5 LED_START_FLASHES=2 -BIGBOOT
avr-gcc (GCC) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
BAUD RATE CHECK: Desired: 1000000, Real: 1000000, UBRRL = 1, Error=0.0%
avr-gcc -g -Wall -Os -fno-split-wide-types -mrelax -mmcu=atmega128 -DF_CPU=16000000L -DBAUD_RATE=1000000 -DLED_START_FLASHES=2 -DLED=B5 -DBIGBOOT -DUART=0 -c -o optiboot_flash.o optiboot_flash.c
avr-gcc -g -Wall -Os -fno-split-wide-types -mrelax -mmcu=atmega128 -DF_CPU=16000000L -DBAUD_RATE=1000000 -DLED_START_FLASHES=2 -DLED=B5 -DBIGBOOT -DUART=0 -Wl,--section-start=.text=0x1fc00 -Wl,--section-start=.version=0x1fffe -Wl,--relax -nostartfiles -nostdlib -o atmega128/optiboot_flash_atmega128_1000000_16000000L.elf optiboot_flash.o -lc -latmega128
avr-size atmega128/optiboot_flash_atmega128_1000000_16000000L.elf
text data bss dec hex filename
648 0 0 648 288 atmega128/optiboot_flash_atmega128_1000000_16000000L.elf
avr-objcopy -j .text -j .data -j .version --set-section-flags .version=alloc,load -O ihex atmega128/optiboot_flash_atmega128_1000000_16000000L.elf atmega128/optiboot_flash_atmega128_1000000_16000000L.hex
avr-objdump -h -S atmega128/optiboot_flash_atmega128_1000000_16000000L.elf > atmega128/optiboot_flash_atmega128_1000000_16000000L.lst
rm atmega128/optiboot_flash_atmega128_1000000_16000000L.elf optiboot_flash.o
Can you compile your repo with 4.9.3 without my makefile patch?
Yes, it compiles just fine without the patch
$ make atmega128 AVR_FREQ=16000000L BAUD_RATE=1000000 UART=0 LED=B5 LED_START_FLASHES=2 -BIGBOOT
avr-gcc (GCC) 4.9.3
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
BAUD RATE CHECK: Desired: 1000000, Real: 1000000, UBRRL = 1, Error=0.0%
avr-gcc -g -Wall -Os -fno-split-wide-types -mrelax -mmcu=atmega128 -DF_CPU=16000000L -DBAUD_RATE=1000000 -DLED_START_FLASHES=2 -DLED=B5 -DBIGBOOT -DUART=0 -c -o optiboot_flash.o optiboot_flash.c
avr-gcc -g -Wall -Os -fno-split-wide-types -mrelax -mmcu=atmega128 -DF_CPU=16000000L -DBAUD_RATE=1000000 -DLED_START_FLASHES=2 -DLED=B5 -DBIGBOOT -DUART=0 -Wl,--section-start=.text=0x1fc00 -Wl,--section-start=.version=0x1fffe -Wl,--relax -nostartfiles -nostdlib -o atmega128/optiboot_flash_atmega128_1000000_16000000L.elf optiboot_flash.o -lc
avr-size atmega128/optiboot_flash_atmega128_1000000_16000000L.elf
text data bss dec hex filename
648 0 0 648 288 atmega128/optiboot_flash_atmega128_1000000_16000000L.elf
avr-objcopy -j .text -j .data -j .version --set-section-flags .version=alloc,load -O ihex atmega128/optiboot_flash_atmega128_1000000_16000000L.elf atmega128/optiboot_flash_atmega128_1000000_16000000L.hex
avr-objdump -h -S atmega128/optiboot_flash_atmega128_1000000_16000000L.elf > atmega128/optiboot_flash_atmega128_1000000_16000000L.lst
rm atmega128/optiboot_flash_atmega128_1000000_16000000L.elf optiboot_flash.o
I've compiled optiboot_flash with the BIGBOOT flag enabled with avr-gcc 4.9.2 without any errors before
What version of avr-libc do you use?
I'm using avr-libc 2.0.0
I updated my toolchain, and suddenly this patch were needed. I manually corrected it along with a bunch of other fixes, so it's not necessary to merge this.
Anyways thanks for bringing a proper solution! 👍
I'm not sure about this. Got this error when testing this on ATmega128.