Re: [fpc-pascal] fpc 2.6.0 for arm-embedded

2012-02-08 Thread Koenraad Lelong



I do have a working crosscompiler (I think), only I have to call it via
/usr/lib/fpc/2.6.0/ppcrossarm ..., instead of via fpc ...
The code seems not to work, but that could be my own RTL, which I copied
from SMT32F103RE. I'm working on that.



After some debugging, I think my compiler does not work. I'm pretty 
certain it outputs arm-code in stead of the needed thumb2 code.


I just tried to make a crosscompiler using svn 20278, which fails :

make rtl_all FPC=/home/koenraad/devel/fpc-svn/compiler/ppcrossarm RELEASE=1
make[1]: Map '/home/koenraad/devel/fpc-svn' wordt binnengegaan
make -C rtl all
make[2]: Map '/home/koenraad/devel/fpc-svn/rtl' wordt binnengegaan
make -C embedded all
make[3]: Map '/home/koenraad/devel/fpc-svn/rtl/embedded' wordt binnengegaan
/bin/mkdir -p /home/koenraad/devel/fpc-svn/rtl/units/arm-embedded
/home/koenraad/devel/fpc-svn/compiler/ppcrossarm -Cparmv7m @rtl.cfg -Ur 
-Tembedded -Parm -XParm-none-eabi- -Xr -Ur -Xs -O2 -n -Fi../inc 
-Fi../arm 
-FD/home/koenraad/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/bin 
-FE. -FU/home/koenraad/devel/fpc-svn/rtl/units/arm-embedded -darm 
-dRELEASE -CfSoft -Us -Sg system.pp
text.inc(1897,3) Fatal: Unknown compilerproc fpc_ansistr_assign. Check 
if you use the correct run time library.

Fatal: Compilation aborted
make[3]: *** [system.ppu] Fout 1
make[3]: Map '/home/koenraad/devel/fpc-svn/rtl/embedded' wordt verlaten
make[2]: *** [embedded_all] Fout 2
make[2]: Map '/home/koenraad/devel/fpc-svn/rtl' wordt verlaten
make[1]: *** [rtl_all] Fout 2
make[1]: Map '/home/koenraad/devel/fpc-svn' wordt verlaten
make: *** [base.build-stamp.arm-embedded] Fout 2

Any thoughts ?

Thanks,

Koenraad.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpc 2.6.0 for arm-embedded

2012-02-08 Thread Jonas Maebe


On 08 Feb 2012, at 15:31, Koenraad Lelong wrote:

After some debugging, I think my compiler does not work. I'm pretty  
certain it outputs arm-code in stead of the needed thumb2 code.


The error below indicates the compiler does not get to emitting any  
kind of code at all.



I just tried to make a crosscompiler using svn 20278, which fails :

make rtl_all FPC=/home/koenraad/devel/fpc-svn/compiler/ppcrossarm  
RELEASE=1

make[1]: Map '/home/koenraad/devel/fpc-svn' wordt binnengegaan
make -C rtl all
make[2]: Map '/home/koenraad/devel/fpc-svn/rtl' wordt binnengegaan
make -C embedded all
make[3]: Map '/home/koenraad/devel/fpc-svn/rtl/embedded' wordt  
binnengegaan

/bin/mkdir -p /home/koenraad/devel/fpc-svn/rtl/units/arm-embedded
/home/koenraad/devel/fpc-svn/compiler/ppcrossarm -Cparmv7m @rtl.cfg - 
Ur -Tembedded -Parm -XParm-none-eabi- -Xr -Ur -Xs -O2 -n -Fi../inc - 
Fi../arm -FD/home/koenraad/CodeSourcery/ 
Sourcery_CodeBench_Lite_for_ARM_EABI/bin -FE. -FU/home/koenraad/ 
devel/fpc-svn/rtl/units/arm-embedded -darm -dRELEASE -CfSoft -Us -Sg  
system.pp
text.inc(1897,3) Fatal: Unknown compilerproc fpc_ansistr_assign.  
Check if you use the correct run time library.


This means you are trying to compile an FPC 2.6.x (or 2.4.x) RTL using  
an FPC 2.7.x starting compiler, or an FPC 2.7.x RTL using an FPC 2.7.x  
compiler built from a different 2.7.x revision.


Always first build a native compiler for the version you want to use  
(starting with the previous release relative to that version), and use  
the resulting native compiler to build a cross-compiler from those  
same sources.



Jonas___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] fpc 2.6.0 for arm-embedded

2012-02-08 Thread Koenraad Lelong

On 08-02-12 15:42, Jonas Maebe wrote:


On 08 Feb 2012, at 15:31, Koenraad Lelong wrote:


After some debugging, I think my compiler does not work. I'm pretty
certain it outputs arm-code in stead of the needed thumb2 code.


The error below indicates the compiler does not get to emitting any kind
of code at all.


What I say above is from a crosscompiler made with 2.6.0.
Below is what I get when I try to make a new crosscompiler, using svn 
20278.



I just tried to make a crosscompiler using svn 20278, which fails :


...


This means you are trying to compile an FPC 2.6.x (or 2.4.x) RTL using
an FPC 2.7.x starting compiler, or an FPC 2.7.x RTL using an FPC 2.7.x
compiler built from a different 2.7.x revision.

Always first build a native compiler for the version you want to use
(starting with the previous release relative to that version), and use
the resulting native compiler to build a cross-compiler from those same
sources.



That's what I think I did.
I had fpc 2.6.0 installed.
I downloaded fpc trunk via svn.
In the root of the download I did make clean build install (as root).
I renamed /usr/lib64/fpc/2.6.0 to -2.6.0- so it would not be found.
I renamed /usr/bin/ppcx64 to ppcx64-2.6.0.
I made a link from /usr/lib/fpc/2.7.0/ppcx64 to /usr/bin/ppcx64.
I modified /etc/fpc.cfg to use /usr/lib/fpc/2.7.0...
fpc -i shows 2.7.1
In the root of the download I tried to make the crosscompiler and then I 
got the error.


Is there a way to verify there are no files left ? I tried fpc -vt but 
that seems not the tool.


Thanks,

Koenraad.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpc 2.6.0 for arm-embedded

2012-02-06 Thread Graeme Geldenhuys
On 3 February 2012 14:23, Koenraad Lelong  wrote:

 I just had some time to look into this again.
 I downloaded the latest 2.6.0 sources and mostly followed
 http://wiki.freepascal.org/TARGET_Embedded to make a crosscompiler. In
 /usr/lib/fpc/2.6.0 there is a ppcrossarm with a date of today when I run
 ppcrossarm -i.
 But when I try

 fpc -Parm -Tembedded -Wplpc2124 -Cparmv7m

 I get an error :


For a much easier cross-compiling experience, try using Paul
Breneman's downloads. He has packages the FPC arm cross-compiler is a
very small archive. Simply unzip and run - and it works no problems.
As a bonus, he also includes fpGUI (for GUI development) with his
cross-compiler archives.


  http://www.turbocontrol.com/easyfpgui.htm



-- 
Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://fpgui.sourceforge.net
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpc 2.6.0 for arm-embedded

2012-02-06 Thread Koenraad Lelong

On 06-02-12 10:04, Graeme Geldenhuys wrote:

For a much easier cross-compiling experience, try using Paul
Breneman's downloads. He has packages the FPC arm cross-compiler is a
very small archive. Simply unzip and run - and it works no problems.
As a bonus, he also includes fpGUI (for GUI development) with his
cross-compiler archives.


   http://www.turbocontrol.com/easyfpgui.htm


I downloaded that package, and I tried it on my x86_64 Ubuntu-laptop. 
ppcarm can't be executed, file ppcarm shows this :
ppcarm: ELF 32-bit LSB executable, ARM, version 1, statically linked, 
stripped
AFAIK this means it's a binary to run on an arm-system, so it's not a 
crosscompiler and I do not have an arm-system at hand that can run a 
compiler.


I think there is some misunderstanding. What I'm trying to do is make 
software for an embedded system. There is no OS. The controller I'm 
targetting has 128K of flash-rom and 8K of RAM.


I do have a working crosscompiler (I think), only I have to call it via 
/usr/lib/fpc/2.6.0/ppcrossarm ..., instead of via fpc ...
The code seems not to work, but that could be my own RTL, which I copied 
from SMT32F103RE. I'm working on that.


Regards,

Koenraad Lelong.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpc 2.6.0 for arm-embedded

2012-02-06 Thread Rainer Stratmann
Am Monday 06 February 2012 14:27:20 schrieb Koenraad Lelong:
 I do have a working crosscompiler (I think), only I have to call it via
 /usr/lib/fpc/2.6.0/ppcrossarm ..., instead of via fpc ...
 The code seems not to work, but that could be my own RTL, which I copied
 from SMT32F103RE. I'm working on that.

I am also interested in crosscompiling for embedded ARM.
How did you install the crosscompiler on Linux OS?
Is there an easy way of doing this?
Is it in the debian packages precompiled and ready for use?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpc 2.6.0 for arm-embedded

2012-02-06 Thread Graeme Geldenhuys
On 6 February 2012 15:27, Koenraad Lelong wrote:

 I downloaded that package, and I tried it on my x86_64 Ubuntu-laptop. ppcarm
 can't be executed, file ppcarm shows this :
 ppcarm: ELF 32-bit LSB executable, ARM, version 1, statically linked,
 stripped
 AFAIK this means it's a binary to run on an arm-system, so it's not a
 crosscompiler and I do not have an arm-system at hand that can run a
 compiler.


Strange. Last time I downloaded Paul's Windows archive he released, it
was indeed a cross-compiler for x86 (32-bit) to ARM (and not a native
arm executable). I could then compile my mobile application under
Windows 2000, then copy my compiled application to my ARM / WinCE
based PDA and run in there.


Of the various download links on Paul's website, which one did you download?

-- 
Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://fpgui.sourceforge.net
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpc 2.6.0 for arm-embedded

2012-02-06 Thread Koenraad Lelong

On 06-02-12 14:34, Rainer Stratmann wrote:

I am also interested in crosscompiling for embedded ARM.
How did you install the crosscompiler on Linux OS?
Is there an easy way of doing this?
Is it in the debian packages precompiled and ready for use?


On a Suse 12.1 virtual machine I downloaded the binutils from 
CodeSourcery and installed them. I downloaded and installed fpc 2.6.0 
and it's sources. In the root of the sources I did (as superuser) :
make clean buildbase installbase CROSSINSTALL=1 OS_TARGET=embedded 
CPU_TARGET=arm SUBARCH=armv7m 
CROSSBINDIR=/home/koenraad/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/bin 
BINUTILSPREFIX=arm-none-eabi-  CROSSOPT=-CfSoft PREFIX=/usr
I'm afraid there are no ready make packages for crosscompiling. I would 
be interested too. But fpc has a way to make packages (at least rpm) for 
fpc for linux so I think it should be possible to make them for 
crosscompiling too.


Regards,

Koenraad Lelong.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpc 2.6.0 for arm-embedded

2012-02-06 Thread Koenraad Lelong

On 06-02-12 14:47, Graeme Geldenhuys wrote:


Strange. Last time I downloaded Paul's Windows archive he released, it
was indeed a cross-compiler for x86 (32-bit) to ARM (and not a native
arm executable). I could then compile my mobile application under
Windows 2000, then copy my compiled application to my ARM / WinCE
based PDA and run in there.


Of the various download links on Paul's website, which one did you download?


http://www.turbocontrol.com/EasyfpGUI-fpc-2.2.2.arm-linux-052111.zip
Like I said, I think these systems are for systems with a full Operating 
System (Linux, WinCE ...).


I'm trying to make software for a bare microcontroller.

Koenraad.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpc 2.6.0 for arm-embedded

2012-02-03 Thread Koenraad Lelong

Hi,

I just had some time to look into this again.
I downloaded the latest 2.6.0 sources and mostly followed 
http://wiki.freepascal.org/TARGET_Embedded to make a crosscompiler. In 
/usr/lib/fpc/2.6.0 there is a ppcrossarm with a date of today when I run 
ppcrossarm -i.

But when I try

fpc -Parm -Tembedded -Wplpc2124 -Cparmv7m

I get an error :

Error: ppcarm can't be executed, error message: Failed to execute 
ppcarm, error code: 127


Is this expexted ? If yes, then the wiki should be updated.
If it matters, I'm using OpesSuse 12.1.

Another thing that puzzles me : the wiki says to use SUBARCH=armv7m for 
cortex-m3. ppcrossarm -i says there are cpu instruction sets for

  ARMV3
  ARMV4
  ARMV5
  ARMV6
  ARMV7
  ARMV7M
  CORTEXM3
Should I use SUBARCH=cortexm3 to compile the compiler to use it with 
STM32-processors, which are cortex-m3 ? Or should I just compile the 
applications with -Cpcortexm3 ?


Thanks for any info.

Regards,

Koenraad Lelong.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpc 2.6.0 for arm-embedded

2012-02-03 Thread Mark Morgan Lloyd

Koenraad Lelong wrote:

Hi,

I just had some time to look into this again.
I downloaded the latest 2.6.0 sources and mostly followed 
http://wiki.freepascal.org/TARGET_Embedded to make a crosscompiler. In 
/usr/lib/fpc/2.6.0 there is a ppcrossarm with a date of today when I run 
ppcrossarm -i.

But when I try

fpc -Parm -Tembedded -Wplpc2124 -Cparmv7m

I get an error :

Error: ppcarm can't be executed, error message: Failed to execute 
ppcarm, error code: 127


Is this expexted ? If yes, then the wiki should be updated.
If it matters, I'm using OpesSuse 12.1.


Since nobody else has responded: what does  fpc -h|head  give you? That 
error 127 can be caused by the symlink from (e.g.) /usr/local/bin/ppcarm 
pointing to a file that doesn't exist.


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpc 2.6.0 for arm-embedded

2012-02-03 Thread Jeppe Græsdal Johansen

Den 03-02-2012 13:23, Koenraad Lelong skrev:

Hi,

I just had some time to look into this again.
I downloaded the latest 2.6.0 sources and mostly followed 
http://wiki.freepascal.org/TARGET_Embedded to make a crosscompiler. In 
/usr/lib/fpc/2.6.0 there is a ppcrossarm with a date of today when I 
run ppcrossarm -i.

But when I try
For anything arm-embedded, it would probably be a better idea to use the 
latest SVN version. Simply because arm-embedded is a much less used and 
tested branch, the functionality might be slower to get into releases. 
In SVN trunk the distinction between Cortex-M3 and ARMv7M is removed and 
everything has been changed to ARMv7M. This is why the wiki page only 
mentions ARMv7M.

fpc -Parm -Tembedded -Wplpc2124 -Cparmv7m

I get an error :

Error: ppcarm can't be executed, error message: Failed to execute 
ppcarm, error code: 127


Is this expexted ? If yes, then the wiki should be updated.
No, fpc should be trying to call ppcrossarm(since you are 
crosscompiling, I guess. I suppose you don't work on an ARM host). I 
don't know why it doesn't do that in your case, might be related to the 
way it was originally built for your platform.

If it matters, I'm using OpesSuse 12.1.

Another thing that puzzles me : the wiki says to use SUBARCH=armv7m 
for cortex-m3. ppcrossarm -i says there are cpu instruction sets for

  ARMV3
  ARMV4
  ARMV5
  ARMV6
  ARMV7
  ARMV7M
  CORTEXM3
Should I use SUBARCH=cortexm3 to compile the compiler to use it with 
STM32-processors, which are cortex-m3 ? Or should I just compile the 
applications with -Cpcortexm3 ?


Thanks for any info.

Regards,

Koenraad Lelong.
___
fpc-pascal maillist  - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal