1. 主页
  2. 文档
  3. 操作系统手册
  4. Cortex-A8
  5. Linux

Linux

Chipsee Embedded Industrial Computer

Linux User Manual

V3.0.0

This manual provides users with a fast guide of Chipsee Embedded Industrial Computer (Abbreviate as IPC) about Linux OS development. Through this manual, users can quickly understand the hardware resources; users can build a complete compilation of Linux development environment; users can debug Linux OS via serial and Internet.

1. Chipsee Embedded Industrial Computer

Development Kit

Hardware:
(1)Chipsee Embedded Industrial Computer
(2)12V power adapter
(3)Micro SD card and card reader
(4)USB A-A cable (used only when the hardware configured as OTG)
(5)Common serial cable or USB to serial cable

Software:
(1)Chipsee Linux prebuilt file(to make a bootable SD card)
(2)Useful tools for Qt development

2. Getting started and basic tests

Notes: Use the prebuilt file we provided in the CD to test the hardware.

2.1. How to make a bootable SD card

1、Insert the SD card into your computer, if you’re using virtual machines, please make sure the SD card mounted to the Linux operating system.
2、Confirm the SD card mount point, “/dev/sdX”, usually it should be “/dev/sdb”. You can use this command to find out what the “X” is in the Linux system.

$ sudo fdisk –l

3、Copy the file prebuilt-som-v3-csxxxxxtxx-v3-ezsdk-sd-yyyymmdd.tar.gz to somewhere(such as $HOME).
4、Extract the file prebuilt-som-v3-csxxxxxtxx-v3-ezsdk-sd-yyyymmdd.tar.gz

$ tar xzvf prebuilt-som-v3-csxxxxxtxx-v3-ezsdk-sd-yyyymmdd.tar.gz

5、Go to the folder prebuilt-som-v3-csxxxxxtxx-v3-ezsdk-sd-yyyymmdd

$ cd ~/ prebuilt-som-v3-csxxxxxtxx-v3-ezsdk-sd-yyyymmdd

6、Flash the Linux OS to the SD card

$ sudo ./mksdcard.sh --device /dev/sd<?>

sd<?> means the SD card in Ubuntu system.
7、Switch “SW2” to uSD, insert the uSD card, connect board to PC via COM1, set baud 115200, power on the board.

2.2. How to flash Linux to eMMC

1、Copy file “prebuilt-som-v3-csxxxxxtxx-v3-ezsdk-emmc-yyyymmdd.tar.gz” to $HOME
2、Extact file “prebuilt-som-v3-csxxxxxtxx-v3-ezsdk-emmc-yyyymmdd.tar.gz”

$ tar xzvf prebuilt-som-v3-csxxxxxtxx-v3-ezsdk-emmc-yyyymmdd.tar.gz

3、Go to folder “prebuilt-som-v3-csxxxxxtxx-v3-ezsdk-emmc-yyyymmdd”

$ cd ~/ prebuilt-som-v3-csxxxxxtxx-v3-ezsdk-emmc-yyyymmdd

4、Make a Flasher card

$ sudo ./mksdcard.sh --device /dev/sd<?>

sd<?> means the SD card in Ubuntu system.
5、Switch “SW2” to uSD, insert the uSD card, connect board to PC via COM1, set baud 115200, power on the board.
6、When you look follow message, mean you have flash linux to eMMC.
“eMMC Flashing Completed”
7、Move the SD card, Switch “SW2” to eMMC, power on.

2.3. Start Linux OS

Notes: You can see the Chipsee Logo (it can be changed by using software ChipSee_LOGO_MOD_EN.exe we provided in the CD) shown on the LCD screen. It is a successful start when you see the Linux desktop like in Figure 2-1:

Figure 2-1 Linux desktop

2.4. Tests

1、 Touch screen and buzzer test
Click on the screen, the mouse arrow stays in position triggered and the buzzer sounds, indicating that touch and buzzer work properly. After working for some time resistive touch screen may not be accurate, they need to be calibrated. Click on the “Chipsee” icon on the desktop, select “Calibrate Screen” to calibrate it. Like in Figure 2-2:

Figure 2-2 Resistive touch screen calibration app

2、 Audio and video test
Click “Multimedia” icon on desktop, choose “MPEG-4+AAC Dec” to test. You need insert the earphone into expansion board Audio OUT (light blue) before testing. The final result is like the Figure 2-3:

Figure 2-3 Audio and video

3、 3D test
Click “3D” icon on desktop, choose “Film TV” to test. Like Figure 2-4:

Figure 2-4 3D test Film TV

4、 Serial test
(1)Connect COM1 on board to PC. Use software “SecureCRT” or “Putty” or some others on the PC. Click on the “Chipsee” icon on desktop, select “ChipseeTest” to run “SerialTest” App to communicate with PC. Like Figure 5.。

Note: There are four serial ports available on board, two are RS232(COM1 and COM2), the others are RS485(COM3 and COM4). And COM1(RS232) is used to debug the system, if you want to use it on your own. Edit the file “etc/inittab” around line 31. Change the port to another (ttyO1,ttyO2,ttyO4), or add “#” before this line to comments off this line.

S:2345:repawn:/sbin/getty 115200 ttyO0

Serial ports in system.

Serial port Driver
COM1(RS232, Debug) /dev/ttyO0
COM2(RS232) /dev/ttyO1
COM3(RS485) /dev/ttyO2
COM4(RS485) /dev/ttyO4

From 2-1 Seial ports in system

(2)Serial test: at the serial area, set Com COM2, set Baud 115200, click on “Open”

Figure 2-5 ChipseeTest

It will send the string “Succeed in sending message!!!” every two seconds. Click on the “SendMSG” button, it will send the string “Succeed in sending message-manual!!!”. Every two seconds, it will read the received buffer, show the result to the received area.
5、 CAN test
User need two Embedded Industrial Computers, two CAN bus connectors should connect directly to each other for testing. (ps: between CANH and CANL you should use a Resistor which is 120Ω). At the CAN area click “Open”, then “SendMSG”, it will send message “11 22 33 44 55 66 77 88”, in both of the two machines you will see the message shown at the received area.
If you only have one machine, you can use a oscillometer to see the result.
6、 GPIO test
There are four inputs and four outputs. LOW is 0V, HIGH is 5V.
GPIO input terminal connected to the output connection terminal, IN1-4 are corresponding connect to OUT1-4. By setting GPIO_OUT area you will see GPIO_IN region corresponding changing. Like figure 2-5.
By setting the LED “ON” or “OFF” to control the LED light on board.

GPIO GPIO In System
OUT1 gpio49
OUT2 gpio50
OUT3 gpio51
OUT4 gpio52
IN1 gpio53
IN2 gpio54
IN3 gpio55
IN4 gpio56
USER_LED gpio19

From 2-2 GPIO in system

To read and write the GPIO, you can do this: gpio49.
(1) Export gpio, if there is /sys/class/gpio/gpio49/, go to step (2).

# echo 49 > /sys/class/gpio/export

(2) Write

# echo 1 > /sys/class/gpio/gpio49/value

(3) Read

# cat /sys/class/gpio/gpio49/value

7、 Networking
Click on “Network”, then click on “Ifconfig” to view the network information on board, click on “Refresh” to restart the network service, it will take five or six seconds to finish. Like Figure 2-6.

Figure 2-6 Network information

8、 Wifi
1.set ssid and password in config file, like this:

# vi /etc/wpa_supplicant.conf
network={
        ssid="Chipsee"    //set your wifi ssid
        psk="1chipsee234567890"   set your wifi password
}

2.lauch the wifi, like this:

3.After a few minutes, you can use the wifi.
9、 Date&Time
Click the time display area “Edit” icon to set the time and date, like Figure 2-7.

Figure 2-7 Date and Time

Check the system time

# date

Set the system time

# date –s “2014-03-15 10:30:30”

Check RTC

# hwclock

Write RTC

# hwclock –w

10、 Backlight
By modifying the size “Brightness” can change the brightness of the backlight;
Modify the file /sys/class/backlight/pwm-backlight/Brightness to change the backlight.
range from 0 to 100, 0 means shutdown the backlight, 100 is the MAX value.

# echo 50 > /sys/class/backlight/pwm-backlight/Brightness

11、 Buzzer
The buzzer will sound when the screen is touched. If you want to disable it, you can do this:
Capacitive touchscreen: Edit/sys/bus/i2c/devices/1-0038/buzopen
“0” means disable.

# echo 0 > /sys/bus/i2c/devices/1-0038/buzopen

Resistive touchscreen: Edit /sys/devices/platform/omap/ti_tscadc/tsc/buzopen
“1” means enable.

# echo 1 > /sys/devices/platform/omap/ti_tscadc/tsc/buzopen

2.5. Logo modify

We provide a software to change the Logo we the OS start. You can find the tool in the CD along with our product: ChipSee_LOGO_MOD_EN.exe.
1. Open the software: Chipsee_LOGO_MOD_EN.exe in Windows:

Figure 2-8 Chipsee Logo modify

Click the first Browse button, find the picture file.

Figure 2-9 Choose the Logo you want

3. Click the second Browse button, find the u-boot.img file.

Figure 2-10 Choose the u-boot.img file

4. Choose the resolution , click “Execute”.

Figure 2-11 Change the Logo successful

5. Insert the SD card, power the board, and the Logo will be replaced.
Note: If you want to run the system from NAND Flash and change the Logo, you shouldchange the logo first then flash the NAND. If the system is running in the NAND Flash, you can rewrite the u-boot.img file.
Boot from uSD card, hit “space” after power on, the board to get into u-boot

U-Boot #

Do the command:

U-Boot # nand erase.chip

Reboot.

3. Linux application development

This chapter will introduce how to develop applications for the industrial computer in Linux.

3.1. Preparation

Software:
1、 Ubuntu system, we suggest Ubuntu 14.04.5 LTS x64.
2、 Qtcreator install package qt-linux-opensource-5.1.0-x86-offline.run, you can download here: https://download.qt.io/archive/qt/5.1/5.1.0/
3、Install package ti-sdk-am335x-evm-07.00.00.00-Linux-x86-Install.bin provided by TI,download here: http://software-dl.ti.com/sitara_linux/esd/AM335xSDK/07_00_00_00/index_FDS.html

3.2. Steps

1、We assume you have created a program by using Qtcreator, such as Hello.
2、 configure the environment variables. And TI has already done for us, what we need to do is that source the file like this (such as you had installed the ti-sdk in /opt/ti-sdk-am335x-evm directory):

$ source /opt/ti-sdk-am335x-evm/linux-devkit/environment-setup

Go into the folder of your GUI program(Hello). Do these commands:

$ qmake –project
$ qmake 
$ make

Now there will be a file which can run in the industrial computer Linux, use command “file Hello”, you can see the file can be executed in ARM platform.
3、 Put the file Hello in the industrial computer Linux. Then do the command in Linuxsystem(communicate via COM1)

# ./Hello

Then you will see the program is running.
4、 Add application to the desktop of Matrix
a) Put your program file PROGRAMNAME to a folder which can be found by the system(such as: /usr/bin)
b) Put the program’s icon into the folder: /usr/share/matrix-gui-2.0/apps/images/. Such as: /usr/share/matrix-gui-2.0/apps/images/ YOURAPPIMG.png
c) Go to the folder /usr/share/matrix-gui-2.0/apps/, then create a new folder named PROGRAMNAME, go to PROGRAMNAME, create a new file named PROGRAMNAME.desktop, edit the file like this:
#!/usr/bin/env xdg-open[Desktop Entry] Name= YOURAPPNAME // Can be changed
GenericName=Demo App
Icon=/usr/share/matrix-gui-2.0/apps/images/YOURAPPIMG.png
Exec= YOURAPPNAME
Type=Application
ProgramType=gui
d) Refresh the system, your own application will be found on the desktop. Click on SettingsRefresh Matrix, then click on run. Return the desktop you will see your own application’ icon. Sometimes, the icon will not change in time, you need to reboot your system.

3.3. New development kit

1、 Open a Terminal in Ubuntu:

# source /usr/local/ti-sdk-am335x-evm/linux-devkit/environment-setup

2、 Then open QtCreator

# /opt/Qt5.1.0/Tools/QtCreator/bin/qtcreator &

Choose ToolOptions:

Figure 3-1 New Device

Figure 3-2 Properties of the Device

Figure 3-3 Succeed

Click Finish – it will test the connection between PC and IPC via internet.
Then click the button Build&run.

Figure 3-4 Compilers

Figure 3-5 Qt Version

Figure 3-6 Change the name

Figure 3-7 New kit settings

Follow the steps in 3.2 to build a new project named Test, choose the new development kit:

Figure 3-8 Choose new kit

Before build and run the project, add this to file Test.pro:

Figure 3-9 Test.pro

Now you will see a window shown on the IPC.

4. Debug Linux system

In this chapter we will describe how to view Linux system via the serial port and how to debug program via Internet by using NFS.

4.1. View Linux system via the serial port

1、Connect the COM1 on board to PC
2、Open software “SecureCRT” or “Putty” in Windows.
3、Power on the board, you can see the serial output of information like Figure 4-1.
4、When the system is fully booted, you can communicate with it(user: root, no password).

Figure 4-1 Serial output information

4.2. NFS

Embedded Qt has been in Linux system, the development environment is Ubuntu12.04. You can find more information in CD we provided《User Guide For Embedded Qt.docx》
We assume the development environment is ready.
1、 Install NFS in Ubuntu

$sudo apt-get install nfs-kernel-server

2、 Configure the file “/etc/exports”, add this at the end of file:

/qtprojects *(rw, sync, insecure, no_subtree_check)

Note:
“/qtprojects”: the shared folder in Ubuntu system;
“*”: allows all other PC to get access to this system;
“rw”: means this folder can be read and write by NFS client;
“sync”: synchronous write memory and hard disk;
“insecure”: sent message through the port above 1024;
“no_subtree_check”: no check the parent directory permissions
3、 Restart NFS service

$ sudo /etc/init.d/portmap restart
$ sudo /etc/init.d/nfs-kernel-server restart

4、 Test

$ showmount -e

or mount the shared folder to /mnt:

$ sudo mount -t nfs –o nolock localhost:/qtprojects /mnt

Use command df to check out the result, then umount.

$ df -h
$ sudo umount /mnt

5、Mount NFS on industrial computer Linux
Create a directory

# mkdir /nfsdir

Mount the folder /qtprojects in Ubuntu to /nfsdir on board:

# mount –t nfs :/qtprojects /nfsdir

If you have an executable program like “SerialTest” under folder “/qtprojects”, you can run it directly on board.

# /nfsdir/SerialTest
这篇文章对您有用吗? 1