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

Linux + QT5

Chipsee IMX LinuxQt5

User Manual

Revision Date Author Description
1.0 2018-5-14 Madi Initial

Supported Board

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

CS12800F101-V2.0 CS12800F101-V3.0

Supported Prebuilt Images

prebuilt-xxxx-20180514.tar.gz and later

Supported MFGTools Version

Mfgtools-K31452-V1.0.tar.gz

System Features

Feature Comment
Kernel Kernel 3.14.52
Bootloader Uboot 2015.04
System Linux + Qt5
Python Python 2.7.9
Qt Qt 5.5.1
Desktop matchbox
user/password [root/root]

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. A 7” product needs a 6V ~ 36V power adapter,a 10” and other bigger size product needs a 15V ~ 36V power adapter. Mini-B USB OTG Cable is used to download system images to the board in the Windows Platform. USB to serial cable is used to debug the Chipsee Industrial Embedded Computer. The TF card is used to make bootable card and reflash the system.

1.2. Software

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

MFGTools is used to download system images to board in the Windows Platform, you can get it from DVD/Linux+QT5/Tools. You can use the Prebuilt Images Package to reflash the system. You can find it in DVD/ Linux+QT5/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 a program for Chipsee Embedded Computers.

2. Debug

This document uses Xshell to debug the Chipsee Industrial Embedded Computer, 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.pdfsuch as 7” Chipsee_F7C-Manual – V2.0.pdfto understand the serial ports of the computer. The debug serial port of Chipsee Industrial Embedded Computer is the first RS232 port, you can 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 the 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, and 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 the VNC-Viewer in Windows to control the Chipsee Industrial Embedded Computer over Ethernet. Just click X11VNC icon to enable the X11VNC. Like Figure 2-6.

Figure 2-6 X11VNC Enable

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

Figure 2-7 Vnc-Viewer Connect

Figure 2-8 authentications

Figure 2-9 VNC Desktop

3. Downloading images

3.1. Booting switch configuration

Chipsee Industrial Embedded Computer supports three boot modes: SD, eMMC, and Download. You can reference 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 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/Linux+QT5/Prebuilts. Like prebuilt-imxv1-cs10600f070v1-linux-emmc-20180319.tar.gz, the package has the following contents. Like table 3-1.

Table 3-1 Prebuilt file package

Contents Comment
boot/imx6q-eisd.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.bz2 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-eisd.dtb dtb file in target emmc
emmc-flash/emmc/imx6q-eisd.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

NoteThe default zImage and imx6q-sabresd.dtb support keep logo from uboot to kernel which don’t support framebuffer. We also provide zImage_framebuffer and imx6q-eisd.dtb_framebuffer which support 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-eisd.dtb.

3.3. Downloading images with MFGTool

The MFGTools can be used to download all images into a target device. It is a quick and easy tool for downloading images. You can get it from DVD and use it in Windows Platform.
• Set boot switch to download mode, please reference 3.1 Booting switch configuration.
• Untar Mfgtools-K31452-Vx.x.tar.gz
• Modify MFGTool config file “cfg.ini”, Like Figure 3-1:

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 the images to one 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\linux directory, replace the old one. Like Figure 3-2:

Figure 3-2 Prepare Images

Run Mfgtools-K31452-V1.0\MfgTool2.exe. Like 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 warning that lets you to format the disk, please ignore or cancel it. Like 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. Then 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 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, then the following image will be seen, indicating you have downloaded the image in emmc.
>>>>>>> eMMC Flashing Completed <<<<<<<
• Power off and switch S1 to eMMC boot mode, you can reference3.1 Booting switch configuration.

4. System Resource

4.1. TF Card/USB/SATA Disk

TF Card and USB Storage support hot plug, SATA Disk don’t support. They will be automatically mounted on /run/media/mmcblk0P*. Like Figure 4-1. Note: TF card and USB Storage do not support NTFS format, Please format it to FAT32 first.

Figure 4-1 TF Card

4.2. Network

This system uses a Networking service to control Ethernet and use wpa_supplicant to control the WIFI network.

4.2.1. Wired Ethernet

You can get the IP address from the following application, like in figure 4-2 and figure 4-3:

Figure 4-2 Wired Connection

Figure 4-3 Ethernet Information

4.2.2. WIFI

You can config WIFI by follow ways.

• Config WIFI by GUI
Click the terminal on the desktop and use the following command to generate network config information, then replace the information in /etc/wpa_supplicant.conf, like figure 4-4, SSID is Chipsee, WIFI Password is 1chipsee234567890.

# wpa_passphrase “Chipsee” “1chipsee234567890”

Figure 4-4 WIFI Config File

Open the WIFI Icon on the desktop, then Click “Enable” button, wait some time, you can get the WiFi working when you look at the “WIFI Enabled!”, like in the figure 4-5.

Figure 4-5 WIFI Enable

Config WIFI by command
Use follow command to enable WIFI first.

# wifienable.sh

List available network and remove default if exist

# wpa_cli list_network

# wpa_cli remove_network

# wpa_cli scan

# wpa_cli scan_result // get latest scan results

# wpa_cli ap_scan 1

Add a new network and list added network

# wpa_cli add_network

# wpa_cli list_network

Set SSID/Password/key management

# wpa_cli set_network 0 ssid ‘“Chipsee”’

# wpa_cli set_network 0 key_mgmt WPA-PSK

# wpa_cli set_network 0 psk ‘”1chipsee234567890”’

Enable the network 0

# wpa_cli select_network 0

Save config

# wpa_cli save_config

Enable WIFI again

# wifienable.sh

4.3. Multimedia

This system support NXP Gstreamer-imx Multimedia library, It supported follow plugins. Like Figure 4-6:

Figure 4-6 GStreamer Plugins

• Record Test, you can use follow command to record music. The -d parameter indicate 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 follow command to playback the recorded sound above.

$ sudo  aplay  -N  -M  test.wav

• You can also use the QT Test Application to record and playback audio. The QT Test Application is HT in the desktop, like in figure 4-7 and figure 4-8, you can click “Audio” button to playback audio directly. You also can click “Record” button to record one 18 seconds audio, then the application will playback it automatically.

Figure 4-7 Hardware Test

Figure 4-8 Audio Test

4.4. HDMI

NOTEHDMI 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 Figure 4-9:

Figure 4-9 Uboot

Use following command to set 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-10

Figure 4-10 HDMI Output Setting

• Reboot your board.
• Use 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 RS 485 which is shared with Bluetooth. So, If you need 3 RS485, please request help. You can contact us over the Contact page. The Serial Port Device node:

Table 4-1 serial port device node

Ports Device Node
RS232_1 /dev/ttymxc0
RS485_2Share with Bluetooth /dev/ttymxc1
RS232_3 /dev/ttymxc2
RS485_4 /dev/ttymxc3
RS485_5 /dev/ttymxc4

You can test the serial port by using the HT_Serial Application in the desktop, like in figure 4-11:

Figure 4-11 HT_Serial Test

Figure 4-12 HT_Serial Test

4.6. CAN Bus

There are two-channel CAN bus, 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 signal have not mount on the 120Ohm Matched Resistance.

Figure 4-13 CAN Connect

Here is 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 the 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

Use the HT application to test CAN, you need to use two Chipsee boards to test. Connect two boards like in figure 4-13, and select can port “can0” or “can1” at the same time, then click “Canstart” at the same time on two both board. The can part in HT application like in figure 4-14:

Figure 4-14 CAN

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 details of port define, you also can check 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

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

Table 4-5 CS12800F010 – V1.0 P28 Port

Pin Number GPIO Number
3 106
4 30
6 95
7 87
8 29
9 28
11 94
12 130

NOTERoot need 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

You can also use the GPIO part of the HT application to test the GPIO. Before you test, you need to connect the output gpio and input gpio, like out 1 — in 1 / out 2 — in 2 / out 3 — in 3 / out 4 — out 4. Then click “SetAllHigh” or “SetAllLow” to check the right light status. You also can set output gpio high or low respectively. Then check the right input gpio status. Like in figure 4-15:

Figure 4-15 GPIO Test

NOTE: The default gpio has 4 Outputs and 4 Inputs. If you want a custom solution, please check the /etc/init.d/chipsee-init file for details.

4.8. Buzzer

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

# 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

You also can use the HT application to test it, like in figure 4-16:

Figure 4-16 Buzzer

6. Development

In this chapter, you can learn how to set up the QT development environment, and develop the first QT application on Chipsee Boards.

6.1. Qts

6.1.1. Download and install QT5.5.1

Download qt-opensource-linux-x64-5.5.1.run or qt-opensource-linux-x86-5.5.1.run from http://download.qt.io/archive/qt/5.5/5.5.1/ and install it on Ubuntu1404 system. Install it in /home/<user>/program directory.

6.1.2. Install SDK

Get the SDK from DVD/Linux+QT5/Tools/fsl-imx-x11-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-vfp-neon-toolchain-3.14.52-1.1.1.sh , Install it like this:

# chmod +x fsl-imx-x11-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-vfp-neon-toolchain-3.14.52-1.1.1.sh
# ./ fsl-imx-x11-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-vfp-neon-toolchain-3.14.52-1.1.1.sh

The default install directory is /opt/fsl-imx-x11/3.14.52-1.1.1. You can install it in this directory, you can also use another directory.
Use the following command to test it:

# source /opt/fsl-imx-x11/3.14.52-1.1.1/ environment-setup-cortexa7hf-vfp-neon-poky-linux-gnueabi
# echo ${CC}

6.1.3. Setting Qtcreator

If you installed qt-opensource-linux-x64-5.5.1.run, the Qtcreator will be installed automatically.

Before you open QtCreator, you need to add the following in the first line of /home/<user>/program/Qt5.5.1/Tools/QtCreator/bin/qtcreator.sh like figure 6-1:

source /opt/fsl-imx-x11/3.14.52-1.1.1/ environment-setup-cortexa7hf-vfp-neon-poky-linux-gnueabi

Figure 6-1

Use the following command to open the Qtcreator.

# /home//program/Qt5.5.1/Tools/QtCreator/bin/qtcreator.sh

Open the QtCreator Options, Tools -> Options -> Build & Run, Set the Debuggers/Compilers/Qt Versions/Kits like figure 6-2/6-3/6-4/6-5:

Figure 6-2 Debuggers

Figure 6-3 Compilers

Figure 6-4 Qt Versions

Figure 6-5 Kits

6.1.4. HelloWorld

Use QtCreator to create a new Qt Widgets Application, named HelloWorld. Like figure 6-6:

Figure 6-6 Qt Widgets Application

Select IMX kits, like in figure 6-7:

Figure 6-7 Kit Selection

Use QMainWindow as the Base class, like in figure 6-8.

Figure 6-8 Base Class

Click “Design” to add one label widget, like in figure 6-9:

Figure 6-9 Add Label Widget

Click “Build” to build, like in figure 6-10:

Figure 6-10

Copy the Helloworld to the <Board>/home/root/ directory, use the following command to run it:

# export DISPLAY=:0.0
# ./HelloWorld

You can get the HelloWorld from /home/leave/build-HelloWorld-imx-Debug directory, but your directory is not the same as this one.

7. Q&A

In this chapter, you can learn how to set up the QT development environment, and develop the first QT application on Chipsee Boards.

7.1. How to Change psplashs

7.1.1. Install IMX SDK and some Packages

Reference 6.1.2 Install SDK to install IMX SDK and install some recommends packages:

$ sudo  apt-get  install  autoconf  libgdk-pixbuf2.0-dev

7.1.2. Generate psplash for your own

Get psplash.tar.gz from DVD/Linux+QT5/Tools/ and extract it

$ sudo tar zxvf psplash.tar.gz

Prepare a PNG file, such as chipsee.png

$ sudo cp chipsee.png psplash/
$ sudo cd psplash

Setting environment

$ source /opt/fsl-imx-x11/3.14.52-1.1.1/environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi

Generate header file and modify the psplash.c, then config and mak:

$ ./make-image-header.sh chipsee.png POKY  //you will find a new file named chipsee-img.h
$ vi psplash.c  // replace the header file name (psplash-poky-img.h) in psplash.c with chipsee-img.h
$ ./autogen.sh
$ make  // you will generate the file psplash

Then you will find the file psplash, replace the one in rootfs /usr/bin/psplash. Reboot your board you will find you have change the psplash.
You can remove the file in rootfs /etc/init.d/psplash.sh to disable it.
If you want to rotate the psplash screen, just do the following in the system:

# echo 180 > /etc/rotation   // rotate  180  angle
# echo 0 > /etc/rotation	    // reset to default.
这篇文章对您有用吗?