public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Problem building an eCos application
@ 2012-01-10  4:28 az83
  2012-01-10 15:08 ` [ECOS] " John Dallaway
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: az83 @ 2012-01-10  4:28 UTC (permalink / raw)
  To: ecos-discuss


Hi,

I have a problem building an eCos application.  Just a bit of background
info:

-I have eCos 3.0 installed in cygwin.
-I'm working on LPC1768 - since the default folder doesn't contain a
hardware template for LPC17xx, I had to download from anoncvs and use the
Olimex LPC1766 template with very little modification.
-set my repository accordingly (C:\cygwin\opt\ecos\ecos-3.0\repository\ecos)
-installed the arm-eabi toolchain when downloading eCos >> Build Tools Path
set as C:\cygwin\opt\ecos\gnutools\arm-eabi\bin.
-[extra info] also have Codesourcery G++ Lite (for ARM CM3) installed in a
folder outside of cygwin

When I tried to build a redboot package for my target, I was able to build
and download it successfully, as the Hyperterminal output printed out the
correct message (LPC1766 since I was using this template).

When I tried building a new eCos application, I was able to generate the
.ecc file, but in order for me to generate the .elf file, I had to run a
Makefile which contained only one main.c file.  I ran into this error when
running make in cygwin:

$ make
cc -I/opt/ecos/ecos-3.0/redboot/ecc_one/redboot_lpc17xx_install/include 
-nostartfiles
-L/opt/ecos/ecos-3.0/redboot/ecc_one/redboot_lpc17xx_install/lib -Ttarget.ld 
main.c   -o main
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld:
skipping incompatible
/opt/ecos/ecos-3.0/redboot/ecc_one/redboot_lpc17xx_install/lib/vectors.o
when searching for vectors.o
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld:
skipping incompatible
/opt/ecos/ecos-3.0/redboot/ecc_one/redboot_lpc17xx_install/lib/vectors.o
when searching for vectors.o
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: cannot
find vectors.o
collect2: ld returned 1 exit status
<builtin>: recipe for target `main' failed
make: *** [main] Error 1

I read from elsewhere that the linker file is wrong in this case, but I
really have no idea where and how to modify my linker file.  I have checked
that C:\cygwin\usr\lib does not exist at all.  Any form of help is greatly
appreciated.

Thank you!
-- 
View this message in context: http://old.nabble.com/Problem-building-an-eCos-application-tp33108389p33108389.html
Sent from the Sourceware - ecos-discuss mailing list archive at Nabble.com.


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ECOS] Re: Problem building an eCos application
  2012-01-10  4:28 [ECOS] Problem building an eCos application az83
@ 2012-01-10 15:08 ` John Dallaway
  2012-01-10 23:25   ` [ECOS] " az83
  2012-01-10 15:32 ` Smith, Keith
  2012-01-11  2:16 ` az83
  2 siblings, 1 reply; 6+ messages in thread
From: John Dallaway @ 2012-01-10 15:08 UTC (permalink / raw)
  To: az83; +Cc: eCos Discussion

az83 wrote:

[ snip ]

> When I tried building a new eCos application, I was able to generate the
> .ecc file, but in order for me to generate the .elf file, I had to run a
> Makefile which contained only one main.c file.  I ran into this error when
> running make in cygwin:
> 
> $ make
> cc -I/opt/ecos/ecos-3.0/redboot/ecc_one/redboot_lpc17xx_install/include 
> -nostartfiles
> -L/opt/ecos/ecos-3.0/redboot/ecc_one/redboot_lpc17xx_install/lib -Ttarget.ld 
> main.c   -o main
> /usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld:
> skipping incompatible
> /opt/ecos/ecos-3.0/redboot/ecc_one/redboot_lpc17xx_install/lib/vectors.o
> when searching for vectors.o
> /usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld:
> skipping incompatible
> /opt/ecos/ecos-3.0/redboot/ecc_one/redboot_lpc17xx_install/lib/vectors.o
> when searching for vectors.o
> /usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: cannot
> find vectors.o
> collect2: ld returned 1 exit status
> <builtin>: recipe for target `main' failed
> make: *** [main] Error 1

Your makefile is attempting building your code for native execution
using "cc". You will need to build your eCos application for remote
execution on LPC17xx using "arm-eabi-gcc". Take a look at the example
makefile from eCos CVS which could be adapted to build your application
code:

http://ecos.sourceware.org/cgi-bin/cvsweb.cgi/ecos/examples/Makefile?rev=1&content-type=text/x-cvsweb-markup&cvsroot=ecos

I hope this helps...

John Dallaway
eCos maintainer
http://www.dallaway.org.uk/john

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [ECOS] Problem building an eCos application
  2012-01-10  4:28 [ECOS] Problem building an eCos application az83
  2012-01-10 15:08 ` [ECOS] " John Dallaway
@ 2012-01-10 15:32 ` Smith, Keith
  2012-01-10 23:34   ` az83
  2012-01-11  2:16 ` az83
  2 siblings, 1 reply; 6+ messages in thread
From: Smith, Keith @ 2012-01-10 15:32 UTC (permalink / raw)
  To: az83, ecos-discuss

Azhar - An eCos project consists of 3 parts, RedBoot (which you seem to have successfully built), a library to link with applications and your application.

The ecc file you created is used to create the eCos application library. Using either configtool, or ecosconfig one generates this library. This library
is linked to your application. The application library DOES NOT have the RedBoot package included.

Hope this helps.

Keith M Smith
PerkinElmer Inc.


-----Original Message-----
From: az83 [mailto:azhar.ntu@gmail.com] 
Sent: Monday, January 09, 2012 11:28 PM
To: ecos-discuss@ecos.sourceware.org
Subject: [ECOS] Problem building an eCos application


Hi,

I have a problem building an eCos application.  Just a bit of background
info:

-I have eCos 3.0 installed in cygwin.
-I'm working on LPC1768 - since the default folder doesn't contain a
hardware template for LPC17xx, I had to download from anoncvs and use the
Olimex LPC1766 template with very little modification.
-set my repository accordingly (C:\cygwin\opt\ecos\ecos-3.0\repository\ecos)
-installed the arm-eabi toolchain when downloading eCos >> Build Tools Path
set as C:\cygwin\opt\ecos\gnutools\arm-eabi\bin.
-[extra info] also have Codesourcery G++ Lite (for ARM CM3) installed in a
folder outside of cygwin

When I tried to build a redboot package for my target, I was able to build
and download it successfully, as the Hyperterminal output printed out the
correct message (LPC1766 since I was using this template).

When I tried building a new eCos application, I was able to generate the
.ecc file, but in order for me to generate the .elf file, I had to run a
Makefile which contained only one main.c file.  I ran into this error when
running make in cygwin:

$ make
cc -I/opt/ecos/ecos-3.0/redboot/ecc_one/redboot_lpc17xx_install/include 
-nostartfiles
-L/opt/ecos/ecos-3.0/redboot/ecc_one/redboot_lpc17xx_install/lib -Ttarget.ld 
main.c   -o main
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld:
skipping incompatible
/opt/ecos/ecos-3.0/redboot/ecc_one/redboot_lpc17xx_install/lib/vectors.o
when searching for vectors.o
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld:
skipping incompatible
/opt/ecos/ecos-3.0/redboot/ecc_one/redboot_lpc17xx_install/lib/vectors.o
when searching for vectors.o
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: cannot
find vectors.o
collect2: ld returned 1 exit status
<builtin>: recipe for target `main' failed
make: *** [main] Error 1

I read from elsewhere that the linker file is wrong in this case, but I
really have no idea where and how to modify my linker file.  I have checked
that C:\cygwin\usr\lib does not exist at all.  Any form of help is greatly
appreciated.

Thank you!
-- 
View this message in context: http://old.nabble.com/Problem-building-an-eCos-application-tp33108389p33108389.html
Sent from the Sourceware - ecos-discuss mailing list archive at Nabble.com.


--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] Problem building an eCos application
  2012-01-10 15:08 ` [ECOS] " John Dallaway
@ 2012-01-10 23:25   ` az83
  0 siblings, 0 replies; 6+ messages in thread
From: az83 @ 2012-01-10 23:25 UTC (permalink / raw)
  To: ecos-discuss


Hi John,

Thanks for the response, I realised my Makefile was the same as the link
initially, but I made some stupid changes (I actually had the last line, but
instead of main: main.o, I had $(TARGET):$(OBJECTS), which I had commented
out after defining my INSTALL_DIR on the top of my Makefile).

Basically, my first few lines in Makefile looks like this now:
 
INSTALL_DIR=/opt/ecos/ecos-3.0/redboot/ecc_one/redboot_lpc17xx_install

include $(INSTALL_DIR)/include/pkgconf/ecos.mak
..

The rest of it is exactly the same as the link you gave me (I changed
$(TARGET):$(OBJECTS) to main: main.o just to be safe).  However, I got back
the same error which I have been getting before I did the stupid mistake (of
commenting out the $(TARGET):$(OBJECTS) definition).  Now the error is this:

arm-eabi-gcc -c -o main.o      
-I/opt/ecos/ecos-3.0/redboot/ecc_one/redboot_lpc17xx_install/include -Wall
-Wpointer-arith -Wstrict-prototypes -Wundef -Woverloaded-virtual
-Wno-write-strings -mcpu=cortex-m3 -mthumb -g -O2 -ffunction-sections
-fdata-sections -fno-rtti -fno-exceptions main.c
make: arm-eabi-gcc: Command not found
Makefile:28: recipe for target `main.o' failed
make: *** [main.o] Error 127

This is so weird.  When I checked my ecosenv.sh, I have the arm-eabi/bin
folder defined in my PATH:

ECOS_REPOSITORY=/opt/ecos/ecos-3.0/repository/ecos/packages ; export
ECOS_REPOSITORY

PATH=/opt/ecos/ecos-3.0/tools/bin:$PATH ; export PATH

PATH=/opt/ecos/gnutools/arm-eabi/bin:$PATH ; export PATH

And I've also checked my ecos.mak file in the install directory to check
that ECOS_COMMAND_PREFIX is defined as 'arm-eabi-'.  I'm not sure if this is
an incorrect path problem, but I don't quite know where to go from here.

Thank you.


-Azhar-


John Dallaway-2 wrote:
> 
> az83 wrote:
> 
> [ snip ]
> 
> Your makefile is attempting building your code for native execution
> using "cc". You will need to build your eCos application for remote
> execution on LPC17xx using "arm-eabi-gcc". Take a look at the example
> makefile from eCos CVS which could be adapted to build your application
> code:
> 
> http://ecos.sourceware.org/cgi-bin/cvsweb.cgi/ecos/examples/Makefile?rev=1&content-type=text/x-cvsweb-markup&cvsroot=ecos
> 
> I hope this helps...
> 
> John Dallaway
> eCos maintainer
> http://www.dallaway.org.uk/john
> 
> -- 
> Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
> and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Problem-building-an-eCos-application-tp33108389p33115070.html
Sent from the Sourceware - ecos-discuss mailing list archive at Nabble.com.


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [ECOS] Problem building an eCos application
  2012-01-10 15:32 ` Smith, Keith
@ 2012-01-10 23:34   ` az83
  0 siblings, 0 replies; 6+ messages in thread
From: az83 @ 2012-01-10 23:34 UTC (permalink / raw)
  To: ecos-discuss


Hi Keith,

Sorry, I should have renamed my folder something else.  But anyway, I have
two different folders for my successful redboot build and my unsuccessful
eCos build (and I was sure I "Packages" was set as "default" when building
the templates for the eCos one).

I am not sure if this was the explanation you're looking for though.

Thanks for the reply anyway.

-Azhar-


Smith, Keith-2 wrote:
> 
> Azhar - An eCos project consists of 3 parts, RedBoot (which you seem to
> have successfully built), a library to link with applications and your
> application.
> 
> The ecc file you created is used to create the eCos application library.
> Using either configtool, or ecosconfig one generates this library. This
> library
> is linked to your application. The application library DOES NOT have the
> RedBoot package included.
> 
> Hope this helps.
> 
> Keith M Smith
> PerkinElmer Inc.
> 
> 

-- 
View this message in context: http://old.nabble.com/Problem-building-an-eCos-application-tp33108389p33115071.html
Sent from the Sourceware - ecos-discuss mailing list archive at Nabble.com.


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] Problem building an eCos application
  2012-01-10  4:28 [ECOS] Problem building an eCos application az83
  2012-01-10 15:08 ` [ECOS] " John Dallaway
  2012-01-10 15:32 ` Smith, Keith
@ 2012-01-11  2:16 ` az83
  2 siblings, 0 replies; 6+ messages in thread
From: az83 @ 2012-01-11  2:16 UTC (permalink / raw)
  To: ecos-discuss


My bad, I've included the arm-eabi\bin folder to my Windows path, and it is
able to compile now, but unfortunately it can't find the stdint.h file so I
still get an error.  But this is a different problem altogether.  I'll go
and try to include these files.

Thanks for your help guys!
-- 
View this message in context: http://old.nabble.com/Problem-building-an-eCos-application-tp33108389p33115413.html
Sent from the Sourceware - ecos-discuss mailing list archive at Nabble.com.


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-01-11  2:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-10  4:28 [ECOS] Problem building an eCos application az83
2012-01-10 15:08 ` [ECOS] " John Dallaway
2012-01-10 23:25   ` [ECOS] " az83
2012-01-10 15:32 ` Smith, Keith
2012-01-10 23:34   ` az83
2012-01-11  2:16 ` az83

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).