How to Install RTAI on Axis ETRAX 100LX
There already exists a document describing in detail how to install the Developer Board LX Software. It can be found at
http://developer.axis.com/doc/software/devboard_lx/install-howto.html.
You can also take a look at the Getting Started Guide if your bord is not up and running yet.
This document describes how to set up RTAI on ETRAX 100LX and the documents can therefore differ in som details, particularly the kernel version used. If you run into problems that relate to setting up the card or booting it, then you can consult the above document. But otherwise this one should be ok.
Note
To be able to see the boot log of the board, you can connect a null modem cable to the bords second serial port. And use the sermon program in the tools directory described below. You can also use this connection to log on to the board if you for example have trouble setting up the network.
Install the compiler
You need to install the cris compiler tools. They can be found at http://developer.axis.com/download/compiler/ and you only you need to download and install one of these packages. Which one depends on if your distribution of Linux is RPM based or DEB based. There is also a source package available for other systems. Use for example one of these files.
- cris-dist-1.25-1.i386.rpm
- cris-dist_1.25-1_i386.deb
- cris-dist-1.25.tar.gz
Install the software and compile a normal Linux kernel
Download the following files:
Do not try to run ./install, the script assumes that you have a 2.4.14 kernel which you do not have.
Perform the following steps, they will set up the directory structure in the correct way.
cd ~
tar xvzf devboard_lx-R2_1_0.tgz
cd axis/devboard_lx/os
tar xvzf linux-2.4.19.tar.gz
mv linux-2.4.19 linux
cd ~
tar xvzf linux.2.4.19-diff.tgz
cp linux-2_4_19.diff axis/devboard_lx
cp kernelconfig axis/devboard_lx/kernelconfig
cd axis/devboard_lx
cat linux-2_4_19.diff | patch -d os/linux -Np1
rm kernelconfig.latest
cp kernelconfig os/linux/.config
You have now set up everything you need to be able to compile your own Linux kernel and flash the board with it. If you want you can now configure your linux kernel in the normal way or use the default configuration. To compile the tools and kernel perform the following steps:
. ./init_env
make tools
make kernel
make cris-axis-linux-gnu
make install
make images
If everything is ok, you should now be able to flash the board with the new kernel. Remember to put your board in flash mode by pressing the reboot button while holding down the boot button. Look at this image if you are in doubt. A describtion of the network boot process can be found at http://developer.axis.com/doc/software/tools/network_boot.html.
./flashit
If everything goes well, you should be able to login to the board as user root with password pass. It can take a little while to flash the card, look at the serial line output to see what happens.
In the future when recompiling the kernel, you do not have to perform all of the above steps. It is sufficient if you do like this.
cd os/linux
make menuconfig
cd ..
cd ..
. ./init_env
make kernel
make images
./flashit
RTAI
The following instructions and more details can be found in README.CRIS in the root directory of RTAI.
- Download rtai from http://www.efd.lth.se/~d98mad/rtai-24.1.9-cris.tar.gz and unpack it.
tar xvzf rtai-24.1.9-cris.tar.gz
- Apply the kernel patch.
$RTAIDIR is the directory where you have extracted your RTAI sources.
$KERNELDIR is the directory where you have extracted your kernel sources.
cd $KERNELDIR
patch -p1 < $RTAIDIR/rtai-24.1.9/patches/patch-2.4.19-cris-rthal
- Configure the kernel. Remember to enable RTHAL, the Real-Time Hardware Abstraction Layer.
make menuconfig
- Configure RTAI.
cd $RTAIDIR
make menuconfig
Enter the location of your patched kernel source and press enter.
A working configuration could for example look like this:
# [ ] Prompt for experimental code
# --- Schedulers
# <M> UP scheduler
# --- Features
# [ ] Enable floating point support
# --- Subsystems
# <M> POSIX API
# <*> RT memory manager
# <M> FIFOs
# --- Communication
# [ ] Real-Time serial driver (rt_com)
# --- Tests and Examples
# [*] Compile tests
# [*] Compile examples
- Build the RTAI modules
make dep && make
- Make sure that rtai.o will be linked into the Linux kernel.
cd $KERNELDIR
mkdir rtai
cd rtai
cp $RTAIDIR/rtaidir/rtai.o
If you get an error when running make kernel saying that no such file exists, even though you have copied it, then you have run make clean either explicitly or implicitly. One workaround is to copy the file again, wait for the scripts to remove it and then copy it before the linking starts.
- Compile the kernel, make the images and flash the card with the RTAI enabled kernel.
cd ~/axis/devboard_lx/
make kernel
make images
. ./init_env
./flashit
- RTAI will not be enabled if no module using it is loaded. Look at the examples to see how to enable RTAI.
Kernel config options to be able to work with RTAI
- "Enable loadable module support" must be set to Yes
- "Real-Time Hardware Abstraction Layer" must be set to Yes.
- "Disable cascaded-mode timers in RTAI" should be set to No
- "Enable ETRAX fast timer API" should be set to No.
- "Etrax-100-LX-v2" should be enabled if you have a v2 card (which you probably have).
insmod, rmmod and lsmod
To be able to use insmod, rmmod and lsmod you have to enable them in the busybox package. This is done by editing the file axis/devboard_lx/apps/busybox/Config.h and uncomment the lines:
//#define BB_FEATURE_NEW_MODULE_INTERFACE
//#define BB_INSMOD
//#define BB_RMMOD
//#define BB_LSMOD
As always, you need to run make install in the root directory or prefarably in the busybox directory for the canges to take effect.
Related manuals from Axis
Getting Started Guide to AXIS Developer Board:
http://developer.axis.com/doc/hardware/devboard_lx/getting_started.html
How to Install the Developer Board LX Software:
http://developer.axis.com/doc/software/devboard_lx/install-howto.html
Description of how the mechanism for booting and flashing the board over ethernet works:
http://developer.axis.com/doc/software/tools/network_boot.html
Axis developer documentation (ETRAX 100LX):
http://developer.axis.com/doc/index.html
This document was written by Martin Andersson.
Last changed at February 17 2003.
If you feel that something on this page is not conforming with reality contact me at Martin