User`s manual
UC-7400-LX Plus User’s Manual Getting Started
2-14
Installing the Tool Chain (Linux)
The PC must have the Linux Operating System pre-installed before installing the UC-7400-LX
Plus GNU Tool Chain. Fedora core, and compatible versions are recommended. The Tool Chain
requires about 100 MB of hard disk space on your PC. The UC-7400-LX-Plus Tool Chain software
is located on the UC-7400-LX Plus CD. To install the Tool Chain, insert the CD into your PC and
then issue the following commands:
#mount /dev/cdrom /mnt/cdrom
#/mnt/cdrom/tool-chain/Linux/xscale_be-x.x.sh
The Tool Chain will be installed automatically on your Linux PC within a few minutes. Before
compiling the program, be sure to set the following path first, since the Tool Chain files, including
the compiler, link, library, and include files are located in this directory.
PATH=/usr/local/xscale_be/bin:$PATH
Setting the path allows you to run the compiler from any directory.
NOTE
Refer to Appendix B for an introduction to the Windows Tool Chain. In this chapter, we use the
Linux tool chain to illustrate the cross compiling process.
Checking the Flash Memory Space
The UC-7400-LX Plus uses a specially designed root file system. Only the /tmp, /etc, /home, and
/root directories are writable. Others are read-only. The writable directories are mounted on
/dev/mtdblock3. If the /dev/mtdblock3 is full, you will not be able to save data to the Flash ROM.
Use the following command to calculate the amount of “Available” flash memory:
/>df –h
root@Moxa:/# df –h
Filesystem Size Used Available Use% Mounted on
/dev/mtdblock2 14.0M 10.9M 3.1M 78% /
/dev/ram15 1.7M 18.0k 1.6M 1% /dev
/dev/ram0 499.0k 29.0k 445.0k 6% /var
/dev/mtdblock3 15.8M 2.4M 13.3M 16% /tmp
/dev/mtdblock3 15.8M 2.4M 13.3M 16% /home
/dev/mtdblock3 15.8M 2.4M 13.3M 16% /etc
tmpfs 61.9M 0 61.9M 0% /dev/shm
root@Moxa:/#
If there isn’t enough “Available” space for your application, you will need to delete some existing
files. To do this, use the console cable to connect your PC to the UC-7400-LX Plus, and then use
the console utility to delete the files from the UC-7400-LX Plus flash memory.
Compiling Hello.c
The CD included with the product contains several example programs. Here we use Hello.c as an
example to show you how to compile and run your applications. Type the following commands
from your PC to copy the files used for this example from the CD to your computer’s hard drive:
# cd /tmp/
# mkdir example
# cp –r /mnt/cdrom/example/* /tmp/example
To compile the program, go to the Hello subdirectory and issue the following commands:
#cd example/hello #make