(1). CPU: Andes RISC CPU core_N12.
(2). 平台: ADP-XC5FF676 V1.1.
(3). Linux OS: Ubuntu10.04.
(4). Toolchains: AndeSight v1.3.3 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-1.html
注意:編譯前,先在根目錄指定Toolchains,使用〝Terminal〞輸入〝source bashrc.nds32le-linux-V0〞,指定編譯路徑.
(2). 使用〝Terminal〞輸入〝tar zxvf qt-embedded-linux-eval-src-4.6.0.tar.tar〞解壓縮.


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 -qt-zlib -qt-libpng -qt-gif -qt-libtiff -qt-libmng -qt-libjpeg -no-openssl -little-endian -webkit -svg -no-xmlpatterns -no-phonon-backend -no-accessibility -no-glib -no-freetype -no-dbus -no-pch -v -D ALWAYS_INLINE=inline〞
b. 支援觸控面板:
〝./configure -embedded generic -qt-zlib -qt-libpng -qt-gif -qt-libtiff -qt-libmng -qt-libjpeg -no-openssl -little-endian -webkit -svg -no-xmlpatterns -no-phonon-backend -no-accessibility -no-glib -no-freetype -no-dbus -no-pch -qt-mouse-tslib -I/usr/local/Trolltech/include -L/usr/local/Trolltech/lib -v -D ALWAYS_INLINE=inline〞
注意:選擇支援觸控面板必須加入tslib路徑,記得路徑使用者名稱需修改.










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.6.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.6.0-generic /usr/local/Trolltech/〞,
連結tslib檔案輸入
〝ln -s /tmp/etc/pointercal /etc/pointercal〞.


(22). 執行〝./borderlayout -qws〞,


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

查詢Qt for embedded linux confugurt參數可以輸入:
回覆刪除./configure -embedded -help