User`s manual

UC-8410/8416/8418-LX User’s Manual Getting Started
2-8
Test ProgramDeveloping Hello.c
Step 1: Connect the UC-8410/8416/8418 to a Linux PC.
Step 2: Install the Tool Chain (GNU Cross Compiler &
glibc).
Step 3: Set the cross compiler and glibc environment
variables.
Step 4: Code and compile the program.
Step 5: Download the program to the UC-8410/8416/8418
via FTP or NFS.
Step 6: Debug the program
Æ If bugs are found, return to Step 4.
Æ If no bugs are found, continue with Step 7
Step 7: Back up the user directory (distribute the program to
additional UC-8410/8416/8418 units if needed).
Cross Compiler
Installing the Tool Chain (Linux)
The PC must have the Linux operating system pre-installed before installing the
UC-8410/8416/8418 GNU Tool Chain. Redhat 7.3/8.0, Fedora core, and compatible versions are
recommended. The Tool Chain requires about 100 MB of hard disk space on your PC. The
UC-8410/8416/8418 Tool Chain software is located on the UC-8410/8416/8418 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/arm-linux_2.1.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/arm-linux/bin:$PATH
Setting the path allows you to run the compiler from any directory.
ATTENTION
If you have an older version of Linux Tool Chain on your Moxa embedded computer (such as
the W300 Series, IA240/241, and UC-7112-LX Plus) and would like to install the new Linux
Tool Chain for the UC-8410/8416/8418, the old Linux Tool Chain files will be immediately
overwritten, and the programs compiled by this new Tool Chain may not work on your old
models. We strongly suggest you rename the directory of the old Linux Tool Chain before
installing the new one if you would like to use the old Linux Tool Chain for other embedded
computers.