mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 20:49:09 +02:00
+ added some AT91SAM7 controllers
* improved linker script for arm-embedded git-svn-id: trunk@13292 -
This commit is contained in:
parent
dbd2759da9
commit
7a65b5c7a0
@ -49,9 +49,17 @@ Type
|
|||||||
|
|
||||||
tcontrollertype =
|
tcontrollertype =
|
||||||
(ct_none,
|
(ct_none,
|
||||||
|
|
||||||
|
{ Phillips }
|
||||||
ct_lpc2114,
|
ct_lpc2114,
|
||||||
ct_lpc2124,
|
ct_lpc2124,
|
||||||
ct_lpc2194
|
ct_lpc2194,
|
||||||
|
|
||||||
|
{ ATMEL }
|
||||||
|
ct_at91sam7s256,
|
||||||
|
ct_at91sam7se256,
|
||||||
|
ct_at91sam7x256,
|
||||||
|
ct_at91sam7xc256
|
||||||
);
|
);
|
||||||
|
|
||||||
Const
|
Const
|
||||||
@ -94,14 +102,22 @@ Const
|
|||||||
('',
|
('',
|
||||||
'LPC2114',
|
'LPC2114',
|
||||||
'LPC2124',
|
'LPC2124',
|
||||||
'LPC2194'
|
'LPC2194',
|
||||||
|
'AT91SAM7S256',
|
||||||
|
'AT91SAM7SE256',
|
||||||
|
'AT91SAM7X256',
|
||||||
|
'AT91SAM7XC256'
|
||||||
);
|
);
|
||||||
|
|
||||||
controllerunitstr : array[tcontrollertype] of string[20] =
|
controllerunitstr : array[tcontrollertype] of string[20] =
|
||||||
('',
|
('',
|
||||||
'LPC21x4',
|
'LPC21x4',
|
||||||
'LPC21x4',
|
'LPC21x4',
|
||||||
'LPC21x4'
|
'LPC21x4',
|
||||||
|
'AT91SAM7x256',
|
||||||
|
'AT91SAM7x256',
|
||||||
|
'AT91SAM7x256',
|
||||||
|
'AT91SAM7x256'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
@ -224,31 +224,61 @@ begin
|
|||||||
with linkres do
|
with linkres do
|
||||||
begin
|
begin
|
||||||
Add('ENTRY(_START)');
|
Add('ENTRY(_START)');
|
||||||
|
Add('MEMORY');
|
||||||
|
Add('{');
|
||||||
|
Add(' flash : ORIGIN = 0, LENGTH = 128K');
|
||||||
|
Add(' ram : ORIGIN = 0x40000000, LENGTH = 4K');
|
||||||
|
Add('}');
|
||||||
|
end;
|
||||||
|
ct_at91sam7s256,
|
||||||
|
ct_at91sam7se256,
|
||||||
|
ct_at91sam7x256,
|
||||||
|
ct_at91sam7xc256:
|
||||||
|
with linkres do
|
||||||
|
begin
|
||||||
|
Add('ENTRY(_START)');
|
||||||
|
Add('MEMORY');
|
||||||
|
Add('{');
|
||||||
|
Add(' flash : ORIGIN = 0, LENGTH = 256K');
|
||||||
|
Add(' ram : ORIGIN = 0x200000, LENGTH = 64K');
|
||||||
|
Add('}');
|
||||||
|
Add('_stack_end = 0x20FFFC;');
|
||||||
|
end;
|
||||||
|
|
||||||
|
else
|
||||||
|
internalerror(200902011);
|
||||||
|
end;
|
||||||
|
|
||||||
|
with linkres do
|
||||||
|
begin
|
||||||
Add('SECTIONS');
|
Add('SECTIONS');
|
||||||
Add('{');
|
Add('{');
|
||||||
Add(' . = 0x0; /* start of flash */');
|
|
||||||
Add(' /* code and constants */');
|
|
||||||
Add(' .text :');
|
Add(' .text :');
|
||||||
Add(' {');
|
Add(' {');
|
||||||
Add(' *(.init, .init.*)');
|
Add(' *(.init, .init.*)');
|
||||||
Add(' *(.text, .text.*)');
|
Add(' *(.text, .text.*)');
|
||||||
Add(' *(.strings)');
|
Add(' *(.strings)');
|
||||||
Add(' *(.rodata.*)');
|
Add(' *(.rodata, .rodata.*)');
|
||||||
Add(' *(.comment)');
|
Add(' *(.comment)');
|
||||||
Add(' }');
|
Add(' _etext = .;');
|
||||||
Add(' /* uninitialized data */');
|
Add(' } >flash');
|
||||||
Add(' . = 0x40000000; /* start of ram */');
|
Add(' .data :');
|
||||||
Add(' .bss :');
|
|
||||||
Add(' {');
|
Add(' {');
|
||||||
Add(' *(.bss, .bss.*)');
|
Add(' _data = .;');
|
||||||
Add(' *(COMMON)');
|
|
||||||
Add(' *(.data, .data.*)');
|
Add(' *(.data, .data.*)');
|
||||||
Add(' KEEP (*(.fpc .fpc.n_version .fpc.n_links))');
|
Add(' KEEP (*(.fpc .fpc.n_version .fpc.n_links))');
|
||||||
|
Add(' _edata = .;');
|
||||||
|
Add(' } >ram AT >flash');
|
||||||
|
Add(' .bss :');
|
||||||
|
Add(' {');
|
||||||
|
Add(' _bss_start = .;');
|
||||||
|
Add(' *(.bss, .bss.*)');
|
||||||
|
Add(' *(COMMON)');
|
||||||
|
Add(' } >ram');
|
||||||
|
Add('. = ALIGN(4);');
|
||||||
|
Add('_bss_end = . ;');
|
||||||
Add('}');
|
Add('}');
|
||||||
Add('}');
|
Add('_end = .;');
|
||||||
end;
|
|
||||||
else
|
|
||||||
internalerror(200902011);
|
|
||||||
end;
|
end;
|
||||||
{$endif ARM}
|
{$endif ARM}
|
||||||
|
|
||||||
@ -308,17 +338,16 @@ begin
|
|||||||
success:=DoExec(FindUtil(utilsprefix+BinStr),cmdstr,true,false);
|
success:=DoExec(FindUtil(utilsprefix+BinStr),cmdstr,true,false);
|
||||||
|
|
||||||
{ Remove ReponseFile }
|
{ Remove ReponseFile }
|
||||||
if (success) and not(cs_link_nolink in current_settings.globalswitches) then
|
if success and not(cs_link_nolink in current_settings.globalswitches) then
|
||||||
DeleteFile(outputexedir+Info.ResName);
|
DeleteFile(outputexedir+Info.ResName);
|
||||||
|
|
||||||
{ Post process
|
{ Post process }
|
||||||
if success then
|
if success then
|
||||||
begin
|
begin
|
||||||
success:=DoExec(FindUtil(utilsprefix+'objcopy'),'-O binary '+
|
success:=DoExec(FindUtil(utilsprefix+'objcopy'),'-O hex '+
|
||||||
ChangeFileExt(current_module.exefilename^,'.elf')+' '+
|
ChangeFileExt(current_module.exefilename^,'.elf')+' '+
|
||||||
current_module.exefilename^,true,false);
|
ChangeFileExt(current_module.exefilename^,'.hex'),true,false);
|
||||||
end;
|
end;
|
||||||
}
|
|
||||||
|
|
||||||
MakeExecutable:=success; { otherwise a recursive call to link method }
|
MakeExecutable:=success; { otherwise a recursive call to link method }
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user