Skip to contentSkip to conversation

MPC5200 toolchain test

DISCUSSION [email protected] 3 participants 5 messages Nov 25, 2004 – Nov 27, 2004

lore
Share & tools
lore
#0 lore raw

Greeting!

I have a MPC5200 based custom board with preloaded u-boot.
My job is to create some sort of development environment, build linux kernel and userland environment and in the end test the hardware before larger series are built.
So far I managed to create GNU toolchain for it with crostool from Dan Kegel. Everything was built without any problems. Of course, I wanted to test this toolchain so I wanted to compile a simple hello_world program load it into the memory of my MPC5200 board and run it. So far I've failed. I admit. I don't know how to compile a program to run without the OS. But I have some clues. I think it needs to be linked properly so all the things OS does for you are inserted into the binary image that is supposed to get executed. I need some detail understanding on this.

Anyhow I want to do this before I compile kernel. Since I'm talking about the kernel let me ask you what kernel you suggest for MPC5200? The latest 2.6.10-rc or the one Sylvain Munaut is maintaining?

Next ... I would like to create a development environment that is totally "closed" from my system and I want all the crosstools in it. This way I could ensure none of my native tools are conflicting with cross development. I keep hearing about jails and sanboxes but I don't know what they mean. Ok maybe I really need to google it out here but I'm beat. I'm googling three days already. :D
Any tips on creating these kind of environments would be greatly appreciated.

I will attach scripts which I used to create toolchain. I hope I did it correctly.

My sources of documentation are google, IRC and these two books:
Building Embedded Linux, Karim Yaghmour
Programming Embeded Systems, Michael Barr

TIA,
Ivica

#!/bin/sh
set -ex
TARBALLS_DIR=$HOME/tmp/downloads
RESULT_TOP=/opt/MPC5200-crosstools
export TARBALLS_DIR RESULT_TOP
GCC_LANGUAGES="c,c++"
export GCC_LANGUAGES

# Really, you should do the mkdir before running this,

# and chown /opt/crosstool to yourself so you don't need to run as root.
mkdir -p $RESULT_TOP

# Build the toolchain. Takes a couple hours and a couple gigabytes.
#eval cat powerpc-604.dat gcc-3.4.0-glibc-2.3.2.dat sh all.sh --builduserland --notest
eval cat powerpc-603e.dat gcc-3.4.1-glibc-2.3.3.dat sh all.sh --notest
#eval cat powerpc-604.dat gcc-3.4.1-glibc-20040827.dat sh all.sh --notest

echo Done.

TARGET=powerpc-603e-linux-gnu
TARGET_CFLAGS="-O -mcpu=603e" GCC_EXTRA_CONFIG="--with-cpu=603e --enable-cxx-flags=-mcpu=603e"

#1 lore raw

Dear Ivica,

Quoted 5 lines · in message <[email protected]> you wrote:

I have a MPC5200 based custom board with preloaded u-boot. My job is to create some sort of development environment, build linux kernel and userland environment and in the end test the hardware before larger series are built.

May I ask why you want to start from scratch? Is it for educational purposes? Otherwise you could just use existing and well-tested
toolchains like our ELDK which isavailable for free (see
http://www.denx.de/ELDK.html); of course you can also use the ELDK's build environment to rebuild everything from scratch if you really want to be sure that you can recompile everything without need to rely on any external resources.

Quoted 6 lines

So far I managed to create GNU toolchain for it with crostool from Dan Kegel. Everything was built without any problems. Of course, I wanted to test this toolchain so I wanted to compile a simple hello_world program load it into the memory of my MPC5200 board and run it. So far I've failed. I admit. I don't know how to compile a program to run without the OS. But I have some clues. I think it

There is some pretty extensive documentation in our DULG about how to use U-Boot and Linux in Embedded systems; have a look at
http://www.denx.de/twiki/bin/view/DULG/Manual

Quoted 3 lines

Anyhow I want to do this before I compile kernel. Since I'm talking about the kernel let me ask you what kernel you suggest for MPC5200? The latest 2.6.10-rc or the one Sylvain Munaut is maintaining?

Alternatively, you could use the stable 2.4.25 kernel from the linuxppc_2_4_devel tree on our CVS server; for details see the DULG.

Quoted 4 lines

Next ... I would like to create a development environment that is totally "closed" from my system and I want all the crosstools in it. This way I could ensure none of my native tools are conflicting with cross development.

The ELDK installs all files and tools in a single directory. This should be an excellent base for crating a sandboxed environment (although I have to admit that I don't understand which benefits this might give you).

Best regards,

Wolfgang Denk

Signature · 4 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected]
There is a biblical analogy I'd like to draw here.   Casts are to C++
Programmers what the apple was to Eve.         - Scott Douglas Meyers
#2 lore raw
Quoted 9 lines · Wolfgang Denk

Dear Ivica,

Quoted 3 lines · in message <[email protected]> you wrote:

I have a MPC5200 based custom board with preloaded u-boot.

Quoted 9 lines

May I ask why you want to start from scratch? Is it for educational purposes? Otherwise you could just use existing and well-tested
toolchains like our ELDK which isavailable for free (see
http://www.denx.de/ELDK.html); of course you can also use the ELDK's build environment to rebuild everything from scratch if you really want to be sure that you can recompile everything without need to rely on any external resources.

Educational reasons were my primary motives besides the independence factor. :-) I used ELDK extensively on my other projects and I was very pleased with the kit. I used this kit on TQM boards on my former job. Board that I use now is totally custom made and I expect to have difficulties with it anyway. My motto was "If I can't build/create the tools I'm going to work with I really shouldn't mess around in the first place".
That said, I will always keep a backup solution ready (read ELDK) and try to thoroughly understand everything I do. I wanted to build my system from the ground up but
I don't have the tools to do it (BDI2000, ...). My board was preloaded with u-boot. Since this board is not yet truly industrial ready I will need to somehow stress it and test it. I will have a certain budget to spend.What tools should I use? BDI2000? Any alternatives, or is this simply superior tool for debugging purposes?

Quoted 9 lines
Quoted 8 lines

So far I managed to create GNU toolchain for it with crostool from Dan Kegel. Everything was built without any problems. Of course, I wanted to test this toolchain so I wanted to compile a simple hello_world program load it into the memory of my MPC5200 board and run it. So far I've failed. I admit. I don't know how to compile a program to run without the OS. But I have some clues. I think it

Quoted 6 lines

There is some pretty extensive documentation in our DULG about how to use U-Boot and Linux in Embedded systems; have a look at
http://www.denx.de/twiki/bin/view/DULG/Manual

Yes I know of it. It doesn't describe though the process of compiling and linking standalone applications to run without OS.

Regards,
Ivica

#3 lore raw

Dear Ivica,

Quoted 3 lines · in message <[email protected]> you wrote:

Educational reasons were my primary motives besides the independence factor. :-)

OK, understood and accepted (that was the starting point for the ELDK, too :-)

Quoted 3 lines

I will have a certain budget to spend.What tools should I use? BDI2000? Any alternatives,
or is this simply superior tool for debugging purposes?

It is. IMHO the BDI2000 is the de-facto standard tool for low-level Linux debugging.

Quoted 1 line
Quoted 1 line

There is some pretty extensive documentation in our DULG about how to

...

Quoted 3 lines

Yes I know of it. It doesn't describe though the process of compiling and linking standalone
applications to run without OS.

Ummm.. there is. See http://www.denx.de/twiki/bin/view/DULG/UBootStandalone

[I hope you don't call "U-Boot" an OS ;-) ]

Best regards,

Wolfgang Denk

Signature · 4 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected]
Commitment, n.:      Commitment can be illustrated by a breakfast
of ham and eggs. The chicken was involved, the pig was committed.
#4 lore raw
Quoted 1 line · Wolfgang Denk

[I hope you don't call "U-Boot" an OS ;-) ]

Just wait until a marketting department gets their hands on it :-).

Jon.