顯示具有 ARM 標籤的文章。 顯示所有文章
顯示具有 ARM 標籤的文章。 顯示所有文章

2015年10月2日 星期五

ubuntu - How to setting the LTIB on ubuntu 14.04

1. Install all build tool into your host PC.

$ sudo apt-get install gettext libgtk2.0-dev rpm bison m4 libfreetype6-dev
$ sudo apt-get install libdbus-glib-1-dev liborbit2-dev intltool
$ sudo apt-get install ccache ncurses-dev zlib1g zlib1g-dev gcc g++ libtool
$ sudo apt-get install uuid-dev liblzo2-dev
$ sudo apt-get install tcl dpkg
$ sudo apt-get install asciidoc texlive-latex-base dblatex xutils-dev
$ sudo apt-get install texlive texinfo
$ sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0
$ sudo apt-get install libc6-dev-i386
$ sudo apt-get install u-boot-tools
$ sudo apt-get install scrollkeeper
$ sudo ln -s /usr/lib/x86_64-linux-gnu/librt.so /usr/lib/librt.so
$ sudo apt-get install gparted
$ sudo apt-get install nfs-common nfs-kernel-server
$ sudo apt-get install git-core git-doc git-email git-gui gitk
$ sudo apt-get install meld atftpd

2. Install LTIB into your host PC.
$ cd ~
$ tar -zxvf L3.0.35_4.1.0_130816_source. tar.gz
$ ./L3.0.35_4.1.0_130816_source/install

3. Apply the patch file.
$ cd ~/ltib
$ git apply 0001_make_L3.0.35_4.1.0_compile_on_Ubuntu_14.04_64bit_OS

4. Run the LTIB on host PC.
$ cd ~/ltib
$ ./ltib -m config
$ ./ltib

Reference : https://community.freescale.com/docs/DOC-100725

2015年10月1日 星期四

ubuntu - How to create the ubuntu rootfs for arm ?


1. Install "debootstrap" into your ubuntu system.
$sudo apt-get install debootstrap

2. Create the ubuntu core file system.
$sudo debootstrap --arch=armhf --keyring=/usr/share/keyrings/ubuntu-archive-keyring.gpg --verbose --foreign trusty rootfs

3. Install "qemu" into your ubuntu system.
$sudo apt-get install binfmt-support qemu qemu-user-static

4. Copy the qwmu-arm-static into your target file system.
$sudo cp /usr/bin/qemu-arm-static rootfs/usr/bin

5. Change root to your target file sytem.
$sudo chroot rootfs /bin/bash

6. Create the target file system without on arm.
$/debootstrap/debootstrap --second-stage

7. Next time, you can use "apt-get" to install any deb into target file system on host pc.

Reference:http://berniechenopenvpn.blogspot.tw/2015/07/filesystem.html

2013年9月2日 星期一

QT4 - How to build the QT for arm ?

1. 安裝之後編譯需要的套件
#sudo apt-get install libxtst-dev

2. 取得 qt x11 server and qt embedded 並且編譯
#wget http://ftp.heanet.ie/mirrors/trolltech/pub/qt/source/qt-x11-opensource-src-4.5.3.tar.gz
#tar -zxvf qt-x11-opensource-src-4.5.3.tar.gz
#cd qt-x11-opensource-src-4.5.3/
#sudo ./configure
#sudo make;sudo make install

#cd tools/qvfb
#sudo make

#wget http://ftp.heanet.ie/mirrors/trolltech/pub/qt/source/qt-embedded-linux-opensource-src-4.5.3.tar.gz
#tar -zxvf qt-embedded-linux-opensource-src-4.5.3.tar.gz qt-embedded-linux-opensource-src-4.5.3/
#cd qt-embedded-linux-opensource-src-4.5.3/
#sudo ./configure -prefix /qt-library-4.5.3 -release -shared -fast -pch -no-qt3support -qt-sql-sqlite -no-libtiff -no-libmng -qt-libjpeg -qt-zlib -qt-libpng -qt-freetype -nomake tools -nomake examples -nomake demos -optimized-qmake -no-nis -no-opengl -no-cups -no-xcursor -no-xfixes -no-xrandr -no-xrender -no-xkb -no-sm -no-xinerama -no-xshape -no-separate-debug-info -xplatform qws/linux-arm-g++ -embedded arm -depths 16 -confirm-license -little-endian
#sudo make;sudo make install
PS. /qt-library-4.5.3就是之後編譯安裝之後的目標 library 

3. 壓縮剛剛編譯完成的QT library
#cd /
#sudo tar -czvf qt-library-4.5.3.tar.gz /qt-library-4.5.3/
4. 接下就可以把製作完成的壓縮檔拿到開發版上面讓已經編譯完成的 QT 程式引用。

reference :
http://it1688.blog.hexun.com.tw/81109706_d.html
http://it1688.blog.hexun.com.tw/81109675_d.html

2013年3月31日 星期日

C/C++ : Data structure alignment

在宣告資料結構的時候,ARM 或是 某些編譯器會自動做對齊,但是對齊的方式是每 4 Byte 做一個單位 ( entries )。這樣很多空間都會在對齊的時候浪費掉。對於現在都是以 Giga 等級的記憶體作為應用的美好時代來說當然沒有差。但是如果有一天真的要到對記憶體錙銖必較的時候就要知道這種用法。

在struct的前後加上 ...



#pragma pack(push) /* push current alignment to stack */
#pragma pack(1) /* set alignment to 1 byte boundary */
typedef struct _test
{
    char ch0; //byte 1
    char ch1; //byte 1
    int in; //byte 4
    short sh; //byte 2
}test;
#pragma pack(pop) /* restore original alignment from stack */


參考資料:

1. http://changeway.pixnet.net/blog/post/7669656-data-structure-alignment
2. http://en.wikipedia.org/wiki/Data_structure_alignment