Moxa DA-662A-I-16-LX [16/63] Developing your first application

Moxa DA-662A-I-8-LX [16/63] Developing your first application
DA-662A Series Software Getting Started
2-8
You should receive the following response:
[root@localhost hello]# make PREFIX=arm-none-linux-gnueabi-
arm-none-linux-gnueabi-gcc o hello-release hello.c
arm-none-linux-gnueabi-strip s hello-release
arm-none-linux-gnueabi-gcc ggdb -o hello-debug hello.c
[root@localhost hello]# _
Next, execute make to generate hello-release and hello-debug, which are described below:
hello-releasean execution file (created specifically to run on the DA-662A series)
hello-debugan GDB debug server execution file (see Chapter 5 for details about the GDB debug tool).
NOTE
Be sure to type the #make command from within the /tmp/example/hello directory, since DA-662A‘s tool
chain puts a specially designed Makefile in that directory. This special Makefile uses the
arm-none-linux-gnueabi-gcc compiler to compile the hello.c source code for the Moxa Macro environment. If
you type the #make command from within any other directory, Linux will use the x86 compiler (for example,
cc or gcc).
Refer to Chapter 5 to see a Make file example.
Uploading and Running the “Hello” Program
Use the following command to upload hello-release to the DA-662A series via FTP.
1. From the PC, type:
#ftp 192.168.3.127
2. Use the bin command to set the transfer mode to Binary mode, and then use the put command to initiate
the file transfer:
ftp> bin
ftp> put hello-release
3. From the DA-662A series, type:
# chmod +x hello-release
# ./hello-release
The word Hello will be printed on the screen.
root@Moxa:~# ./hello-release
Hello
Developing Your First Application
We use the tcps2 example to illustrate how to build an application. The procedure outlined in the following
subsections will show you how to build a TCP server program with serial port communication that runs on the
DA-662A series.

Содержание

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

Скачать