
phyCARD-M
Quick Start Instructions
3.4.1
Executing the Program on the Target using Microcom
•
Click the
Microcom
icon on the desktop.
•
If you are not logged in, enter
root
and press
Enter
.
•
Type
./myHelloWorld
to start the application.
•
You will see the following output:
Welcome to the World of the phyCARD-M! (serial)
Welcome to the World of the phyCARD-M!
•
Close Microcom.
When you start the application over an SSH session, you only see one
output line. When you execute the program with Microcom, you see two
output lines.
The first line is a direct output on the serial interface. You can’t
see this line in an SSH session, because you are connected over
a TCP/IP connection to the target. With Microcom, however,
you have direct access to serial interface, so you can also see the
line that it written to the serial console.
In this passage you have changed an existing application. You also learned
how to access the serial interface. First you called the function
open()
on
the device
/dev/console
. The return value of this function was a file
descriptor. With the file descriptor you called the function
write()
to send
n
bytes to the device
/dev/console
. After that, the file descriptor was closed
with the function
close()
.
This procedure is in principle quite typical for Linux, because Linux treats
everything like a file.
70
© 2010 PHYTEC Messtechnik GmbH L-746e_1