Hướng Dẫn Download và cài đặt Các Toolchain dành cho ARM
Vao website: http://download.opencontroller.com/distfiles
Sau day download cac packet sau ve:
binutils-2.22
gcc-4.7.0
newlib-1.20.0
openocd-0.5.0 and/or openocd-0.6.0
gcc-4.7.0.patch
- Install GCC dependencies:
- libgmp-dev - Multiprecision arithmetic library developers tools
- libmpfr-dev - Multiple precision floating-point computation developers tools
- libmpc-dev - Multiple precision complex floating-point library development package
- libftdi-dev - Library to control and program the FTDI USB controller
- zlib1g-dev - zlib is a library implementing the deflate compression method
$ sudo apt-get install libgmp-dev libmpfr-dev libmpc-dev libftdi-dev zlib1g-dev
- binutils:
$ cd /tmp/binutils-2.22/
$ ./configure --target=arm-none-eabi \
--prefix=/opt/tools \
--enable-interwork \
--enable-multilib \
--disable-nls \
--disable-libssp
$ make all
$ sudo make install
Neu may tinh cua ban da core, vi du co 2 core:
$ make -j2 all
- GCC -Bootstrap
$ cd /tmp/gcc-4.7.0
$ patch -p1 < /tmp/gcc-4.7.0.patch
$ mkdir /tmp/gcc-4.7.0-build
$ cd /tmp/gcc-4.7.0-build
$ /tmp/gcc-4.7.0/configure --target=arm-none-eabi --prefix=/opt/tools/ --enable-interwork --enable-multilib --enable-languages="c" --with-newlib --with-headers=/tmp/newlib-1.20.0/newlib/libc/include/ --disable-libssp --with-gmp=/opt/tools/ --with-mpfr=/opt/tools/ --with-mpc=/opt/tools/ --with-libiconv-prefix=/opt/tools/ --disable-nls –with-system-zlib
$ make all-gcc
$ sudo make install-gcc
- NewLib
Dau tien, ban nen them vao dong lenh sau vao file .bashrc:export PATH=$PATH:/opt/tools/bin
$ cd /tmp/newlib-1.20.0
$ ./configure \
--target=arm-none-eabi --prefix=/opt/tools/ \
--enable-interwork --enable-multilib \
--disable-libssp –disable-nls
$ make all
$ sudo make install
- GCC -Final step
$ cd /tmp/gcc-4.7.0-build
$ make all
$ sudo make install
- GDB-Debugger(optional)
- OpenOCD
Ta có thể cài OpenOCD 0.5.0 hoặc OpenOCD 0.6.0 hoặc có thể cài cả hai.
$ cd /tmp/openocd-0.5.0
$ ./configure --prefix=/opt/tools --enable-ft2232-libftdi
$ make all
$ sudo make install
Để cài đặt song song OpenOCD 0.6.0 ta làm như sau:
$ cd /tmp/openocd-0.6.0
$ ./configure --prefix=/opt/openocd-dev --disable-werror –enable-ft2232-libftdi
$ ln -sf /opt/openocd-dev/bin/openocd /opt/tools/bin/openocd-0.6.0
$ make all
$ sudo make install
- Ta cũng có thể Download Tool chain từ OpenController theo link sau:
Download về giải nén vào thư mục /opt, sau đấy xóa opt/tools bằng lệnh:
$cd /opt/
$rm -rf tools
Sau đấy ta tạo symlink vào thư mục /usr/local/bin
$ cd /usr/local/bin
$find /opt/arm-2009q3/bin -type f -exec ln -sf \{\} \;
Trong đấy:
find :tìm các file/directory
find<path>
-type f → tim cac file
-exec <command> → tất cả các cái mà tìm thấy được thì chạy với command này
\{\} → tên của những cái mà tìm được
\; → kết thúc command.
Không có nhận xét nào:
Đăng nhận xét