Moxa W341-LX [21/80] Test program developing hello c

Moxa W321-LX [21/80] Test program developing hello c
W321/341 Linux Getting Started
2-13
Test ProgramDeveloping Hello.c
In this section, we use the standard “Hello” programming example to illustrate how to develop a program for
the W321/341. In general, program development involves the following seven steps.
Step 1:
Connect the W321/341 to a Linux PC.
Step 2:
Install 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 W321/341 using 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 W321/341 units if needed).
Installing the Tool Chain (Linux)
The Linux Operating System must be pre-installed in the PC before installing the W321/341 GNU Tool Chain.
Fedora core or compatible versions are recommended. The Tool Chain requires approximately 100 MB of hard
disk space on your PC. The W321/341 Tool Chain software is located on the W321/341 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/arm-linux_3.1_Build_11111411.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-4.4.2/bin:$PATH
Setting the path allows you to run the compiler from any directory.
Checking the Flash Memory Space
If the flash memory 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

Содержание

Похожие устройства

Скачать