Dear FPC-All!
I've tried to compile hello-world-through-UART example (in attacment) for
Atmega128 and got the following:
/usr/local/lib/fpc/3.1.1/ppcrossavr a.pas -WpATMEGA128 -alĀ Free Pascal Compiler
version 3.1.1 [2015/05/05] for avrCopyright (c) 1993-2015 by Florian Klaempfl
and othersTarget OS: EmbeddedCompiling a.pasAssembling aLinking
a/usr/local/lib/fpc/3.1.1/units/avr-embedded/rtl/atmega128.o: In function
`_START':atmega128.pp:(.init.n_atmega128_ss__fpc_start+0x2): relocation
truncated to fit: R_AVR_13_PCREL against symbol `Int00Handler' defined in
.text.n_atmega128_ss_default_irq_handler section in
/usr/local/lib/fpc/3.1.1/units/avr-embedded/rtl/atmega128.oatmega128.pp:(.init.n_atmega128_ss__fpc_start+0x4):
relocation truncated to fit: R_AVR_13_PCREL against symbol `Int01Handler'
defined in .text.n_atmega128_ss_default_irq_handler section in
/usr/local/lib/fpc/3.1.1/units/avr-embedded/rtl/atmega128.oatmega128.pp:(.init.n_atmega128_ss__fpc_start+0x6):
relocation truncated to fit: R_AVR_13_PCREL against symbol `Int02Handler'
defined in .text.n_atmega128_ss_default_irq_handler section in
/usr/local/lib/fpc/3.1.1/units/avr-embedded/rtl/atmega128.oatmega128.pp:(.init.n_atmega128_ss__fpc_start+0x8):
relocation truncated to fit: R_AVR_13_PCREL against symbol `Int03Handler'
defined in .text.n_atmega128_ss_default_irq_handler section in
/usr/local/lib/fpc/3.1.1/units/avr-embedded/rtl/atmega128.oatmega128.pp:(.init.n_atmega128_ss__fpc_start+0xa):
relocation truncated to fit: R_AVR_13_PCREL against symbol `Int04Handler'
defined in .text.n_atmega128_ss_default_irq_handler section in
/usr/local/lib/fpc/3.1.1/units/avr-embedded/rtl/atmega128.oatmega128.pp:(.init.n_atmega128_ss__fpc_start+0xc):
relocation truncated to fit: R_AVR_13_PCREL against symbol `Int05Handler'
defined in .text.n_atmega128_ss_default_irq_handler section in
/usr/local/lib/fpc/3.1.1/units/avr-embedded/rtl/atmega128.oatmega128.pp:(.init.n_atmega128_ss__fpc_start+0xe):
relocation truncated to fit: R_AVR_13_PCREL against symbol `Int06Handler'
defined in .text.n_atmega128_ss_default_irq_handler section in
/usr/local/lib/fpc/3.1.1/units/avr-embedded/rtl/atmega128.oatmega128.pp:(.init.n_atmega128_ss__fpc_start+0x10):
relocation truncated to fit: R_AVR_13_PCREL against symbol `Int07Handler'
defined in .text.n_atmega128_ss_default_irq_handler section in
/usr/local/lib/fpc/3.1.1/units/avr-embedded/rtl/atmega128.oatmega128.pp:(.init.n_atmega128_ss__fpc_start+0x12):
relocation truncated to fit: R_AVR_13_PCREL against symbol `Int08Handler'
defined in .text.n_atmega128_ss_default_irq_handler section in
/usr/local/lib/fpc/3.1.1/units/avr-embedded/rtl/atmega128.oatmega128.pp:(.init.n_atmega128_ss__fpc_start+0x14):
relocation truncated to fit: R_AVR_13_PCREL against symbol `Int09Handler'
defined in .text.n_atmega128_ss_default_irq_handler section in
/usr/local/lib/fpc/3.1.1/units/avr-embedded/rtl/atmega128.oatmega128.pp:(.init.n_atmega128_ss__fpc_start+0x16):
additional relocation overflows omitted from the outputa.pas(22,25) Error:
Error while linkinga.pas(22,25) Fatal: There were 1 errors compiling module,
stoppingFatal: Compilation aborted
regards,Anton Kavalenka
program a;
uses consoleio;
function uart_write(ACh: char; AUserData: pointer): boolean;
begin
while ((UCSR0A and UDRE)<>0) do;
UDR0 := byte(ACh);
uart_write:=true;
end;
function uart_read(var ACh: char; AUserData: pointer): boolean;
begin
while ((UCSR0A and RXC)<>0) do;
byte(ACh) := UDR0;
uart_read:=true;
end;
begin
OpenIO(Input, @uart_write, @uart_read, fmInput, nil);
OpenIO(Output, @uart_write, @uart_read, fmOutput, nil);
writeln('Hello World!');
end.
_______________________________________________
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel