(1). CPU: Andes RISC CPU core_N12.
(2). 平台: ADP-XC5FF676 V1.1.
(3). Linux OS: Ubuntu10.04.
(4). Toolchains: AndeSight v1.4 for Linux.
(5). Embedded Linux2.6.27
2. 目的:
移植Qt for Embedded Linux至ADP-XC5實驗板,使Qt Creator 上所撰寫的程式可以跨平台在Embedded System上執行.
Qt目前並沒有將Andes Core加到程式的選項內,不過只需要修改部分的程式, Andes Core也可以執行Qt.
3. 移植:
(1). QT for Embedded Linux已於 Embedded Linux系統視窗程式設計-QT(4-1)下載與安裝章節就已下載.
http://andescore.blogspot.com/2009/06/embedded-linux-qt4-1qt-470.html
注意:編譯前,先在根目錄指定Toolchains,使用〝Terminal〞輸入〝source bashrc.nds32le-linux-V0〞,指定編譯路徑.
(2). 使用〝Terminal〞輸入〝tar zxvf qt-everywhere-opensource-src-4.7.0.tar.gz〞解壓縮.


include(../../common/g++.conf)
include(../../common/linux.conf)
include(../../common/qws.conf)
# modifications to g++.conf
QMAKE_CC = nds32le-linux-gcc -EL -G0 -Wa,-mno-small-data -lts
QMAKE_CXX = nds32le-linux-g++ -EL -G0 -Wa,-mno-small-data -lts
QMAKE_LINK = nds32le-linux-g++ -EL -G0 -Wa,-mno-small-data -lts
QMAKE_LINK_SHLIB = nds32le-linux-g++ -EL -G0 -Wa,-mno-small-data -lts
# modifications to linux.conf
QMAKE_AR = nds32le-linux-ar cqs
QMAKE_OBJCOPY = nds32le-linux-objcopy
QMAKE_STRIP = nds32le-linux-strip
load(qt_config)

//# error "This architecture is not supported. Please talk to qt-bugs@trolltech.com"
# define __NR_inotify_init 291
# define __NR_inotify_add_watch 292
# define __NR_inotify_rm_watch 293
# define __NR_inotify_init1 332

a. 不支援觸控面板:
〝./configure -embedded generic -little-endian -no-freetype -no-glib -largefile -no-accessibility -no-xmlpatterns -multimedia -no-audio-backend -no-phonon -no-phonon-backend -svg -webkit -no-javascript-jit -script -scripttools -declarative -qt-zlib -qt-gif -qt-libtiff -qt-libpng -qt-libmng -qt-libjpeg -no-openssl -no-pch -no-dbus -v -D ALWAYS_INLINE=inline〞
b. 支援觸控面板:
〝./configure -embedded generic -little-endian -no-freetype -no-glib -largefile -no-accessibility -no-xmlpatterns -multimedia -no-audio-backend -no-phonon -no-phonon-backend -svg -webkit -no-javascript-jit -script -scripttools -declarative -qt-zlib -qt-gif -qt-libtiff -qt-libpng -qt-libmng -qt-libjpeg -no-openssl -no-pch -no-dbus -qt-mouse-tslib -I/usr/local/Trolltech/include -L/usr/local/Trolltech/lib -v -D ALWAYS_INLINE=inline〞










a. 注意:一般SD卡格式都為FAT32,在Linux下無法顯示長檔名,如要支援長檔名請將SD卡format成EXT2或是EXT3格式.format步驟如下所示: http://andescore.blogspot.com/2009/02/format-sd-cardext2.html
b. 因目前ADP-XC5開發板上所使用的OS為AndeSight v1.3.1 Toolchains building 會造成錯誤,請依照Embedded Linux系統(C)_在SD card上執行Embedded Linux http://cid-b01cb9ac20175eaa.skydrive.live.com/self.aspx/Embedded%20Linux%202.6.27%5E_2/XC527執行AndeSight v1.3.3 Toolchains building的OS,再執行下列程序.
(17). 使用〝超級終端機〞輸入〝mount -o mand /dev/cf /tmp〞掛載SD 卡.

export QTDIR=/usr/local/Trolltech/QtEmbedded-4.7.0-generic
export QWS_KEYBOARD=None
export QWS_MOUSE_PROTO=tslib
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
注意:如重loading Embedded Linux也需輸入tslib export參數.


〝ln -s /tmp/usr/local/Trolltech/QtEmbedded-4.7.0-generic /usr/local/Trolltech/〞,
連結tslib檔案輸入
〝ln -s /tmp/etc/pointercal /etc/pointercal〞.




〝printf “\033[9;0]” > /dev/tty0〞,開啟.
注意:中斷測試程式按〝Ctrl+C〞.
(23). 程式執行完畢後要卸載SD需再根目錄輸入〝umount /tmp〞.

a. 使用USB鍵盤與滑鼠:
回覆刪除1. 需增加參數"-qt-kbd-linuxinput -qt-mouse-linuxinput".
2. 所有之前tslib與Qt的export參數都不需要加入,滑鼠就可以使用.
3. 範例如下
〝./configure -embedded generic -little-endian -no-freetype -no-glib -largefile -no-accessibility -no-xmlpatterns -multimedia -no-audio-backend -no-phonon -no-phonon-backend -svg -webkit -no-javascript-jit -script -scripttools -declarative -qt-zlib -qt-gif -qt-libtiff -qt-libpng -qt-libmng -qt-libjpeg -no-openssl -no-pch -no-dbus -qt-kbd-linuxinput -qt-mouse-linuxinput -v -D ALWAYS_INLINE=inline〞.