Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2013-01

Embeded ARM Examples.

11 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Unknown author

Hi All,

I’ve been a user of Lazarus for years now and will soon want to write some code to run on Embedded ARM ( specifically an ARM Cortex M3 ) using an LPC1343.

I’m new to this so i would appreciate someone pointing me in the right direction , some examples and or some wiki regarding this matter would help alot.

Kind Regards

Justin Smyth

Gerhard Scholz
to Unknown author

Question: what's the reason for this error?

Linking .\read.exe
Error: Failed reading coff file, illegal reloctype $0000 while reading .\U_UNIDAT

The program compiles wonderfully with VirtualPascal; I wanted to recompile it with FPC.

Gerhard

Tomas Hajny
to Gerhard Scholz
Gerhard Scholz wrote 8 lines
Question: what's the reason for this error? Linking .\read.exe Error: Failed reading coff file, illegal reloctype $0000 while reading .\U_UNIDAT The program compiles wonderfully with VirtualPascal; I wanted to recompile it with FPC.

I will be just guessing because you haven't supplied any information about the program which you try to link, but I would suspect that you might have tried to link an externally created object file (u_unidat.o? - possibly just renamed from u_unidat.obj as previously used with VirtualPascal?) and it has object file format not supported by our linker. If this assumption is correct, you might need to re- create the object file in the right format supported by FPC and/or the GNU linker.

Tomas

Gerhard Scholz
to Tomas Hajny

The files are completed compiled with FPC, no renaming of VPascal object files.

The only explanation I have that it must have to do with the size of the file; the .o has 8 MB and just defines some CONST and VAR structures, no code.

Interesting (maybe):
the .O which ppc386 made has 8.380.376 bytes,
the .OBJ made by vp has 7.002.097 bytes.

Earlier message 33 lines
----- Original Message ----- From: "Tomas Hajny" To: "FPC-Pascal users discussions" Sent: Tuesday, January 22, 2013 10:13 PM Subject: Re: [fpc-pascal] Linker Error: what does this mean? > On 22 Jan 13, at 21:31, Gerhard Scholz wrote: > >> Question: what's the reason for this error? >> >> Linking .\read.exe >> Error: Failed reading coff file, illegal reloctype $0000 while reading >> .\U_UNIDAT >> >> The program compiles wonderfully with VirtualPascal; I wanted to >> recompile >> it with FPC. > > I will be just guessing because you haven't supplied any information > about the program which you try to link, but I would suspect that you > might have tried to link an externally created object file > (u_unidat.o? - possibly just renamed from u_unidat.obj as previously > used with VirtualPascal?) and it has object file format not supported > by our linker. If this assumption is correct, you might need to re- > create the object file in the right format supported by FPC and/or > the GNU linker. > > Tomas > > _______________________________________________ > fpc-pascal maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Tomas Hajny
to Gerhard Scholz
Gerhard Scholz wrote 6 lines
The files are completed compiled with FPC, no renaming of VPascal object files. The only explanation I have that it must have to do with the size of the file; the .o has 8 MB and just defines some CONST and VAR structures, no code.

Assuming (again ;-) - you haven't provided such information) that you refer to the Win32 platform - could you disable internal linking (add -Xe parameter)?

Interesting (maybe): the .O which ppc386 made has 8.380.376 bytes, the .OBJ made by vp has 7.002.097 bytes.

This difference in size could be due to different alignment rules. Again, judging what goes wrong is difficult without being able to reproduce it...

Tomas

Gerhard Scholz
to Tomas Hajny

Hello,

thanks for the hint with the -Xe parameter (the external linker is damned slow!), now it compiles.

The difference in the object file size seems to be the different amount of stored debug information; the declared structures have the same size (SIZEOF(...) is the same.

Thanks for the help.

Greetings

Gerhard

Earlier message 34 lines
----- Original Message ----- From: "Tomas Hajny" To: "FPC-Pascal users discussions" Sent: Wednesday, January 23, 2013 1:00 AM Subject: Re: [fpc-pascal] Linker Error: what does this mean? > On 23 Jan 13, at 0:01, Gerhard Scholz wrote: > >> The files are completed compiled with FPC, no renaming of VPascal object >> files. >> >> The only explanation I have that it must have to do with the size of the >> file; the .o has 8 MB and just defines some CONST and VAR structures, no >> code. > > Assuming (again ;-) - you haven't provided such information) that you > refer to the Win32 platform - could you disable internal linking (add > -Xe parameter)? > > >> Interesting (maybe): >> the .O which ppc386 made has 8.380.376 bytes, >> the .OBJ made by vp has 7.002.097 bytes. > > This difference in size could be due to different alignment rules. > Again, judging what goes wrong is difficult without being able to > reproduce it... > > Tomas > > _______________________________________________ > fpc-pascal maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Tomas Hajny
to Gerhard Scholz

On Wed, January 23, 2013 23:56, Gerhard Scholz wrote:

Hello,

thanks for the hint with the -Xe parameter (the external linker is damned slow!), now it compiles.

.
.

I'm glad that the external linker helped. Indeed, slowness of the external linker is one of reasons for using the internal one by default. If the external and internal linkers behave differently here, it would be the best to file a bug report so that the internal linker may get fixed. However, it is necessary to include a (reference to) source code allowing reproduction of the issue.

Tomas

Koenraad Lelong
to Unknown author: I’ve been a user of Lazarus for years now and will soon want to write some code to run…
Show quoted text 9 lines
Hi All, I’ve been a user of Lazarus for years now and will soon want to write some code to run on Embedded ARM ( specifically an ARM Cortex M3 ) using an LPC1343. I’m new to this so i would appreciate someone pointing me in the right direction , some examples and or some wiki regarding this matter would help alot. Kind Regards Justin Smyth

Hi,

I'm tinkering with a cortex-m3 board (STM32) so I could help somewhat. Unfortunately, I downloaded and made my crosscompiler some months ago. In the mean time there are many changes in the arm-embedded FPC that I would like to use, mainly interrupt-handling. Yesterday I downloaded fpc-trunk but I was unable to make an arm-crosscompiler. Actually, it's the RTL that does not compile. See my posts of yesterday.

What exactly are you looking for ? There are a number of postings (also from me) in this list about arm-embedded, did you read those ? Did you read http://wiki.freepascal.org/TARGET_Embedded ?

Regards,

Koenraad Lelong

Michael Ring
to Koenraad Lelong

Hi Koenraad

I have also started recently on using arm-embedded on an STM32 based board, I have build arm-embedded for mac a few days ago and the windows version two or three weeks ago. So on what OS do you need the arm crosscompiler (it could be mac or linux (more likely) but I think you actually did not mention the OS on that you are trying to build the crosscompiler), perhaps I can help with binaries if you cannot get your build up & running.

Michael

Koenraad Lelong wrote 32 lines
On 22-01-13 13:36, wrote: > Hi All, > I’ve been a user of Lazarus for years now and will soon want to write > some code to run on Embedded ARM ( specifically an ARM Cortex M3 ) using > an LPC1343. > I’m new to this so i would appreciate someone pointing me in the right > direction , some examples and or some wiki regarding this matter would > help alot. > Kind Regards > Justin Smyth Hi, I'm tinkering with a cortex-m3 board (STM32) so I could help somewhat. Unfortunately, I downloaded and made my crosscompiler some months ago. In the mean time there are many changes in the arm-embedded FPC that I would like to use, mainly interrupt-handling. Yesterday I downloaded fpc-trunk but I was unable to make an arm-crosscompiler. Actually, it's the RTL that does not compile. See my posts of yesterday. What exactly are you looking for ? There are a number of postings (also from me) in this list about arm-embedded, did you read those ? Did you read http://wiki.freepascal.org/TARGET_Embedded ? Regards, Koenraad Lelong _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Gerhard Scholz
to Tomas Hajny: . . I'm glad that the external linker helped. Indeed, slowness of the external linker is…

Sorry, I forgot how to file a bug report. Either somebody explains me, please, or uses this information:

I created a smaller test program which produces the same error.

The test files can be found here:
http://mewal.com/test.zip (161 kB) or
http://mewal.com/test.7z (21 kB)

If someone wants to have it, of course I can also mail the files.

Gerhard

Earlier message 25 lines
----- Original Message ----- From: "Tomas Hajny" To: "FPC-Pascal users discussions" Sent: Thursday, January 24, 2013 9:32 AM Subject: Re: [fpc-pascal] Linker Error: what does this mean? > On Wed, January 23, 2013 23:56, Gerhard Scholz wrote: > > Hello, > >> thanks for the hint with the -Xe parameter (the external linker is damned >> slow!), now it compiles. > . > I'm glad that the external linker helped. Indeed, slowness of the external > linker is one of reasons for using the internal one by default. If the > external and internal linkers behave differently here, it would be the > best to file a bug report so that the internal linker may get fixed. > However, it is necessary to include a (reference to) source code allowing > reproduction of the issue. > > Tomas > _______________________________________________ > fpc-pascal maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Tomas Hajny
to Gerhard Scholz
Gerhard Scholz wrote 10 lines
Sorry, I forgot how to file a bug report. Either somebody explains me, please, or uses this information: I created a smaller test program which produces the same error. The test files can be found here: http://mewal.com/test.zip (161 kB) or http://mewal.com/test.7z (21 kB) If someone wants to have it, of course I can also mail the files.

Please, use our bug tracker at http://bugs.freepascal.org for filing it there. The link to the bug tracker is also available from our homepage (either search for "bug tracker" on http://www.freepascal.org, or just have a look to the end of section General in the navigation panel at the left side). You'll have to register in the bug tracker first ('Signup for a new account') if you haven't done so previously, or log in with your existing username and password.

Hope this helps

Tomas

Show quoted text 33 lines
----- Original Message ----- From: "Tomas Hajny" To: "FPC-Pascal users discussions" Sent: Thursday, January 24, 2013 9:32 AM Subject: Re: [fpc-pascal] Linker Error: what does this mean? > On Wed, January 23, 2013 23:56, Gerhard Scholz wrote: > > Hello, > >> thanks for the hint with the -Xe parameter (the external linker is >> damned >> slow!), now it compiles. > . > I'm glad that the external linker helped. Indeed, slowness of the > external > linker is one of reasons for using the internal one by default. If the > external and internal linkers behave differently here, it would be the > best to file a bug report so that the internal linker may get fixed. > However, it is necessary to include a (reference to) source code > allowing > reproduction of the issue. > > Tomas > _______________________________________________ > fpc-pascal maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-pascal _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal