LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-02-2008, 12:50 PM   #1
leedude
Member
 
Registered: Jan 2007
Location: Scotland
Distribution: Fedora, Debian
Posts: 81

Rep: Reputation: 15
my EB40 eval board


ive got an ARM7TDMI EB40 eval board, and havent even been able to load a program onto it.

i have downloaded arm-elf-gcc. and am completely stumped about how to use it.

here is my current way of starting it:
Code:
arm-elf-gcc led_blink.c -Isoftware -mcpu=arm7tdmi -mthumb
I get this:
Code:
/tmp/cckwpwwe.o(.text+0x36): In function `delay':
: undefined reference to `at91_pio_read'
/tmp/cckwpwwe.o(.text+0x5a): In function `delay':
: undefined reference to `at91_pio_read'
/tmp/cckwpwwe.o(.text+0x70): In function `delay':
: undefined reference to `at91_pio_read'
/tmp/cckwpwwe.o(.text+0x90): In function `delay':
: undefined reference to `PIO_DESC'
/tmp/cckwpwwe.o(.text+0xa8): In function `main':
: undefined reference to `at91_pio_open'
/tmp/cckwpwwe.o(.text+0xb8): In function `main':
: undefined reference to `at91_pio_open'
/tmp/cckwpwwe.o(.text+0xc4): In function `main':
: undefined reference to `at91_pio_write'
/tmp/cckwpwwe.o(.text+0xd4): In function `main':
: undefined reference to `at91_pio_write'
/tmp/cckwpwwe.o(.text+0xe4): In function `main':
: undefined reference to `at91_pio_write'
/tmp/cckwpwwe.o(.text+0xf4): In function `main':
: undefined reference to `at91_pio_write'
/tmp/cckwpwwe.o(.text+0x104): In function `main':
: undefined reference to `at91_pio_write'
/tmp/cckwpwwe.o(.text+0x114): more undefined references to `at91_pio_write' foll ow
/tmp/cckwpwwe.o(.text+0x128): In function `main':
: undefined reference to `PIO_DESC'
collect2: ld returned 1 exit status
led_blink is a sample file from the CD
software/ is the directory where all the headers from the CD are.


I can connect to angel(on board) with gdb:
Code:
arm-elf-gdb
(gdb) tar rdi s=/dev/ttyS0
But what do these options like rdi and s and -mthumb actually mean? what other options are there?

can someone help plz.

Last edited by leedude; 07-02-2008 at 12:55 PM.
 
Old 07-02-2008, 03:17 PM   #2
bbneo
Member
 
Registered: Jun 2008
Location: Northeast Ohio
Distribution: fedora 10, Debian, Ubuntu
Posts: 34

Rep: Reputation: 16
undefined references and symbols...

I'm not familiar with system you are using, or the specifics of the GCC compiler, but those error messages seem to be telling you that you either have:

1) some undefined environment variables which might point to include files ? PIO_DESC or otherwise...

also

2) double check your use of the gcc command line and options... it's been a while since I used cc or gcc... if I remember correctly, you are intending to default compile and link.

bbneo
 
Old 07-02-2008, 04:37 PM   #3
leedude
Member
 
Registered: Jan 2007
Location: Scotland
Distribution: Fedora, Debian
Posts: 81

Original Poster
Rep: Reputation: 15
The switches i used just define the target processor/instruction set and the include path. i dont know what other switches i could use. when i run arm-elf-gcc --help. it just gives the standard gcc help. there are no arm-elf specifics.
 
Old 07-03-2008, 05:18 AM   #4
bbneo
Member
 
Registered: Jun 2008
Location: Northeast Ohio
Distribution: fedora 10, Debian, Ubuntu
Posts: 34

Rep: Reputation: 16
Can you include the code for led_blink.c?

If it's not too big. You want to look for the symbol PIO_DESC and figure out if it is defined in one of your include files or should be in your environment variables.

I can't find a gcc.man page.

You probably also want to try posting in:

http://www.nabble.com/gcc---Help-f1158.html
 
Old 07-11-2008, 09:58 AM   #5
leedude
Member
 
Registered: Jan 2007
Location: Scotland
Distribution: Fedora, Debian
Posts: 81

Original Poster
Rep: Reputation: 15
ok, i posted, but no replies...yet(its been a week or something).
ive had a look through the files supplied. cant find anything.
is it possible that it is part of a C library, and i am supposed to include that in my command line args for arm-elf-gcc? if arm-elf-gcc is using the standard c library, i can understand why this is happening.
What file extension would a C library be likely to have? .c .o .h?
also, is there a generic naming convention for c libraries like elflib.o or arm.c or something?
it's just that i have no idea where to look, and there are loads of files in the software/ dir.

i would be quite content using assembly rather than c(at first), but i cant find any ASM tutorials for AT91 ARM7TDMI stuff on the www.

i just wanna make it do something!

how about
target rdi=/dev/ttyS0
i can see it tells gdb that the board is at ttyS0, but what does rdi mean? and what other switches are there that i could use? what do they do? where can i find out???

Last edited by leedude; 07-11-2008 at 10:27 AM.
 
Old 07-11-2008, 02:28 PM   #6
leedude
Member
 
Registered: Jan 2007
Location: Scotland
Distribution: Fedora, Debian
Posts: 81

Original Poster
Rep: Reputation: 15
haha, ive found the library. its called lib_r80407.o!
but......
i cant link it.

heres my compile script:
Code:
#!/bin/bash
#script to compile AT91 programs
echo $1
arm-elf-gcc $1.c -Isoftware -mcpu=arm7tdmi -mthumb -L/root/AT91/software/parts/r40807/optm_none/ -llib_r40807.o -o $1.bin
i keep getting this error:
Code:
/root/gnuarm-3.4.3/bin/../lib/gcc/arm-elf/3.4.3/../../../../arm-elf/bin/ld: cannot find -llib_r40807.o
collect2: ld returned 1 exit status
ive looked around and have noticed that the common solution to this is to cut off the '.o' extension and the lib part at the beginning. ive tried these things, but they dont do anything.

Lee.
 
Old 07-12-2008, 05:22 AM   #7
bbneo
Member
 
Registered: Jun 2008
Location: Northeast Ohio
Distribution: fedora 10, Debian, Ubuntu
Posts: 34

Rep: Reputation: 16
Some progress, eh, Lee?

Give me a little background on this system. Do you have access to the man page for the cc compiler for it?

It might simplify things if you study the man page for the cc compiler and then setup your compilation in 2 steps:

1) compile your source code (led-blink.c) to an object file
cc -c led-blink.c (will produce led-blink.o I think)

2) link led-blink.o with your object libraries
cc <executable name~ led-blink > led-blink.o library.o

You can usually set various option switches to debug and give you more information about compilation and linking errors. compilation errors are likely to be due to undefined symbols or syntax errors. link errors will result if your program object is trying to use functions which aren't defined (because you haven't found the right object libraries to link with it).

There are various tools for snooping around and finding functions in libraries, so if you find a directory with a bunch of .o files, I would start there. /usr/lib might be a good place to start.

Good luck. Sorry I can't be more help. I still can't find a gcc.man page, and I am busy trying to get a Linux distribution installed on a nice Dell notebook that I have which is crippled by Windows Vista at present.

Brad
 
Old 07-12-2008, 05:39 AM   #8
bbneo
Member
 
Registered: Jun 2008
Location: Northeast Ohio
Distribution: fedora 10, Debian, Ubuntu
Posts: 34

Rep: Reputation: 16
gcc.pdf...

Lee,

Here is a link to a gcc man page online:

http://bama.ua.edu/cgi-bin/man-cgi?gcc

I also found a gcc reference manual pdf (2.5 Mb). If you can email me from this forum, I will email it to you.

Brad
 
Old 07-14-2008, 12:43 PM   #9
leedude
Member
 
Registered: Jan 2007
Location: Scotland
Distribution: Fedora, Debian
Posts: 81

Original Poster
Rep: Reputation: 15
thanks, i was misusing the L command.
i have another more well defined problem:

according to:
Code:
file lib_pio.o
the libraries are AOF object files.
gcc gives an error saying it is an unrecognized format. arm-elf-gcc only supports ELF objects, i presume.
is there a way i can convert them?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
AT91 Eval Board leedude Programming 0 06-14-2008 01:04 PM
OpenSuse Eval xbaez SUSE / openSUSE 10 12-11-2005 01:16 PM
Eval versions? Jongi SUSE / openSUSE 1 09-05-2005 10:01 AM
SUSE 9.2 Eval?? rm6990 Linux - Distributions 3 10-07-2004 06:50 PM
On board cards of X-series mother board bullwinkle Linux - Hardware 3 07-10-2004 10:16 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration