EmbDev.net

Forum: ARM programming with GCC/GNU tools ARM DEVELOPMENT ON LINUX


Author: bhargava (Guest)
Posted on:

Rate this post
0 useful
not useful
Hi all,

I'm just starting on the development on the arm7 processor (SAMSUNG 
S3C44BOX). I want to use linux as my devel platform (my laptop has 
ubuntu installed on it). I've few questions:

1) is the arm project manager (APM) available for linux (I googled for 
it but coudnt find any useful info, I think its not available

2) I've installed the arm toolchain (arm-elf-gcc and others version 
2.95.3), my question is can we only use this toolchain to develop 
applications. I heard that in the APM we can use, for example, for GPP 
port D rPCOND, can we use the same variables as in the APM.

Please let me know where I should start. There is no OS installed on the 
arm board. I would like to write some programs in C (on my laptop, 
compile it ) and then download them onto the board.

Thanks.

Author: Cas (Guest)
Posted on:

Rate this post
0 useful
not useful
I am currently developing on Ubuntu for ARM7 (LPC2124) core and i am 
certainly finding it easier than under Windows.

1. Have never used it, but doubt it.

I have been mainly using gedit text editor for source file. I build 
using terminal using a well laid out and commented makefile. I have 
found this setup prevents confusion with no unknown/hidden build options 
or files.

As far as IDEs go I have tried to use Eclipse several time for C or ARM 
development but it is just too clunky, slow and inflexible imho. 
Recently i found a new IDE called Codelite, that i am currently testing, 
it has a few rough edges but has a promising outlook and is really 
flexible and quick.

2. Have you really installed arm-elf-gcc v2.95.3?

I have read many times that gcc versions of at least v4 are recommended.
My toolchain consists of arm-elf-gcc 4.3.4.

I do not know your level of experience but you do not need an OS as such 
to work on the board, look for some demo apps that flash LEDs etc.
There are a lot of RTOSs if that is what you mean and one  i would 
recommend and currently implementing is ChibiOS/RT. A caveat though, get 
the basics of ARM7 sorted before attempting any RTOS.

Author: bhargava (Guest)
Posted on:

Rate this post
0 useful
not useful
Cas, Thanks for your reply.

I have installed the arm 4.3.3 earlier (using the build details here- 
http://www.gnuarm.com/). I was having some trouble to compile the 
uClinux kernel(2.4 I obtained along with the distribution cd (SAMSUNG 
S3C44BOX).
Also I'm required to write device drivers (for a course at school), so I 
had to compile the kernel. It was giving me error "arm/clone.S:34:Error: 
undefined symbol 'EINVAL' in operation". So I had to use the arm v2.95.3 
tool chain which has been tested. Can you please tell me if arm v4.3.3 
can be used to compile uClinux 2.4.

Thanks.

Author: Bhargava Yammanuru (bhargava)
Posted on:

Rate this post
0 useful
not useful
Sorry I forgot to ask this in the previous post... Can you please point 
me to some sample codes where we use the registers in the arm processor 
(like the GPP control reg's ), or suggest some books which help us 
understand the intricacies of the arm processor.

Thanks.

Author: Calum Lind (cas)
Posted on:

Rate this post
0 useful
not useful
I have no experience of Samsung ARM7 cores nor using uClinux so the best 
i can suggest is to search for documents and technical manual for the 
S3C44B0 processor, manufacturer docs should detail the register 
addresses and functions.

a useful link for porting:
http://porting-uclinux.blogspot.com/2009/09/portin...

Author: Clifford Slocombe (clifford)
Posted on:

Rate this post
0 useful
not useful
bhargava wrote:
> It was giving me error "arm/clone.S:34:Error:
> undefined symbol 'EINVAL' in operation". So I had to use the arm v2.95.3
> tool chain which has been tested.

That was probably a large backward step for what is no doubt a very 
simple problem.  You should apply the same debugging approach that you 
would if an error appeared in your own code.  This is not a toolchain 
error.

On the face of it line 34 of the assembler file clone.S references a 
symbol EINVAL without a definition.  The obvious solution is to provide 
the definition!

EINVAL is an errno.h macro for "invalid argument".  By convention the 
GNU toolchain treats a file with externsion .S (capital S) as an 
assembler file that is first passed through the C pro-processor.  This 
means that to resolve this problem, you should simply #include 
<errno.h>.

It may work with 2.95 because of some other header indirectly including 
errno.h, which 4.x does not.

Author: Bhargava Yammanuru (bhargava)
Posted on:

Rate this post
0 useful
not useful
Clifford, Thanks for the suggestion. I did not pay attention to the 
error earlier.

I tried to recompile the uClinux (2.4) again using the 4.3.3 tool chain.
Now, I used the <linux/errno.h> header in the clone.S file, and I passed 
through that stage with no errors I had to edit quite a few file for 
such kind of errors.

I'm now struck at this point where it shows me the following error:
C 
make[1]: Entering directory `/home/bhargava/Desktop/uClinux-dist/linux-2.4.x'
unset GCC_EXEC_PREFIX; gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -o scripts/split-include scripts/split-include.c
scripts/split-include.c: In function main:
scripts/split-include.c:133: warning: ignoring return value of fgets, declared with attribute warn_unused_result
scripts/split-include include/linux/autoconf.h include/config
arm-elf-gcc -D__KERNEL__ -I/home/bhargava/Desktop/uClinux-dist/linux-2.4.x/include -gstabs+ -Wall -Wstrict-prototypes -Wno-trigraphs -O1 -g -fno-strict-aliasing -fno-common -pipe -fno-builtin -D__linux__ -DNO_MM -mapcs-32  -mtune=arm7tdmi -mshort-load-bytes -msoft-float -gstabs+ -O2   -c -o init/main.o init/main.c
cc1: error: unrecognized command line option "-mapcs-32"
cc1: error: unrecognized command line option "-mshort-load-bytes"
make[1]: *** [init/main.o] Error 1
make[1]: Leaving directory `/home/bhargava/Desktop/uClinux-dist/linux-2.4.x'
make: *** [linux] Error 1

I googled for answers but with little luck. I think -mapcs-32 and 
-mshort-load-bytes command line options are obsolete now.This is the 
first major piece of software that I'm building (make). So I've no clue 
how the options have to be configured.

Is there any way to remove these options and proceed through the make 
process.

Thanks.

Author: Clifford Slocombe (clifford)
Posted on:

Rate this post
0 useful
not useful
Bhargava Yammanuru wrote:
> cc1: error: unrecognized command line option "-mapcs-32"
> cc1: error: unrecognized command line option "-mshort-load-bytes"

You should check the manuals for the two different versions you used to 
see what these options did, and if they are supported in the new 
version.  Manuals for all versions of GCC since 2.95 are at 
http://gcc.gnu.org/onlinedocs/

-mapcs-32 forces use of a 32bit program counter. Old obsolete (i.e. no 
longer manufactured) ARM parts has a 26 bit program counter.  GCC 
nolonger supports these obsolete parts, so a 32bit program counter is 
always used. You can safely remove this option.

Similarly -mshort-load-bytes is obsolete.  I believe also that it is 
only relevant to older ARM architectures.

Of course there is never anything to prevent you from simply removing 
options that the compiler rejects and trying it.  It won't explode!

Author: Bhargava Yammanuru (bhargava)
Posted on:

Rate this post
0 useful
not useful
Clifford Slocombe wrote:
> Manuals for all versions of GCC since 2.95 are at
> http://gcc.gnu.org/onlinedocs/

Thanks, Clifford.

> Of course there is never anything to prevent you from simply removing
> options that the compiler rejects and trying it.  It won't explode!

Of course it won't explode, but how do I remove these options. Which 
file (or what are the most probable files) has to be edited to remove 
these command line options.
 
make[1]: Entering directory `/home/bhargava/Desktop/uClinux-dist/linux-2.4.x'

arm-elf-gcc -D__KERNEL__ -I/home/bhargava/Desktop/uClinux-dist/linux-\ 2.4.x/include -gstabs+ -Wall -Wstrict-prototypes -Wno-trigraphs \
-O1 -g -fno-strict-aliasing -fno-common -pipe -fno-builtin -D__linux__ \
-DNO_MM -mapcs-32  -mtune=arm7tdmi -mshort-load-bytes \
-msoft-float -gstabs+ -O2   -c -o init/main.o init/main.c

I tried greping in the uClinux-dist/linux-2.4.x directory, but I did not 
find any references (yet), but because of deadlines at school I had to 
stop greping process.

If you can tell me the files to look for, it will be immense help to me.
Thanks.

Author: Calum Lind (cas)
Posted on:

Rate this post
0 useful
not useful
> If you can tell me the files to look for, it will be immense help to me.
> Thanks.

Normally gcc options are defined within the makefile but uClinux may be 
different.


I was just re-reading your posts and I have to ask, does your school 
project require you use uClinux? It seems, from my perspective, a very 
complicated project to begin embedded development with.
The reason I mention this, is that I am working on a project dealing 
with small RTOS's and they are complex on an ARM processor. I have spent 
a lot of time learning, with non-OS code, about the ARM7 architecture, 
much more than actually implementing any RTOS theory.


Clifford do you have any thoughts on this?

Author: Bhargava Yammanuru (bhargava)
Posted on:

Rate this post
0 useful
not useful
Calum Lind wrote:

> Normally gcc options are defined within the makefile but uClinux may be
> different.

Thanks, Calum (cas). I'll look at the Makefile and post updates here.

> I was just re-reading your posts and I have to ask, does your school
> project require you use uClinux?

yes, we need to write few drivers and other things, a huge list to 
things to do :(


Thanks.

Author: Bhargava Yammanuru (bhargava)
Posted on:

Rate this post
0 useful
not useful
Cas,

Do you use minicom to transfer executables to your arm board. I  was 
able to transfer the kernel image to the board using the Ethernet.

As suggested by you I want to learn working on the ARM board without the 
ROTS whenever I've time. So I started with the ubiquitous hello world.

I'm having trouble to transfer the hello world executable to the arm 
board using minicom. The problem is all the people (who are working on 
the ARM7 board) I know are working on windows (use hyper-terminal, APM). 
So I've to rely on forums like these. So I'm sorry if these questions 
seem naive.

I set minicom and then used loadb
loadb 0x0c008000 
Then the following is displayed
 ## Ready for binary (kermit) download ... 

then I used ctrl+A S and selected kermit and then selected the file to 
be transferred, nothing happens after that. It just shows the above 
message.

What am I doing wrong? Any ideas ???

Author: Calum Lind (cas)
Posted on:

Rate this post
0 useful
not useful
Im afraid this is not the same development route as myself, as it 
suggests uboot is installed, so I am not much help. However minicom 
should work fine as a Hyperterminal replacement so the issue might be 
the kernel you loaded.

The basics I talked about are bare-metal development where I use startup 
code, linker script, source code all compiled into a binary which I 
flash to my target using JTAG or Serial(ISP).

Simplest guide I could find is here:
http://balau82.wordpress.com/2010/02/14/simplest-b...

Author: Calum Lind (cas)
Posted on:

Rate this post
0 useful
not useful
While looking for something else i came across this page that could be 
of some help to you:

http://blog.stranadurakov.com/2009/08/04/how-to-arm-linux/

Author: Bhargava Yammanuru (bhargava)
Posted on:

Rate this post
0 useful
not useful
Thanks for the link Cas, I was able to complete till this part I was 
having question about transferring the binary onto the board and making 
the arm cpu execute the code.

Author: Christian Tenllado (Company: ucm) (ctenllado)
Posted on:

Rate this post
0 useful
not useful
Hi:

I am new to this post. I am interested also in programming a s3c44box 
chip of samsung (contains an arm7tdmi) from a linux host. I have an 
Olimex ARM-USB-TINY connector which I plan to connect to my development 
board, which is a S3CEV40 (supplied by embest).

My question is, can you help me in setting up a gdb/openocd to programm 
and debug code on chip? Can you point me out on a starting point for it?

Thanks in advance.

Christian

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.