Skip to main content

Build Marvell ARMv5 toolchain with Crosstool-NG

Notes: under Ubuntu 16.04

 

0. Prepeare - install required tools



1. Install crosstool-ng

# mkdir -p scratch/ct-ng; cd scratch/ct-ng

# wget http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-1.18.0.tar.bz2

# tar xf crosstool-ng-1.18.0.tar.bz2

# cd crosstool-ng-1.18.0

# ./configure --prefix=`pwd`/crosstool

# make && make install

# export PATH="${PATH}:`pwd`/crosstool/bin"

# ct-ng help

This is crosstool-NG version 1.18.0



2. Configure marvell ARMv5 toolchain


# mkdir -p ~/scratch/marvell; cd ~/scratch/marvell

# ct-ng list-samples

 [G.X]   arm-cortex_a15-linux-gnueabi
 [G..]   arm-cortex_a8-linux-gnueabi
 [G..]   arm-davinci-linux-gnueabi
 [G..]   arm-unknown-eabi
 [G..]   arm-unknown-linux-gnueabi
 [G.X]   arm-unknown-linux-uclibcgnueabi
 [G..]   x86_64-unknown-linux-gnu
 [G..]   x86_64-unknown-linux-uclibc
 [G.X]   x86_64-unknown-mingw32


# ct-ng show-arm-unknown-linux-gnueabi


    OS             : linux-3.7.3
    Companion libs : gmp-4.3.2 mpfr-2.4.2 libelf-0.8.13
    binutils       : binutils-2.19.1a
    C compiler     : gcc-4.3.2 (C,C++,Fortran,Java)
    C library      : glibc-2.9 (threads: nptl)
    Tools          : dmalloc-5.5.2 duma-2_5_15 gdb-6.8a ltrace-0.5.3 strace-4.5.19


# ct-ng arm-unknown-linux-gnueabi


 ***********************************************************
 Initially reported by: Alexander BIGGA
 URL: http://sourceware.org/ml/crossgcc/2008-06/msg00031.html
 ***********************************************************

 Now configured for "arm-unknown-linux-gnueabi"

# mkdir ~/scratch/src

# mkdir ~/scratch/x-tools

# ct-ng menuconfig

  Paths and misc options -- Local tarballs directory: ${HOME}/scratch/src
  Paths and misc options -- Prefix directory: ${HOME}/scratch/x-tools
  Target options -> Architecture level -> armv5te  # marvell 88F6282


  * Need also to update Kernel and GCC version according to target board


3. Build

# ct-ng builld

....................


 And after build completes, toolchain will be installed in ${HOME}/scratch/x-tools



Reference:
* http://shyuanliang.blogspot.ca/2013/08/crosstool-ng-toolchain.html

Popular posts from this blog

Installing Debian on QNAP HS-210, TS-21x and TS-22x devices

QNAP's original firmware has a lot of bloatware. If you want to has a lean NAS with more choices and controls on what are running inside the box, here is a webpage to install Debian, my favorite distro, into TS-212p. [https://www.cyrius.com/debian/kirkwood/qnap/ts-219/install/] Overview In a nutshell, the installation of Debian on your QNAP HS-210, TS-21x or TS-22x works like this: you use the QNAP firmware to write a Debian installer image to flash. When you restart your device, Debian installer starts and allows you to login via SSH to perform the installation. Debian will be installed to disk and a Debian kernel will be put in flash that will start Debian from disk. If you follow this procedure, Debian 9 (stretch) will be installed to your SATA disk and the QNAP firmware on disk and in flash will be replaced with Debian. Debian does not install a web interface to configure your machine, although it's possible to install such software. If this is not what you want, pleas...

JLink V9 Bootloader

v9里面大家最关心的就是bootloader了吧? [https://www.amobbs.com/thread-5653964-1-1.html]   论坛上有很多前辈都给出了各种办法把这个bootloader弄出来,可是都是片言只语,所以这里我整理一下大概的两个办法。 首先是个最简单的办法,不用拆机,没有风险,原理很简单,很多年前论坛上的大牛就发现并公布了这个办法,不过据说后来论坛浮云过一回,资料丢了。 这个办法利用的是jlink自带的一个命令,这个命令能读取jlink自身的内存,我们只是需要用这个命令把bootloader部分的内容读取出来就可以了。 在进入这个具体命令之前,我们来看一下jlink的操纵方法,比较普遍的做法是调用jlinkarm.dll公开的接口,再有sdk的情况下,调用这些接口并不麻烦, 但是如果没有sdk的话,c/c++语言要调用这些接口显得特别的麻烦,所以这里我们使用更为底层的办法越过jlink的dll,直接和jlink的驱动打交道。 首先,我们需要找到系统里面的jlink这个设备 GUID classGuid = {0x54654E76, 0xdcf7, 0x4a7f, 0x87, 0x8A, 0x4E, 0x8F, 0x0CA, 0x0A, 0x0CC, 0x9A}; auto devInfoSet = SetupDiGetClassDevsW(&classGuid, nullptr, nullptr, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE); 用上面的代码先找到jlink的class 然后我们需要枚举这个devInfoSet里面的全部成员,依次取得各种信息,最终拿到jlink驱动提供的设备路径 SP_DEVICE_INTERFACE_DATA interfaceData = {0}; interfaceData.cbSize = sizeof(interfaceData); for(DWORD i = 0; ; i ++) {     if(!SetupDiEnumDeviceInterfaces(devInfoSet, nullptr, &classGuid, i, ...