[fpc-devel] Arm Thumb2 - Stellaris status

Geoffrey Barton mrb at periphon.net
Mon Aug 8 13:21:13 CEST 2011


On 8 Aug 2011, at 11:49, John Clymer wrote:

> Kicking it around in the back of my head at work today...
> 
> I tried doing a compile to assembly language for the stellaris - and it choked giving the error from t_embed.pas.  The error comes from the portion of the program trying to generate a linker script.
> 
> Looking at t_embed.pas, it looks like every single flavor of ARM controller will require it's own subsection of the case() statement.  This can easily get long and ugly.  As the only thing that changes between most of the arm variants is the memory layout - why not provide a generic "stellaris" switch - with reads in a text file containing the memory map and stack top (the rest of the link file remains the same for all variants of ARM) ?  

yes, this could be applied to any of the M3 variants.

> 
> This way - switching to a new variant of stellaris only requires tweaking a memory map file - rather than a re-build and patch of t_embed.pas ?  For that matter - entirely foreign Cortex M3 parts could be easily supported without requiring changes to the compiler.
> 
> Just pondering how to make it easier and more flexible ...

absolutely, I did not go any further as I needed one particular controller at the time to prove I could use FPC on a commercial project, so just hacked what Jeppe had done. Really all the reg definitions can be separate too (and not in stellaris.pas). Even the interrupts can be handled separately as you can flip the NVIC into ram in your application, it just happened to be convenient to put uart0 in stellaris.pas as this port is configured  for debugging by default on all the stellaris mcus.

> 
> From: Geoffrey Barton <mrb at periphon.net>
> To: FPC developers' list <fpc-devel at lists.freepascal.org>
> Sent: Mon, August 8, 2011 12:17:03 PM
> Subject: Re: [fpc-devel] Arm Thumb2 - Stellaris status
> 
> 
> On 7 Aug 2011, at 11:14, John Clymer wrote:
> 
>> Ok.  Give me a week or so (very hectic schedule right now...)  And I will see if I can't patch it up some. 
> 
> 
> To save you some time perhaps, the following was for lm3s9b92 and rtl/embedded/arm/stellaris.pas; I only tested with that device:-
> 
> 1	in cpuinfo.pas,  tcontrollertype should include,  ct_lm3s9b92 rather than stellaris
> 2	also  'stellaris' in controllerunitstr should be 'lm3s9b92
> 
> 3	in compiler/systems/t_embed.pas add:-
> 
> ct_lm3s9b92:
>       with linkres do
>         begin
>           Add('ENTRY(_START)');
>           Add('MEMORY');
>           Add('{');
>           Add('    flash : ORIGIN = 0x00000000, LENGTH = 256K');
>           Add('    ram : ORIGIN = 0x20000000, LENGTH = 96K');
>           Add('}');
>           Add('_stack_top = 0x20017FFC;');
>         end;
> 
> I also found I needed to comment out the controller types other than stellaris in rtl/embedded/makefile.fpc.
> 
> Then remake make,and make the compiler.
> 
>> New to this - what is procedure to generate and submit patch set ?
> 
> +1
> 
> but Florian did offer to integrate any updates himself :)
> 
> Geoffrey
>> 
>> Thanks !
>> 
>> 
>> From: Florian Klämpfl <florian at freepascal.org>
>> To: FPC developers' list <fpc-devel at lists.freepascal.org>
>> Sent: Sun, August 7, 2011 12:15:02 AM
>> Subject: Re: [fpc-devel] Arm Thumb2 - Stellaris status
>> 
>> Am 06.08.2011 13:35, schrieb John Clymer:
>> > Ok, maybe I'm missing something...
>> > 
>> > I can compile and get a binary for an STM32F103RE.  However, if I
>> > attempt for the STELLARIS target, I get an error.  I see where the error
>> > is coming from in t_embed.pas.  It looks like the t_embed.pas file is
>> > missing linking information for the Stellaris.  
>> 
>> Yes. arm embedded devices are only supported as far as somebody
>> contributed the compiler and rtl support. Problem is: we don't have any
>> chance to test it, so only users of these devices can contribute the
>> support.
>> 
>> > Can someone confirm this
>> > is the case before I go on a wild chase changing things ?
>> 
>> 
>> 
>> _______________________________________________
>> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
>> http://lists.freepascal.org/mailman/listinfo/fpc-devel
>> _______________________________________________
>> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
>> http://lists.freepascal.org/mailman/listinfo/fpc-devel
> 
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20110808/7ac20903/attachment.html>


More information about the fpc-devel mailing list