1. 主页
  2. 文档
  3. 操作系统手册
  4. Cortex-A9
  5. Ubuntu 14.04

Ubuntu 14.04

Chipsee IMX Ubuntu14.04

User Manual

Rev 1.1

History

Revision Date Author Description
1.1 2019-1-4 Madi Add 10v4 GPIO
1.0 2018-2-7 Madi Initial

Supported Board

CS10600F070-V1.0 CS10600F070-V2.0 CS12800F101-V1.0

CS12800F101-V2.0 CS12800F101-V3.0

Supported Prebuilt Images

prebuilt-xxxx-20180207.tar.gz and later

Supported MFGTools Version

Mfgtools-K31452-V1.0.tar.gz

Table of contents

System Featuress

Feature Comment
Kernel Kernel 3.14.52
Bootloader Uboot 2015.04
System Ubuntu 14.04 LTS
Python Python 2.7.6 / Python 3.4.0
Qt Need install By yourself
GCC 4.8.2
Desktop LXDE
user/password [root/root] or [chipsee/chipsee]

1. Prepare

1.1. Hardware

• Chipsee Industrial Embedded Computer
• 6V ~ 36V Power Adapter (7”) / 15V ~ 36V Power Adapter (10” and other bigger size)
• Mini-B USB OTG Cable
• USB to serial cable or other serial debug cable
• TF Card ( at least 4GB)

You need to prepare the Power Adapter by yourself. 7” product needs a 6V ~ 36V Power Adapter,10” and other bigger size products need a 15V ~ 36V Power Adapter. The Mini-B USB OTG Cable is used to download system images to the board in Windows Platform. The USB to serial cable is used to debug the Chipsee Industrial Embedded Computer. The TF card is used to make a bootable card and reflash the system.

1.2. Software

• MFGTools
• Prebuilt Images Package
• Xshell or other terminal emulation software
• Cross-toolchain
• VNC-Viewer

The MFGTools is used to download system images to the board in Windows Platform, you can get it from DVD/Ubuntu14.04/Tools. You can use the Prebuilt Images Package to reflash the system. You can find it in DVD/ Ubuntu14.04/Prebuilt directory. You can use Xshell to debug Chipsee Industrial Embedded Computer in Windows. You can use VNC-Viewer to remote control Chipsee Industrial Embedded over Ethernet. The cross-toolchain can compile programs for Chipsee Embedded Computers.

2. Debug

This document uses Xshell to debug Chipsee Industrial Embedded Computers, you can also use other tools, like SecureCRT and Minicom.

2.1. Serial Debug

You can reference CAN+RS485+RS232 Connector in Chipsee_FxC-Manual – V2.0.pdf(such as 7” Chipsee_F7C-Manual – V2.0.pdf)to understand the serial ports of the computer, the debug serial port of the Chipsee Industrial Embedded Computer is the first RS232 port, you need to use RS232_1_TXD,RS232_1_RXD,GND.
Please reference How_To_Connect_Board_By_Serial.pdf to connect your PC and Chipsee Industrial Embedded Computer over a Serial cable. Set the Xshell like in figure 2-1 and figure 2-2.

Figure 2-1 Add Session

Figure 2-2 Session Properties

Figure 2-3 Serial Debug

2.2. SSH Debug

Connect the Chipsee Industrial Embedded Computer to the Internet, get the IP address. Then config Xshell or use ssh tool in Linux PC directly.

We will introduce Xshell ssh debug. First we need to add one new session, like in figure 2-1. Secondly, we need to set the session like in figure 2-4.

Figure 2-4 SSH Setting

Figure 2-5 SSH Debug

2.3. VNC Debug

You can use VNC-Viewer in Windows to control Chipsee Industrial Embedded Computer over Ethernet.

Use xShell Serial or SSH connect to Chipsee Industrial Embedded Computer, login by chipsee. Use the following command to install x11vnc. Note: user/password is chipsee/chipsee

$ sudo  apt-get  update
$ sudo  apt-get  install  x11vnc

Set password for VNC-Viewer access. Save the password to default file: ~/.vnc/passwd. Like figure 2-6:

$ sudo  x11vnc  -storepasswd

Figure 2-6 VNC Password Setting

Put the following command to /etc/rc.local to enable the x11vnc execute after the system booted. Like figure 2-7:

x11vnc -display :0 -forever -bg -rfbauth /home/chipsee/.vnc/passwd -rfbport 5900 -o /home/chipsee/.vnc/x11vnc.log

Figure 2-7 x11vnc auto load

Use VNC-Viewer in Windows to control it over Ethernet. Like figure 2-8, 2-9, 2-10.

Figure 2-8 Vnc-Viewer Connect

Figure 2-9 authentications

Figure 2-10 VNC Desktop

3. Downloading images

3.1. Booting switch configuration

Chipsee Industrial Embedded Computer supports three boot modes: SD, eMMC, Download. You can reference the Boot Switch chapter in Chipsee_FxC-Manual – V2.0.pdfsuch as 7” Chipsee_F7C-Manual – V2.0.pdf. If you want to download new images to the board, you can use MFGTools in Windows, or can use our prebuilt image package to make one bootable SD card, then use this SD card to download new images.

3.2. Prebuilt file package

You can get the prebuilt file package from DVD/Ubuntu14.04/Prebuilts. Like prebuilt-imxv1-cs10600f070v2-u1404-emmc-20171029.tar.gz, the package has the following contents. Like table 3-1.

Table 3-1 Prebuilt file package

Contents Comment
boot/imx6q-sabresd.dtb TF Card boot dtb file
boot/u-boot-sd.imx TF Card boot bootloader
boot/zImage TF Card boot kernel file
boot/logo.bmp TF Card boot logo file
filesystem/rootfs-emmc-flasher.tar.bz2 TF Card boot rootfs
mksdcard.sh Shell tools to make bootable TF Card
README Simple Guide
S1.jpg Boot Switch Config Figure
emmc-flash/emmc/rootfs.tar.gz rootfs in target emmc
emmc-flash/emmc/u-boot-emmc.imx bootloader in target emmc
emmc-flash/emmc/zImage kernel file in target emmc
emmc-flash/emmc/zImage_framebuffer kernel file with framebuffer
emmc-flash/emmc/imx6q-sabresd.dtb dtb file in target emmc
emmc-flash/emmc/imx6q-sabresd.dtb_framebuffer dtb file with framebuffer
emmc-flash/emmc/logo.bmp logo file in eMMC
emmc-flash/mkemmc.sh shell tools to download images to eMMC

Note:The default zImage and imx6q-sabresd.dtb supports the logo from uboot to kernel which doesn’t support framebuffer. You can’t use Ctrl+Alt+F2 ~ Ctrl+Alt+F6 to switch the console. We also provide zImage_framebuffer and imx6q-sabresd.dtb_framebuffer which supports the Framebuffer function, but it doesn’t support keep logo from uboot to kernel feature. If you need it, just rename them to zImage and imx6q-sabresd.dtb.

3.3. Downloading images with MFGTool

Figure 3-1 cfg.ini configuration

Note:You can get the supported display from Mfgtools-K31452-V1.0\Profiles\Linux\OS Firmware\firmware directory.
• Modify config file “UICfg.ini”. This file has only one line: PortMgrDlg=1 indicates you can download multiple images to the board at the same time. The max value is 4.
• Copy the images from prebuilt-xxx/emmc-flash/emmc/ to Mfgtools-K31452-V1.0\Profiles\Linux\OS Firmware\files\ubuntu directory, replace the old one. Like in Figure 3-2:

Figure 3-2 Prepare Images

Run Mfgtools-K31452-V1.0\MfgTool2.exe. Like in Figure 3-3, 3-4:

Figure 3-3 Status of Connection

Figure 3-4 Download Images

NOTEIf the PC OS is Windows 7, there is a message that lets you to format the disk, please ignore or cancel it. Like in Figure 3-5:

Figure 3-5 Cancel Format Disk

When download is done, click “Stop” to exit. Like Figure 3-6:

Figure 3-6 Done

Set Boot mode to “eMMC”, Please reference 3.1 Booting switch configuration.

3.4. Downloading images with TF Card

The prebuilt file package has one shell tool to help you to make one bootable TF Card in Linux Platform. Use the TF Card to download images. It’s one another quick and easy way to downloading images.
• Copy prebuilt file to linux environment, like ubuntu1404.
• Insert TF card in ubuntu1404, check the device node, such as /dev/sdc.
• Untar prebuilt package. And do follow this command.

$ sudo  ./mksdcard.sh  --device  /dev/sdc

• Now you get one bootable TF card, insert it in Chipsee board, change the switch S1 to TF card boot mode. You can reference 3.1 Booting switch configuration.
• Power on, and when the following message is displayed, it indicates you have downloaded the image in emmc.
>>>>>>> eMMC Flashing Completed <<<<<<<
• Power off and switch S1 to eMMC boot mode, you can reference 3.1 Booting switch configuration.

4. System Resource

4.1. TF Card/USB/SATA Disk

The TF Card and USB Storage support hot plug, SATA Disk doesn’t support it. They will be automatically mounted on /media/chipsee/. Like in Figure 4-1. Note: USB Storage supports NTFS format, but TF Card can’t support NTFS. If you need TF Card, please format it to FAT32 first.

Figure 4-1 TF Card

4.2. Network

The default network manager is the Network-Manager service. You can get the IP from DHCP, or set static IP manually by using networking service, if so, you need to remove the Network-Manager package.

4.2.1. Network-manager — Wired Ethernet

Just plug one Ethernet cable on board. The Network-manager will obtain an IP from DHCP. Like in Figure 4-2:

Figure 4-2 Wired Connection

4.2.2. Network-manager — WIFI

Disconnect wired connection before you use WIFI. After you set the WIFI password, the system will request you to choose a new keyring which will protect your WIFI password. We will connect to “Chipsee”. Like in Figure 4-2. Fill the password, like in Figure 4-3:

Figure 4-3 WIFI Password

Next, you will get the dialog which will request you to set the password for the new keyring. Just leave it blank or set a password for yourself. Like in figure 4-4. We advise you to leave it blank, the WiFi will connect automatically during the next boot.

Figure 4-4 keyring setting

If you set the keyring and want to reset it, do the following:
• Open the Passwords and Keys, like in figure 4-5:

Figure 4-5 Passwords and Keys

Right click “Default keyring” to change the Password, and set it to blank. Like Figure 4-6.

Figure 4-6 Change the keyring Password

4.2.3. Remove and Install Network-manager Packages

If you want to set a static IP, you can use the Networking Service to manage your network. Before that, you need to remove the Network-manager Package and reboot the board. Remove it like this:

$ sudo  apt-get  remove  --purge  network-manager
$ sudo  apt-get  autoremove  --purge  network-manager

If you want to reinstall it, do the following:

$ sudo  apt-get  install  network-manager

4.2.4. Networking — Wired Ethernet

You can get interfaces file from /etc/network/ directory, this is the config file of Networking service. The following are some examples on how to set the network.
• Set wired Ethernet use DHCP to obtain IP.

### ethX demo
### For ethX uncomment follow two lines.
allow-hotplug  eth0
auto  eth0
## ethX dhcp demo
iface  eth0  inet  dhcp

• Set wired Ethernet use Static IP.

### ethX demo
### For ethX uncomment follow two lines.
allow-hotplug  eth0
auto  eth0
## ethX static demo
iface  eth0  inet  static
pre-up  ifconfig  eth0  hw  ether  00:22:44:66:88:AA  //Set MAC
address  192.168.6.98
netmask  255.255.255.0
gateway  192.168.6.1
dns-nameservers  8.8.8.8      // set DNS

4.2.5. Networking — WIFI

Use Networking to Manage the WIFI. it’s the same with wired Ethernet, you need to use /etc/network/interfaces file. Here are some examples:
• Enable the WIFI and set it use DHCP to obtain IP.
Use the following command to set SSID and Password of WIFI, and generate /etc/wpa_supplicant.conf.

# wpa_passphrase  "your ssid"  " your password "  >  /etc/wpa_supplicant.conf

Modify /etc/network/interfaces, like this:

auto  wlan0
iface  wlan0  inet  dhcp
wireless_mode  managed
wireless_essid  any
wpa-driver  nl80211
wpa-conf  /etc/wpa_supplicant.conf

• Enable WIFI and set Static IP, like this:

iface wlan0 inet static

address  192.168.1.98
netmask  255.255.255.0
gateway  192.168.1.1
dns-nameservers  8.8.8.8

wireless_mode  managed
wireless_essid  any
wpa-driver  nl80211
wpa-conf  /etc/wpa_supplicant.conf

NOTE:This system uses wpa_cli and wpa_supplicant to manage WIFI, It supports nl80211, there is no Wireless_tools, you can’t use iwconfig and iwlist.

4.3. Multimedia

This system supports NXP Gstreamer-imx Multimedia library. It is supported in the following plugins. Like in Figure 4-7:

Figure 4-7 GStreamer Plugins

GStreamer Plugins
• Record Test – you can use the following command to record music. The -d parameter indicates an interrupt after # seconds, follow is 18 seconds.

$ sudo  arecord  -N  -M  -r  44100  -f  S16_LE  -c  2  -d  18  test.wav

• You can use the following command to playback the recorded sound above.

$ sudo  aplay  -N  -M  test.wav

• You also can use LXMusic to Playback audio. Like in Figure 4-8:

Figure 4-8 LXMusic

• Set output as ALSA. Like in Figure 4-9 and 4-10:

Figure 4-9 Set Audio Plugin

Figure 4-10 Set Audio Plugin

4.4. HDMI

NOTE:HDMI doesn’t support hot plug.
Do the following to output the display from HDMI:
• Power off, and connect the HDMI display and board.
• Reference 2.1 Serial Debug to set Serial Debug.
• Power on, in xShell, hit any key to stop autoboot. And input uboot command mode. Like in Figure 4-11:

Figure 4-11 Uboot

• Use the following command to set a different resolution:

For 1080P:
=> setenv displayargs video=mxcfb0:dev=hdmi,1920x1080M@60 video=mxcfb1:dev=off video=mxcfb2:off
= > saveenv
= > boot

For 720P:
=> setenv displayargs video=mxcfb0:dev=hdmi,1280x720M@60 video=mxcfb1:dev=off video=mxcfb2:off
= > saveenv
= > boot

For 480P:
=> setenv displayargs video=mxcfb0:dev=hdmi,800x480M@60 video=mxcfb1:dev=off video=mxcfb2:off
= > saveenv
= > boot

Like Figure 4-12:

Figure 4-12 HDMI Output Setting

HDMI Output Setting
• Reboot your board.
• Use the following command to reset the output from LVDS.

= > setenv  displayargs  video=mxcfb0:dev=ldb  video=mxcfb1:dev=off  video=mxcfb2:off
= > saveenv
= > boot

4.5. Serial Port

There are 5 serial ports, 2 RS232, 3 RS485. The default hardware config is 2 RS232, 2 RS485, 1 RS485 which is shared with Bluetooth. So, If you need 3 RS485, please Contact us. The Serial Port Device nodes:

Ports Device Node
RS232_1 /dev/ttymxc0
RS485_2 (Share with Bluetooth) /dev/ttymxc1
RS232_3 /dev/ttymxc2
RS485_4 /dev/ttymxc3
RS485_5 /dev/ttymxc4

You can install “cutecom” to test the serial port:

$ sudo apt-get install cutecom

Only root user and use the serial port:

$ sudo cutecom

NOTE:All RS485 signals don’t mount on the 120Ohm Matched Resistance.

4.6. CAN Bus

There are two-channel CAN buses, the system has integrated the CAN units. You can use them to test CAN, you also can use the HT application to test them. But you must add one 120ohm resistor between CAN_H and CAN_L on one of the two Boards. Like in figure 4-13:

NOTE: All CAN signals don’t mount on the 120Ohm Matched Resistance.

Figure 4-13 CAN Connect

Here are some examples on how to test CAN by using can units.
• Set the bit-rate to 50Kbits/sec with triple sampling using the following command (use ROOT user)

$ sudo  ip  link  set  can0  type  can  bitrate  50000  triple-sampling  on
OR
$sudo  canconfig  can0  bitrate  50000  ctrlmode  triple-sampling  on

• Bring up the device using this command

$ sudo  ip  link  set  can0  up
OR
$ sudo  canconfig  can0  start

• Transfer packets
a. Transmit 8 bytes with standard packet id number as 0x10

$ sudo  cansend  can0  -i  0x10  0x11  0x22  0x33  0x44  0x55  0x66  0x77  0x88

b. Transmit 8 bytes with extended packet id number as 0x800

$ sudo  cansend  can0  -i  0x800  0x11  0x22  0x33  0x44  0x55  0x66  0x77  0x88 -e

c. Transmit 20 8 bytes with extended packet id number as 0xFFFFF

$ sudo  cansend  can0  -i  0xFFFFF  0x11  0x22  0x33  0x44  0x55  0x66  0x77  0x88 -e  --loop=20

• Bring down the device

$ sudo  ip  link  set  can0  down
OR
$ sudo  canconfig  can0  stop

4.7. GPIO

There are 8 GPIOs, check the “Expansion Connector” chapter in Chipsee_FxC-Manual – V2.0.pdf (X indicate the resolutionlike 710) to know the detail port define, you also can check the the following table:

Table 4-2 CS80480F070 – V1.0 P11 Port

Pin Number GPIO Number
11 205
12 106
13 29
14 30
15 28
16 204
17 94
18 95

Table 4-3 CS10600F070 – V1.0 P21 Port

Pin Number GPIO Number
21 106
22 29
23 30
24 28
27 95
28 94
29 87
30 130

Table 4-4 CS10600F070 – V2.0 P21 Port

Table 4-5 CS12800F010 – V1.0/V2.0/V3.0 P28 PortTable 4-6 CS12800F010 – V4.0 P28 Port

Pin Number GPIO Number
21 29
22 106
23 28
24 30
27 130
28 87
29 94
30 95
Pin Number GPIO Number
3 106
4 30
6 95
7 87
8 29
9 28
11 94
12 130
Pin Number GPIO Number
3 106
4 30
5 95
6 87
7 29
8 28
9 94
10 130

NOTE:Root needs to control the GPIO
• Set gpio106 Output, set it high or low

# echo  106  > /sys/class/gpio/export               //export gpio106
# echo  out  > /sys/class/gpio/gpio106/direction      //set gpio106 Output
# echo  1  > /sys/class/gpio/gpio106/value           //Set gpio106 high
# echo  0  > /sys/class/gpio/gpio106/value           //Set gpio106 low

• Set gpio30 input

# echo  30  > /sys/class/gpio/export                //export  gpio30
# echo  in  > /sys/class/gpio/gpio30/direction        //Set  gpio30 input

• Unexport gpio30

# echo  30  > /sys/class/gpio/unexport             //unexport  gpio30

4.8. Buzzer

The buzzer is one GPIO, the GPIO Number is 80, control it like this:

# echo  80  > /sys/class/gpio/export               //export gpio80
# echo  out  > /sys/class/gpio/gpio80/direction      //set gpio80 output
# echo  1  > /sys/class/gpio/gpio80/value           //Open Buzzer
# echo  0  > /sys/class/gpio/gpio80/value           //Close Buzzer

6. Development

You can use Python and Qt to run your application or other language.

6.1. Python

I will develop one Python3 GUI application; it needs an installed Tkinter, like this:

$ sudo  apt-get  install  python3-tk

Use the following code:

#!/usr/bin/env python3
# -*- coding: UTF-8 -*-

import tkinter as tk

rt = tk.Tk()
rt.resizable(False,False)
rt.title("ChipseePython")

rt.update() 
curWidth = rt.winfo_reqwidth()
curHeight = rt.winfo_height()
scnWidth,scnHeight = rt.maxsize()

tmpcnf = '%dx%d+%d+%d'%(curWidth,curHeight,
(scnWidth-curWidth)/2,(scnHeight-curHeight)/2)
rt.geometry(tmpcnf)

tim=tk.Label(rt,text="Hello Chipsee",font=("Arial",14,"bold"),bg='yellow',justify='left')
tim.pack(expand="yes",fill="both")

rt.mainloop()

Run it like in Figure 6-1:

Figure 6-1 Python

6.2. Qt

There is no Qt environment and build environment in this system, you need to install Qt and set a build environment first. Then we will develop one Qt application.

6.2.1. Set Qt Environment

Use the following command to prepare the Qt Environment.

$ sudo apt-get update
$ sudo apt-get install build-essential git libudev-dev
$ sudo apt-get install qt5-default // or qt4-default if you want to use qt4
$ sudo apt-get clean

6.2.2. Prepare Packages Source

There are some QT packages source demo in DVD/Ubuntu14.04/QT/, use ssh to put them to the Chipsee Board.

6.2.3. Build & Run

We chose hardwaretest_serial_ok_20170223.tar.gz to demonstrate. This demo needs to install qtserialport support first. Is as follows:

$ cd ~
$ git clone git://code.qt.io/qt/qtserialport.git
$ cd qtserialport
$ git checkout 5.3    // for qt4 is “git checkout qt4-dev”
$ cd ../
$ mkdir qtserialport-build
$ cd qtserialport-build
$ qmake ../ qtserialport/qtserialport.pro
$ make
$ sudo make install

Use SSH or USB Storage to put hardwaretest_serial_ok_20170223.tar.gz to Chipsee Board. Now we are in Chipsee Board Debian system console:
Use the following command to build the Qt application:

$ tar zxvf hardwaretest_serial_ok_20170223.tar.gz
$ cd hardwaretest_serial
$ qmake
$ make

Modify the permission of serial ports device node

$ sudo chmod 666 /dev/ttymxc*

Run the hardwaretest_serial:

$ cd hardwaretest_serial
$ export DISPLAY=:0
$ ./hardwaretest_serial

Like Figure 6-2:

Figure 6-2 hardwaretest_serial

7. Q&A

7.1. How to rotate the display

Modify /etc/X11/xorg.conf and /usr/share/X11/xorg.conf.d/10-evdev.conf to rotate the display and touchscreen. If the file does not exist, please create a new one.
/etc/X11/xorg.conf

Section "Device"
        Identifier      "Builtin Default fbdev Device 0"
        Driver          "fbdev"
#        Option          "Rotate" "CW"   // 90°
#        Option          "Rotate" "UD"   // 180°
#        Option          "Rotate" "CCW"   // 270°
EndSection

/usr/share/X11/xorg.conf.d/10-evdev.conf

Section "InputClass"
        Identifier "evdev touchscreen catchall"
        MatchIsTouchscreen "on"
        MatchDevicePath "/dev/input/event*"
#90°
#        Option "SwapAxes" "True"         //Swap X Axes and Y Axes
#        Option "InvertY" "True"           //Invert Y Axes
#180°
#        Option " InvertX" "True"          // Invert X Axes
#        Option "InvertY" "True"           //Invert Y Axes
#270°
#        Option "SwapAxes" "True"         //Swap X Axes and Y Axes
#        Option "InvertX" "True"           //Invert X Axes

        Driver "evdev"
EndSection

7.2. How to disable the Screensaver

Open the Screensaver Setting dialog, Like in Figure 7-1

Figure 7-1 Screensaver

Figure 7-2 Disable Screen Saver

7.3. Autostart Application after Boot

We will autostart test.py from 6.1. Python.
• Change the mode for test.py and copy it to /usr/local/bin:

$ sudo  chmod  a+x  test.py
$ sudo  cp  test.py  /usr/local/bin/

• Put test.py in LXDE autostart file, like this:

Autostart File:/home/chipsee/.config/lxsession/LXDE/autostart
Add follow to the end of autostart file.

@test.py

• Reboot to test.

这篇文章对您有用吗?