<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div>Crap ! Forgot to SVN ADD ...<br><br>File attached.<br></div><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><br><div style="font-family:arial, helvetica, sans-serif;font-size:10pt"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> David Welch <dwelch@dwelch.com><br><b><span style="font-weight: bold;">To:</span></b> FPC developers' list <fpc-devel@lists.freepascal.org><br><b><span style="font-weight: bold;">Sent:</span></b> Sat, August 27, 2011 7:06:36 AM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [fpc-devel] DIFF patch for changing to table driven processor definitions for ARM<br></font><br>
when building for SUBARCH=cortexm3, fails with:<br><br>make[3]: *** No rule to make target `thumb2_bare.ppu', needed by <br>`fpc_units'. Stop.<br><br><br><br>On 08/26/2011 05:09 PM, David Welch wrote:<br>> Another diff to be considered.<br>><br>><br>> Index: rtl/embedded/arm/arm_bare_ram.pp<br>> ===================================================================<br>> --- rtl/embedded/arm/arm_bare_ram.pp (revision 0)<br>> +++ rtl/embedded/arm/arm_bare_ram.pp (revision 0)<br>> @@ -0,0 +1,63 @@<br>> +{<br>> +Startup code for a simple ram-only ARM<br>> +David Welch 2011 08 26 (dwelch at dwelch com)<br>> +based on lpc21x4 created by Sten Larsson (sten_larsson at yahoo com)<br>> +}<br>> +<br>> +unit arm_bare_ram;<br>> +<br>> +{$goto on}<br>> +<br>> + interface<br>> +<br>> + implementation<br>> +<br>> + procedure
PASCALMAIN; external name 'PASCALMAIN';<br>> +<br>> + procedure _FPC_haltproc; assembler; nostackframe; public name '_haltproc';<br>> + asm<br>> + .Lhalt:<br>> + b .Lhalt<br>> + end;<br>> +<br>> + var<br>> + _stack_top: record end; external name '_stack_top';<br>> + _bss_start: record end; external name '_bss_start';<br>> + _bss_end: record end; external name '_bss_end';<br>> +<br>> + procedure _FPC_start; assembler; nostackframe;<br>> + label<br>> + _start;<br>> + asm<br>> + .init<br>> + .align 16<br>> + .globl _start<br>> + _start:<br>> +
ldr sp,.L_stack_top<br>> + // clear onboard ram<br>> + ldr r1,.L_bss_start<br>> + ldr r2,.L_bss_end<br>> + mov r0,#0<br>> +.Lzeroloop:<br>> + cmp r1,r2<br>> + strls r0,[r1],#4<br>> + bls .Lzeroloop<br>> +<br>> + bl PASCALMAIN<br>> + bl _FPC_haltproc<br>> + .L_hang:<br>> + b .L_hang<br>> +.L_bss_start:<br>> + .long _bss_start<br>> +.L_bss_end:<br>> + .long _bss_end<br>> +<br>> +<br>> +<br>> +.L_stack_top:<br>> + .long _stack_top<br>> + .text<br>> +
end;<br>> +<br>> +end.<br>> +<br>> Index: rtl/embedded/Makefile.fpc<br>> ===================================================================<br>> --- rtl/embedded/Makefile.fpc (revision 18855)<br>> +++ rtl/embedded/Makefile.fpc (working copy)<br>> @@ -53,7 +53,7 @@<br>> endif<br>><br>> ifeq ($(SUBARCH),armv7)<br>> -CPU_UNITS=lpc21x4 at91sam7x256<br>> +CPU_UNITS=lpc21x4 at91sam7x256 arm_bare_ram<br>> endif<br>> endif<br>><br>> Index: rtl/embedded/Makefile<br>> ===================================================================<br>> --- rtl/embedded/Makefile (revision 18855)<br>> +++ rtl/embedded/Makefile (working copy)<br>> @@ -317,8 +317,8 @@<br>> ifeq ($(SUBARCH),cortexm3)<br>> CPU_UNITS=lm3fury lm3tempest thumb2_bare stm32f103<br>> endif<br>> -ifeq
($(SUBARCH),armv7)<br>> -CPU_UNITS=lpc21x4 at91sam7x256<br>> +ifeq ($(SUBARCH),armv4)<br>> +CPU_UNITS=lpc21x4 at91sam7x256 arm_bare_ram<br>> endif<br>> endif<br>> ifeq ($(ARCH),avr)<br>> Index: compiler/arm/cpuinfo.pas<br>> ===================================================================<br>> --- compiler/arm/cpuinfo.pas (revision 18855)<br>> +++ compiler/arm/cpuinfo.pas (working copy)<br>> @@ -61,6 +61,8 @@<br>> tcontrollertype =<br>> (ct_none,<br>><br>> + ct_arm_bare_ram,<br>> +<br>> { Phillips }<br>> ct_lpc2114,<br>> ct_lpc2124,<br>> @@ -212,7 +214,19 @@<br>> sramsize:0<br>> ),<br>><br>>
+<br>> (<br>> + controllertypestr:'ARM_BARE_RAM';<br>> + controllerunitstr:'ARM_BARE_RAM';<br>> + interruptvectors:8;<br>> + flashbase:$00000000;<br>> + flashsize:$00000000;<br>> + srambase:$D6000000;<br>> + sramsize:$0000C000<br>> + ),<br>> +<br>> +<br>> + (<br>> controllertypestr:'LPC2114';<br>> controllerunitstr:'LPC21x4';<br>> interruptvectors:8;<br>> Index: compiler/systems/t_embed.pas<br>> ===================================================================<br>> --- compiler/systems/t_embed.pas
(revision 18855)<br>> +++ compiler/systems/t_embed.pas (working copy)<br>> @@ -220,6 +220,7 @@<br>> ct_none:<br>> begin<br>> end;<br>> + ct_arm_bare_ram,<br>> ct_lpc2114,<br>> ct_lpc2124,<br>> ct_lpc2194,<br>> @@ -312,16 +313,19 @@<br>> Add('MEMORY');<br>> Add('{');<br>><br>> - LinkStr := ' flash : ORIGIN = 0x' + IntToHex(flashbase,8)<br>> - + ', LENGTH = ' + IntToStr(flashsize div 1024)+'K';<br>> -
Add(LinkStr);<br>> + if(flashsize<>0) then<br>> + begin<br>> + LinkStr := ' flash : ORIGIN = 0x' + IntToHex(flashbase,8)<br>> + + ', LENGTH = ' + IntToStr(flashsize div 1024)+'K';<br>> + Add(LinkStr);<br>> + end;<br>><br>> LinkStr := ' ram : ORIGIN = 0x' + IntToHex(srambase,8)<br>> + ', LENGTH = ' + IntToStr(sramsize div 1024)+'K';<br>>
Add(LinkStr);<br>><br>> Add('}');<br>> - Add('_stack_top = 0x' + IntToHex(sramsize+srambase-4,8) + ';');<br>> + Add('_stack_top = 0x' + IntToHex(sramsize+srambase,8) + ';');<br>> end;<br>> end<br>> else<br>> @@ -329,6 +333,8 @@<br>> internalerror(200902011);<br>> end;<br>><br>> +<br>> + with embedded_controllers[current_settings.controllertype] do<br>> with linkres do<br>> begin<br>> Add('SECTIONS');<br>> @@ -341,14 +347,28 @@<br>> Add(' *(.rodata, .rodata.*)');<br>>
Add(' *(.comment)');<br>> Add(' _etext = .;');<br>> - Add(' }>flash');<br>> + if(flashsize<>0) then<br>> + begin<br>> + Add(' }>flash');<br>> + end<br>> + else<br>> + begin<br>> + Add(' }>ram');<br>> + end;<br>> Add(' .data :');<br>> Add(' {');<br>> Add(' _data = .;');<br>> Add(' *(.data, .data.*)');<br>> Add(' KEEP (*(.fpc .fpc.n_version
.fpc.n_links))');<br>> Add(' _edata = .;');<br>> - Add(' }>ram AT>flash');<br>> + if(flashsize<>0) then<br>> + begin<br>> + Add(' }>ram AT>flash');<br>> + end<br>> + else<br>> + begin<br>> + Add(' }>ram');<br>> + end;<br>> Add(' .bss :');<br>> Add(' {');<br>> Add(' _bss_start = .;');<br>> @@ -360,6 +380,7 @@<br>> Add('}');<br>> Add('_end = .;');<br>> end;<br>>
+<br>> {$endif ARM}<br>><br>> {$ifdef i386}<br>><br>> On Fri, Aug 26, 2011 at 10:53 AM, David Welch<<a ymailto="mailto:dwelch@dwelch.com" href="mailto:dwelch@dwelch.com">dwelch@dwelch.com</a>> wrote:<br>>> need to apply this patch, like the wiki thing maybe there is a place I<br>>> have to sign up to be able to check in to svn, otherwise. The lpc and<br>>> sam7 parts are ARM7TDMI which is an armv4t not remotely able to<br>>> support the armv7 instructions. the correction also needs to be made<br>>> to allow armv7m or cortexm3. If we are going to mix the architecture<br>>> (armv7m) and marketings name for the core (cortexm3) we should be<br>>> consistent and start doing things like provide an arm7tdmi for the<br>>> other two families. LIkewise anywhere it says if cortexm3 it should<br>>> say if cortexm3 or armv7m then. if armv4 or
if armv4t or if arm7tdmi<br>>> then... Ideally not use the name cortexm3 and instead only use<br>>> armv7m. Have a wiki page or readme that says if stellaris or stm32 or<br>>> lpc1xxx then armv7m if lpc2xxx or sam7 or generic arm then armv4...<br>>><br>>><br>>> Index: rtl/embedded/Makefile<br>>> ===================================================================<br>>> --- rtl/embedded/Makefile (revision 18854)<br>>> +++ rtl/embedded/Makefile (working copy)<br>>> @@ -317,7 +317,7 @@<br>>> ifeq ($(SUBARCH),cortexm3)<br>>> CPU_UNITS=lm3fury lm3tempest thumb2_bare stm32f103<br>>> endif<br>>> -ifeq ($(SUBARCH),armv7)<br>>> +ifeq ($(SUBARCH),armv4)<br>>> CPU_UNITS=lpc21x4 at91sam7x256<br>>> endif<br>>> endif<br>>><br>>><br>>> On Fri, Aug
26, 2011 at 5:17 AM, John Clymer<<a ymailto="mailto:john@johnclymer.net" href="mailto:john@johnclymer.net">john@johnclymer.net</a>> wrote:<br>>>> Part of what I submitted was 2 batch files in the root directory -<br>>>> buildarm.bat and buildthumb2.bat - that was my attempt to provide an example<br>>>> with the BINUTILS equates spelled out.<br>>>><br>>>> John<br>>>><br>>>><br>>>> ________________________________<br>>>> From: David Welch<<a ymailto="mailto:dwelch@dwelch.com" href="mailto:dwelch@dwelch.com">dwelch@dwelch.com</a>><br>>>> To: FPC developers' list<<a ymailto="mailto:fpc-devel@lists.freepascal.org" href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a>><br>>>> Sent: Fri, August 26, 2011 6:17:43 AM<br>>>> Subject: Re: [fpc-devel] DIFF patch for changing to table driven
processor<br>>>> definitions for ARM<br>>>><br>>>><br>>>> Can someone with the power to update the wiki (maybe we all do I dont know)<br>>>> change the target embedded page to reflect the SUBARCH thing?<br>>>><br>>>> Also either put a link to<br>>>><br><span>>>> <a target="_blank" href="http://wiki.lazarus.freepascal.org/Binutils">http://wiki.lazarus.freepascal.org/Binutils</a></span><br>>>><br>>>> or spell out something like this:<br>>>><br>>>> ./configure --target=arm-linux --prefix=/something/something/<br>>>> --program-prefix=arm-embedded- --disable-werror<br>>>><br>>>> For the non-windows folks so we can play too. Too me a while to figure out<br>>>> why I was not even able to build per the target embedded instructions.<br>>>><br>>>> Thanks,<br>>>>
David<br>>>><br>>>> On 08/25/2011 10:13 PM, David Welch wrote:<br>>>>> cpuinfo.pas(156,2) Fatal: Can't open include file "controllerunit.inc"<br>>>>><br>>>>> On 08/25/2011 05:50 PM, Florian Klämpfl wrote:<br>>>>>> OS_TARGET=embedded CPU_TARGET=arm SUBARCH=cortexm3<br>>>><br>>>> _______________________________________________<br>>>> fpc-devel maillist - <a ymailto="mailto:fpc-devel@lists.freepascal.org" href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a><br><span>>>> <a target="_blank" href="http://lists.freepascal.org/mailman/listinfo/fpc-devel">http://lists.freepascal.org/mailman/listinfo/fpc-devel</a></span><br>>>><br>>>> _______________________________________________<br>>>> fpc-devel maillist - <a ymailto="mailto:fpc-devel@lists.freepascal.org"
href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a><br>>>> <a href="http://lists.freepascal.org/mailman/listinfo/fpc-devel" target="_blank">http://lists.freepascal.org/mailman/listinfo/fpc-devel</a><br>>>><br>>>><br>>><br>> _______________________________________________<br>> fpc-devel maillist - <a ymailto="mailto:fpc-devel@lists.freepascal.org" href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a><br>> <a href="http://lists.freepascal.org/mailman/listinfo/fpc-devel" target="_blank">http://lists.freepascal.org/mailman/listinfo/fpc-devel</a><br>> .<br><br>_______________________________________________<br>fpc-devel maillist - <a ymailto="mailto:fpc-devel@lists.freepascal.org" href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a><br><a href="http://lists.freepascal.org/mailman/listinfo/fpc-devel"
target="_blank">http://lists.freepascal.org/mailman/listinfo/fpc-devel</a><br></div></div>
</div></body></html>