Moxa C Programmable RTU Controllers Tool Chains for Application Development
Linux Tool Chain
The Linux tool chain contains a suite of cross compilers and other tools, as well as the libraries and header files
that are necessary to compile your applications. These tool chain components must be installed on a
Linux-based host computer (PC). The following Linux distributions can be used to install the tool chain.
• Fedora Core 6 (on x86)
• Mandrake 8.1 (on x86)
• Red Hat 7.3, 8.0, 9.0 (on x86)
• SuSE 7.3 (on x86)
• YellowDog 2.1 (on PowerPC)
• Solaris 7 and 8 (on Sparc)
• Debian 3.1, 4.0 (on x86)
• Ubuntu 9.04. (see note)
need to prepare their system by entering the following commands:
apt-get install libncurse5-dev
mkdir /mnt/ramdisk
isregard the ”[ ==: unexpected operator“ warning when installing the tool chain.
Installing the Linux Tool Chain
The tool chain requires approximately 1 GB of hard disk space. To install the tool chain, follow the steps.
1. Insert the Documentation and Software CD into your PC, and then enter the following commands:
#mount /dev/cdrom /mnt/cdrom
#sh /mnt/cdrom/Software/toolchain/arm-linux_3.3.2_V1.X_BuildXXXXXXXX.sh
2. Wait for the installation process to complete. This should take a few minutes.
3. Add the directory /usr/local/arm-linux/bin to your path. You can do this in the current login by issuing
the following commands:
#export PATH=“/usr/local/arm-linux/bin:$PATH”
Alternatively, the same commands can be added to $HOME/.bash_profile to make it effective for all login
sessions.
Compiling Applications
To compile a simple C application, use the cross compiler instead of the regular compiler:
#arm-linux-gcc –o example –Wall –g –O2 example.c
#arm-linux-strip –s example
#arm-linux-gcc -ggdb –o example-debug example.c
Most of the cross compiler tools are the same as their native compiler counterparts, only with an additional
prefix that specifies the target system. The prefix is “i386-linux-” for x86 environments and “arm-linux-” for
MOXA RTU controllers. For example, “gcc” is the native C compiler, whereas “arm-linux-gcc” is the cross C
compiler for the ARM-based ioLogik W5348-C/ioPAC 8020-C series.
Comments to this Manuals