Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Brand new to Linux and AT91SAM9261
PostPosted: Thu May 31, 2007 7:37 pm 
Offline

Joined: Fri May 11, 2007 2:30 am
Posts: 2
Hello,

I just started to get time to play with my new AT91SAM9261-EK kit and have loaded both CE and Linux onto it.

My company is very interested in going the Linux route rather than the CE route, but we are new to both the 32-bit ARM world and the Linux world. All of our work has either been with Windows XP or on 8-bit beasts.

I can get a simple app, like a hello world GUI app, running in Windows CE. That's fairly simple, use Visual Studio, target for CE, build, copy to a flash stick, and then run the file from the flash stick on the development kit when running CE.

How can I do the same thing in Linux on the AT91SAM9261-EK?

For the life of me I can't even figure out how to open/run an executable from the flash stick - although I did figure out how to open a text file. When I try to go the Root Shell or Terminal nothing happens in the GUI (besides an hour glass that never goes away) and I get errors about missing fonts or colors out of the serial port.

Can anyone give me a basic, or point me to the basic, instructions on how to compile and get a basic 'hello world' GUI application running? Also, are there spots I can find existing apps that will run in this environment?

Thanks in advance!

Dan


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 04, 2007 8:17 pm 
Offline

Joined: Fri May 11, 2007 2:30 am
Posts: 2
Please, any help would be greatly appreciated. I haven't had much luck with google or on other places on this site. Any quick links would be appreciated if you could spare the time. Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 03, 2007 3:57 pm 
Offline

Joined: Tue Jul 03, 2007 3:24 pm
Posts: 11
Location: VT
Hey Dan,

I wish I could help but I'm in the EXACT same boat you are -- I'm also entirely new to Linux, and have a project to do on the AT91SAM9261-EK kit. BTW -- is your's from Atmel? Different companies put out kits for the same chip, though i don't know what effect that may have... Anyway, I've also loaded the linux demo and am completely stuck, so if you find out how to compile a simple hello world, would you let me know? I promise to do the same for you if I figure it out.... (Hopefully some nice person willing to share some knowledge can help both of us =)

Oh, I do know one thing... how to talk to board: Use windows hyperterminal over rs-232 (serial port) with these settings:
bps: 115200
8-N-1
flow control: none

once demo linux boots you can see the files in the image. To find stuff on usb key:
cd media\usbkey
(oh btw - you won't get a prompt until you stop that demo movie)

only problem is... I don't know how to cross-compile code that I can run from there =(

Kevin


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 04, 2007 12:20 am 
Offline

Joined: Thu Apr 19, 2007 10:15 pm
Posts: 204
Location: USA
Hi there

In addition to running Linux on the eval board, you'll need a development system. The demo Linux on the eval board has a full kernel, but does not have all the documentation, utilities, and development tools that Linux is famous for and you need.

Although there is Cygwin that allows Linux apps to run on a Win platform, I suggest a low-cost PC and install the Ubuntu Linux distro. Dell will sell you a PC with Ubuntu pre-installed; there have been deals for less than $300. Otherwise download a "live CD" image, then burn it to a CD-ROM. Test the PC compatibility by booting with the "live CD" (this will not overwite anything on the harddisk).

If you use a KVM switch to share one monitor, keyboard and mouse, then you only need to acquire a PC box (sans monitor).

Once you have a Linux development platform, you can install the GNU cross-compiler and build apps for the ARM target board.

Regards


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 04, 2007 4:36 pm 
Offline

Joined: Wed Oct 12, 2005 6:17 pm
Posts: 51
Location: Montreal
Or use vmware to install a linux distro in it and build , work from there. But you will need at least 1gig of ram.

this is what we use to develop arm thing.

Jonathan

_________________
micro controller developer
Pcb Designer
www.cimeq.qc.ca


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 04, 2007 9:18 pm 
Offline

Joined: Wed Feb 18, 2004 5:53 pm
Posts: 132
Location: Sweden
arm_noob wrote:
Hey Dan,

I wish I could help but I'm in the EXACT same boat you are -- I'm also entirely new to Linux, and have a project to do on the AT91SAM9261-EK kit. BTW -- is your's from Atmel? Different companies put out kits for the same chip, though i don't know what effect that may have... Anyway, I've also loaded the linux demo and am completely stuck, so if you find out how to compile a simple hello world, would you let me know? I promise to do the same for you if I figure it out.... (Hopefully some nice person willing to share some knowledge can help both of us =)

Oh, I do know one thing... how to talk to board: Use windows hyperterminal over rs-232 (serial port) with these settings:
bps: 115200
8-N-1
flow control: none

once demo linux boots you can see the files in the image. To find stuff on usb key:
cd media\usbkey
(oh btw - you won't get a prompt until you stop that demo movie)

only problem is... I don't know how to cross-compile code that I can run from there =(

Kevin


There is an Forum thread for buildroot.
This will do what you want.
Sinec the buildroot script is now a month old,
there is some risk that some source package
has disappeared from internet.
Read the buildroot threads, and then you
can figure out how to handle this situation.

_________________
Best Regards
Ulf Samuelsson


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 05, 2007 3:49 pm 
Offline

Joined: Tue Jul 03, 2007 3:24 pm
Posts: 11
Location: VT
Quote:
Once you have a Linux development platform, you can install the GNU cross-compiler and build apps for the ARM target board.

Hey blue_z, thanks for the help -- but what I'm not certain of, is where I can get a cross-compiler for the board or how to use it. I have access to a lab with machines that have linux on it, and I'm familiar with only the basic "g++ filename.cpp" command compiling source code. What I really need is basic step-by-step instructions on how to find & use the cross-compiler for the board, as no-one in the lab seems to be able to help me =/. So, any help is greatly appreciated.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 05, 2007 4:03 pm 
Offline

Joined: Tue Jul 03, 2007 3:24 pm
Posts: 11
Location: VT
ulf wrote:
There is an Forum thread for buildroot.
This will do what you want.
Sinec the buildroot script is now a month old,
there is some risk that some source package
has disappeared from internet.
Read the buildroot threads, and then you
can figure out how to handle this situation.


Thanks, but are you talking about: http://www.at91.com/Project/Controleurs/cVisualisation.php?idVisualisation=209?? I ask because there doesn't seem to be documentation, just files... If you could humor me, assume that I'm sooo new to linux that my knowledge is limited to these commands "ls, cd, cp, mv, rm, and g++". Is there any guide or tutorial you could direct me too, i.e. "Cross-compiler for AT91SAM9261-EK for Dummies" -- I've seen that forum entry before, but didn't really help -- I'll try again though.... Thanks for the help...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 05, 2007 9:54 pm 
Offline

Joined: Wed Feb 18, 2004 5:53 pm
Posts: 132
Location: Sweden
#!/bin/bash
# All previous patches was applied to vanilla buildroot from May 31st.
# Most, if not all suggestions from other people have been applied, - thanks!
# Also updated the u-boot-1.2.0-atmel.tar.bz2 so you need to delete this
# from your download directory (default /usr/local/install/downloads)
# --------------
# Updated 2006-06-07: FIx mkimage path problem
# /Ulf

TOPDIR=`pwd`


BUILDROOT=buildroot-atmel
BUILDROOT_VER=2007-06-07

IPADDR=10.175.196.19
SERVERIP=10.175.196.220
GATEWAYIP=10.175.196.1

BUILDROOT_SOURCE=${BUILDROOT}-${BUILDROOT_VER}.cpio.bz2
BUILDROOT_SITE=ftp://at91dist:distrib@81.80.104.162/AT91_Third_Party_Design_Flow/Linux_Host/Source
DL_DIR=${TOPDIR}/Source
UNZIP=bzcat

function prepare_directories()
{
mkdir -p /tftpboot
mkdir -p /usr/local/arm
mkdir -p /usr/local/install/downloads
}

function get_buildroot()
{
if ! [ -d ${BUILDROOT} ] ; then
mkdir -p ${DL_DIR}
wget -P ${DL_DIR} ${BUILDROOT_SITE}/${BUILDROOT_SOURCE}
${UNZIP} ${DL_DIR}/${BUILDROOT_SOURCE} | cpio -idv
fi
}



function set_ipaddresses()
{
cd ${BUILDROOT}
echo "configuring ip addresses"
./netcfg.sh ${IPADDR} ${SERVERIP} ${GATEWAYIP}
cd ${TOPDIR}
}


function make_board()
{
cd ${BUILDROOT}
echo "building board $1"
make B=$1 board
make $2
make saveconfig
cd ${TOPDIR}
}

function make_all_boards()
{
make_board at91rm9200df $1
make_board at91sam9260dfc $1
make_board at91sam9261ek $1
make_board at91sam9263ek $1
}


prepare_directories
get_buildroot
set_ipaddresses
make -C ${BUILDROOT} menuconfig
make_all_boards source
make_all_boards

_________________
Best Regards
Ulf Samuelsson


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 05, 2007 9:57 pm 
Offline

Joined: Wed Feb 18, 2004 5:53 pm
Posts: 132
Location: Sweden
The script above will build everything you need for
AT91RM9200, AT91SAM9260, AT91SAM9261, AT91SAM9263.

Note that it will only run properly if you run as root
(which is not a good idea)
but if you create the three directories as root
and then revert to normal user, it should build fine.
Sometimes tarballs disappear from internet.
See other buildroot related posts in the Linux thread
to understand how to fix.
You can subscribe to the buildroot mailing list at buildroot.uclibc.org

_________________
Best Regards
Ulf Samuelsson


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 05, 2007 11:48 pm 
Offline

Joined: Thu Apr 19, 2007 10:15 pm
Posts: 204
Location: USA
arm_noob wrote:
-- but what I'm not certain of, is where I can get a cross-compiler for the board or how to use it.


Hi there

I'm old school, and I prefer to build the kernel and apps from the shell prompt using 'make', so take my advice with a grain of salt. Pre-built, ready to install cross-compilers for ARM used to be available from http://www.gnuarm.com/, but the Linux x86-32 versions seem to have been removed.

There's http://www.codesourcery.com/gnu_toolchains/arm/download.html
but have not used this toolchain.

You can also go over to the dark side and get a free, 30-day subscription to TimeSys/LinuxLink. They have a toolchain and a bunch of how-to docs. That's the route I took. Ubuntu + TimeSys is not an ideal mix; they distribute their packages in RedHat style.

Regards


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 06, 2007 12:34 am 
Offline

Joined: Wed Feb 18, 2004 5:53 pm
Posts: 132
Location: Sweden
Maybe it was not so obvious but:

"build everything you need"

includes building a gcc-4.1.2-uclibc based toolchain from scratch,
No need to search for anything on gnuarm (which uses newlib)
or anywhere else.
buildroot with wget all the tarballs you need to do:

* crosscompiler
* at91bootstrap
* u-boot + u-boot configuration scripts.
* linux kernel
* linux root fs (ext2,jffs2)

_________________
Best Regards
Ulf Samuelsson


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 06, 2007 5:07 pm 
Offline

Joined: Tue Jul 03, 2007 3:24 pm
Posts: 11
Location: VT
ulf wrote:
Note that it will only run properly if you run as root

Hey ulf, I really appreciate all the help. Unfortunately, since I only have access to computers in a lab, I don't have access to the root account. And the lab manager's policy is "if you need access to the root account, it's because you're doing something you probably shouldn't." =) Anyways -- do you know if there's a way around requiring the root account? Thanks again for the help


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 06, 2007 5:27 pm 
Offline

Joined: Wed Feb 18, 2004 5:53 pm
Posts: 132
Location: Sweden
arm_noob wrote:
ulf wrote:
Note that it will only run properly if you run as root

Hey ulf, I really appreciate all the help. Unfortunately, since I only have access to computers in a lab, I don't have access to the root account. And the lab manager's policy is "if you need access to the root account, it's because you're doing something you probably shouldn't." =) Anyways -- do you know if there's a way around requiring the root account? Thanks again for the help


When I do
make B=<board> board
a file is copied into .config.

Edit this file and remove the references to the directories
The best way of editing this file is to do
$ make menuconfig

The directories are the download directory for tarballs,
the directory where the compiler is built, and
the /tftpboot directory.

An alternative is that You could ask your lab manager to create
these directories instead, and give you write access.
The benefit is that everyone on the computer can
use the cross compiler and there will be a common
location where tarballs are saved, which should reduce the
need for hard disk.
Buildroot can easily use Gigabuyytes of hard disk.

_________________
Best Regards
Ulf Samuelsson


Top
 Profile  
 
 Post subject: New Problem
PostPosted: Mon Jul 09, 2007 9:05 pm 
Offline

Joined: Tue Jul 03, 2007 3:24 pm
Posts: 11
Location: VT
Hey guys,

Thanks for all the help -- I feel I've made progress but hit another road-block. I followed ulf's advice and installed buildroot. Well - it spit out an error or two after hours of building, so it doesn't look like the installation ran properly, but I was able to compile helloWorld, so I'm happy. But... I'm concerned... the output file was 6,858 bytes. Furthermore, when I tried to run it on the linux ARM demo, it complained:
"/bin/sh: ./helloWorld.out: not found"
This is much different from the error I get if I try and run compiled code that wasn't targeted for the arm. And the file DOES exist -- I can see it with ls, and it does have execution privileges... Any ideas?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: