Move to Shanghai

In a short time, Max will move to Shanghai.
Since blogger is blocked by Chinese government, Max has to switch to a lcoal blog service provider in China and continue the writing.

New blog link: http://thekingisgone.72pines.com/


A script for build Qt application for board arm-

A script build-armsys-6410.sh to build the Qt application for board armsys6410.
  • Cross-compiler is located at /usr/local/arm/4.2.2-eabi/usr/bin
  • Built Qt by the cross-compiler is installed at  /usr/local/qt-4.7.1-armsys-6410/bin/qmake
  • Built Tslib by the cross-compiler is installed at /usr/local/tslib/lib

export PATH=/usr/local/arm/4.2.2-eabi/usr/bin:$PATH
make clean
/usr/local/qt-4.7.1-armsys-6410/bin/qmake LIBS+=-L/usr/local/tslib/lib\ -lts

Fullscreen of Qt Application

See the nice tutorial at Meego


Find all files newer than a givne file

find . -type f -newer  ./include/linux/sonet.h -not -empty -print | xargs ls -l | less


U-Boot Arguments of armsys-6420

NFS boot:
 setenv bootargs "root=/dev/nfs nfsroot= ip= console=ttySAC0,115200"
Here /home/localhost/armsys6410/root is the file system located at my host machine. is the static ip of board, while should be ip of host machine, is the gateway of the LAN, if the board is directly connect to host, the gateway ip is same as host ip, i.e, here.

boot from nandflash
setenv bootargs "root=/dev/mtdblock2 rootfstype=yaffs2 console=ttySAC0,115200"
setenv bootcmd nand read 0xc0008000 0x100000 0x300000\;bootm 0xc0008000
After changing the bootargs, run the following commands to save it and reboot again.


tslib Error & Solution

Task: Build Qt 4.7.1 for board armsys-6410.

Toolchain: supplier provided toolchain (4.2.2-eabi-arm)

Error: When start a Qt example, the following error message show

QWSTslibMouseHandlerPrivate: ts_config() failed with error: 'No such file or directory'
Please check your tslib installation!

The problem is solved by following:

Download & build the latest tslib again from http://tslib.berlios.de/

> tar xzvf tslib-1.4.gz
> cd tslib
>./configure -host=arm-linux -prefix=/usr/local/tslib
>make install
Qt was successfully build with the toolchain:
./configure -prefix /usr/local/qt-4.7.1-armsys-6410 -embedded arm -xplatform qws/linux-arm-g++ -depths 16 -qt-mouse-tslib -I/usr/local/tslib/include -L/usr/local/tslib/lib -R /usr/local/tslib/lib -xmlpatterns -exceptions
make install
Copy the installed Qt into root file system, which will be nfs mounted by board
sudo cp -rf /usr/local/qt-4.7.1-armsys-6410 /home/max/work/arena/rootf/armsys6410/root/usr/local/
Start the board by nfs mounting  /home/max/work/arena/rootf/armsys6410/root/
I use minicom here, the parameters are
setenv bootargs "root=/dev/nfs nfsroot= ip= console=ttySAC0,115200" 
Check the device file of touchscreen. Assume the device of board is /dev/input/event1
cat /dev/input/event1| hexdump
Now when you move the mouse in the touchscreen, the similar texts will be displayed on the console. It means that /dev/input/event1 is the correct device file of touchscreen on board.

0000300 7cc6 3a50 bb73 000b 0003 0001 1f94 0000                                
0000310 7cc6 3a50 bb7d 000b 0000 0000 0000 0000                                
0000320 7cc6 3a50 cee6 000b 0003 0000 0fbb 0000                                
0000330 7cc6 3a50 cefa 000b 0003 0001 1fff 0000                                
0000340 7cc6 3a50 cf03 000b 0000 0000 0000 0000                                
0000350 7cc6 3a50 e269 000b 0001 014a 0000 0000                                
0000360 7cc6 3a50 e27c 000b 0003 0018 0000 0000                                
0000370 7cc6 3a50 e281 000b 0000 0000 0000 0000

Add following enviromental variables into /etc/profile

export TSLIB_ROOT=/usr/local/tslib
export TSLIB_TSDEVICE=/dev/input/event1
export TSLIB_CONFFILE=$TSLIB_ROOT/etc/ts.conf
export TSLIB_CALIBFILE=/etc/pointercal
export TSTS_INFO_FILE=/sys/devices/virtual/input/input0/uevent
export QWS_MOUSE_PROTO=tslib:/dev/input/event1
export QWS_KEYBOARD=TTY:/dev/tty1
export HOME=/root
export QTDIR=/usr/local/qt-4.7.1-armsys-6410
export QPEDIR=/usr/local/qt-4.7.1-armsys-6410
export PATH=$PATH:/usr/local/tslib/lib:$QTDIR/bin
export LD_LIBRARY_PATH=$QTDIR/lib:/usr/local/tslib/lib:/usr/local/lib:$LD_LIBRARY_PATH

Run calibration again.
Try a Qt example,
/usr/local/qt-4.7.1-armsys-6410/examples/widgets/calculator/calculator -qws

The error messages didn't show again.


Nice man doc of tslib


homepage of tslib

minicom nfs copy kernel to board



Build Qt 4.7 for armsys-6410

Install the crossing toolchain
refer to chapter 4 安装交叉编译器

交叉编译工具链的安装文件为“ARMSYS6410-B基础配置光盘资料\Linux相关\linux2.6标准版\交叉编译器”目录下的 cross-4.2.2-eabi.tar.bz2.

>tar xjvf cross-4.2.2-eabi.tar.bz2 –C /usr/local/arm
>export PATH=$PATH:/opt/toolchains/arm920t-eabi/bin

Build tslib (touch screen)

Install necessary tools
> apt-get install autoconf automake libtool

Download souce of tslib from http://tslib.berlios.de/

Build tslib
> tar xzvf tslib-1.4.gz
> cd tslib
>./configure -host=arm-linux -prefix=/usr/local/tslib -enable-input=no (wrong???)
tslib will be install at /usr/local/tslib. If get error, you may comment out the line " '#define malloc rpl_malloc" in config.h
>make install
Reference: http://blog.chinaunix.net/u2/75270/showart_1793535.html

Build Qt 4.7.1

Download qt-4.7.1
>wget http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.1.tar.gz
>tar xfzv qt-everywhere-opensource-src-4.7.tar

Configure the Qt Embedded.
>./configure -prefix /usr/local/qt-4.7.1-armsys-6410 -embedded arm -xplatform qws/linux-arm-g++ -depths 16 -qt-mouse-tslib -I/usr/local/tslib/include -L/usr/local/tslib/lib -R /usr/local/tslib/lib -xmlpatterns -exceptions

Build Qt
>make install
Reference: http://doc.qt.nokia.com/main-snapshot/qt-embedded-crosscompiling.html