Bernhard Kuemel schrieb: > Hi! > > My avr-gcc (debian/squeeze, gcc version 4.3.5 (GCC)), as it seems, > doesn't support rjmp across FLASHEND for ATmega168 (16K Flash): > > #include <avr/io.h> > > .global main > main: > rjmp tinyloader > > > .org FLASHEND+1-0x3e > tinyloader: > rjmp tinyloader > > bernhard@b:~/src/attiny45/test5$ make > avr-gcc -mmcu=atmega168 -c -o btinyloader.o btinyloader.S > avr-gcc -g -Wall -O0 -mmcu=atmega168 -nostartfiles > -Wl,-Map,btinyloader.map -o btinyloader.elf btinyloader.o > btinyloader.o: In function `main': > (.text+0x0): relocation truncated to fit: R_AVR_13_PCREL against `no symbol' > make: *** [btinyloader.elf] Error 1 > > Can you implement this, please? Is there a workaround to get the correct > rjmp?
You are writing in assembler and thus it's up to you to use correct commands. Neither compiler, assembler or linker will fix bad instructions/operands for you. RJMP can address . +/- 4KiB, i.e. it can target all of flash of an ATmega8. But as you know, ATmega168 has 16KiB of flash and you will have to use JMP to target locations outside the range of RJMP. You may also want to use always JMP and have a look at linker relaxation. Johann > Thanks, Bernhard _______________________________________________ AVR-libc-dev mailing list AVR-libc-dev@nongnu.org https://lists.nongnu.org/mailman/listinfo/avr-libc-dev