Installing the T-Engine Kit under Linux (Red Hat and Ubuntu Linux)
Written by: Chan Siew Kiat (CHiPES, NTU)
Edited by: Mohit Sindhwani (TE@Onghu)
The T-Engine Development Kit software can be used either under Linux or under Cygwin running on Windows. In this article, we present the steps that are needed to get the kit running under Linux. We tried with Red Hat 9.0 and also under Ubuntu Linux. The steps are fairly generic, and will work for any Linux distribution.
The information presented in this article is derived from a similar article on TRONWeb. This article mentions some of those items, and also adds a few steps that we carried out in addition to the steps presented in that article. In a separate article, we will detail the steps for running the kit under Cygwin running on Windows.
Equipment and Tools Used
We set up the system on the following environment:
- Red Hat Linux 9.0 and Ubuntu Linux 5.04 (Intel x86 versions)
- T-Engine Development Kit Release 1.11E
- SH7727 T-Engine (with 32MB Compact Flash)
Procedure – Setting up the Environment
First, we install the tools and the development kit.
1. Creating a working directory
You need to create a working directory. This must be done in a location where you have the access to create files and directories so that you do not need administrator access. You could choose any location. The default user directory will be /home/USERNAME (USERNAME is your log-in ID) and we will create a subdirectory here.
%mkdir /home/USERNAME/te
2. Copy the files
There are three Linux related installer files -
- te.resource.sh.14.tar.gz
- te.Linux-i686.common.02.tar.gz
- te.Linux-i686.sh.02.tar.gz
These files may be on a CD, flash disk media or may be on the hard drive where you downloaded them from PMC’s Support website. The mount and umount commands below are required for attaching the CDROM. Some versions of Linux will do this automatically.
%mount –r /dev/cdrom /mnt/cdrom
%cp /mnt/cdrom/soft/te.resource.sh.14.tar.gz /home/USERNAME/te
%cp /mnt/cdrom/soft/te.Linux-i686.common.02.tar.gz /home/USERNAME/te
%cp /mnt/cdrom/soft/te.Linux-i686.sh.02.tar.gz /home/USERNAME/te
%umount /mnt/cdrom
3. Unzip the files
The copied files need to be unzipped.
%cd /home/USERNAME/te
%tar zxpf te.resource.sh.14.tar.gz
%tar zxpf te.Linux-i686.common.02.tar.gz
%tar zxpf te.Linux-i686.sh.02.tar.gz
You can actually delete the .tar.gz files in the directory at this stage, if you want.
4. Copying the tool files
Some files need to be copied across as shown below.
%cp –r /home/USERNAME/te/tool/Linux-i686/etc /home/USERNAME/te/etc
5. Setting up the symbolic link to Perl
A symbolic link to Perl needs to be created in the /usr/local/bin directory. Note that this step requires administrator access, but needs to be done only once.
%cd /usr/local/bin
%ln –s /usr/bin/perl
Ubuntu users can execute administrator commands by using “sudo” and entering the super-user password when prompted to do so:
%cd /usr/local/bin
%sudo ln –s /usr/bin/perl
6. Setting permissions for the serial port
To allow connection to the serial port by the terminal program, you will need to allow access permissions. Note that this step requires administrator access, but needs to be done only once.
If you have a traditional serial port in your computer, it will be called /dev/ttyS0 (for COM1) and /dev/ttyS1 (for COM2). In this case, execute the following command (Ubuntu users add “sudo” before the commands):
%chmod 666 /dev/ttyS0
If you are using a supported USB-to-serial converter, it will most probably be /dev/ttyUSB0. Depending on the port, you wish to connect to, execute the following:
%chmod 666 /dev/ttyUSB0
7. Setting up the Environment Variables
The makefiles, etc. use a number of environment variables. We need to set them up next. The actual commands differ depending on which command shell (terminal) you use. Ubuntu uses bash as the default, and our Red Hat is set up to use tcsh as the default.
For bash, execute the following commands in the shell, or add them to the file: /home/USERNAME/.bashrc
%export BD=/home/USERNAME/te
%export GNUs=/usr
%export GNU_BD=$BD/tool/Linux-i686
%export GNUsh=$GNU_BD/sh-unknown-tkernel
%export MY_INC_HDR=$GNU_BD/lib/gcc-lib/sh-unknown-tkernel/3.0.4
For tcsh, execute the following commands in the shell, or add them to the file: /home/USERNAME/.cshrc
%setenv BD /home/USERNAME/te
%setenv GNUs /usr
%setenv GNU_BD $BD/tool/Linux-i686
%setenv GNUsh $GNU_BD/sh-unknown-tkernel
%setenv MY_INC_HDR $GNU_BD/lib/gcc-lib/sh-unknown-tkernel/3.0.4
Since these variables are being added to the initialization and configuration file for the shell, you will need to close the shell (terminal) and start it again. There is no need to restart the computer.
8. Updating the makefile
In addition to the above steps, you may need to make one more change to be able to build applications for the T-Engine. We needed to update the makefiles as follows. The file to be edited is /home/USERNAME/te/kappl/etc/makerules Open up the file in a text editor such as emacs:
%emacs /home/USERNAME/te/kappl/etc/makerules
Scroll through the file till you find the following line:
HEADER = $(BD)/include
Edit it and add the underlined part to make it as such:
HEADER = $(BD)/include $(MY_INC_HDR)/include
Save the file and exit emacs. Your development environment is now ready! In another article, we will look at . In the meanwhile, you could look at the article on TRONWeb that explains how to develop applications for the T-Engine.
Notes
- This article has been contributed to TE@Onghu by the Centre for High Performance Embedded Systems, and has been used by permission.