Success - simple toolchain under Cygwin

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

stienman
Location: Ann Arbor, MI
Posts: 29
Joined: Wed Oct 05, 2005 9:33 pm

Success - simple toolchain under Cygwin

Sun Jan 07, 2007 5:38 am

I'm mainly creating this for my own future reference, as well as for anyone else as unfamiliar with Linux and cross-compiling as I am.

I have finally installed Cygwin and compiled an arm toolchain that will create a simple working Hello World that runs on the 9261-EK board. Since it's just the base ARM target, it should also work for any ARM processor running Linux.

Install Cygwin using the normal base install along with the following packages:
binutils, bison, bzip2, expat, flex, gcc-core, gcc-g++, gcc-mingw-core, gcc-mingw-g++, gdb, gettext, libxml2, mingw-runtime, mktemp, Core utilities, df, grep, awk, find, python, bash, sh, tar, ln, chmod.

Some may already be included in the default install.

At this point it's helpful to compile and test a simple hello on the workstation to make sure gcc and cygwin are working well.

Go to http://www.kegel.com/crosstool/ and read that page as well as http://www.kegel.com/crosstool/crosstoo ... howto.html

Download the latest crosstool package from http://www.kegel.com/crosstool/#download and extract it into your user directory under cygwin

Start a Cygwin terminal. You should be in your home directory. Follow the instructions on the crosstool website you just read, should be similar to:

cd crosstool-0.43
./demo-arm.sh

In my case this took several hours (Windows XP, Pentium M 1.6GHz, 1.25GB RAM, 2Mbits/S down DSL). It also stopped a few times and had to be restarted when I found that I hadn't installed things like WGET.

I created a simple hello world program, and compiled it using the following command (as I don't yet have the cross compiler in my path):

/opt/crosstool/gcc-4.1.0-glibc-2.3.2/arm-unknown-linux-gnu/bin/arm-unknown-linux-gnu-gcc hello.c -o arm-hello

The latest Linux demo (2 Jan 2007) from Atmel uses a USB drive for much of the file system image, so I simply copied the arm-hello file to the USB drive, moved it to the evaluation kit, reset it, and then used the serial terminal to execute the program. You may have other methods of moving the executable to the target board.

I haven't attempted a kernel compile - that'll be later once I understand a bit more. Right now I'm happy with the various linux demos Atmel provides.

Of course, one could also simply download one of the ready-to-go packages from http://www.gnuarm.com or www.ronetix.at/download/software/ronetix-toolset.exe

The ronetix toolset installs cygwin, a cross compiler, eclipse, Java, and few other items.

I haven't tried either of these (I'm always doing it the hard way, it seems).

-Adam
sci3d
Contact:
Posts: 18
Joined: Tue Dec 12, 2006 2:35 pm

Thu Jan 11, 2007 9:56 am

Thanks for sharing. It is very useful. :D
Microcontroller Programming:
http://mcu-programming.blogspot.com
uC - News, Resources and Tutorials
pototschnig
Contact:
Location: Germany
Posts: 32
Joined: Sun May 15, 2005 6:14 pm

Sun Apr 22, 2007 4:31 pm

Thx for your posting!

I tried buildroot but it didn't go through (stopped about 5 times and the 5th time I couldn't fix the problem :( ). But crosstool worked nice (stopped only twice :) ).

regards
Thomas

Return to “LINUX”

Who is online

Users browsing this forum: No registered users and 1 guest