Moxa UC-8410A-T-LX [68/86] Buploading and running the hello program

Moxa UC-8410A-T-LX [68/86] Buploading and running the hello program
UC-8410A Series Linux Software Programmer’s Guide
6-6
After compiling the program, issue the following command to execute the program.
moxa@Moxa:~$ ./hello-release
Hello World
Compiling Hello.c with Cross Compilation
Follow these steps for cross compilation.
1. Connect the UC-8410A-LX series to a Linux PC.
2. Install Tool Chain (GNU Cross Compiler & glibc).
3. Set the cross compiler and glibc environment variables.
4. Code and compile the program.
5. Download the program to the UC-8410A series via SFTP, NFS, SCP, or RSYNC.
6. Debug the program
If bugs are found, return to Step 4.
If no bugs are found, continue with Step 7
7. Back up the user directory (distribute the program to additional UC-8410A series units if needed).
The CD provided with the UC-8410A 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
You should receive the following response:
[root@localhost hello]# make
arm-linux-gnueabihf-gcc -o hello-release hello.c
arm-linux-gnueabihf-strip -s hello-release
hello-releasean ARM platform execution file (created specifically to run on the UC-8410A series)
Uploading and Running the “Hello” Program
The program can be uploaded via SFTP, NFS, SCP, or RSYNC.
Use the following command to upload hello-release to the UC-8410A series via SFTP.
From the PC, type:
#ftp 192.168.3.127
Use the “put” command to initiate the file transfer:
sftp> put hello-release
Uploading hello-release to /home/moxa/hello-release
hello-release
From the UC-8410A-LX, type:
# chmod +x hello-release
# ./hello-release
The word Hello will be printed on the screen.

Содержание

Скачать