Tag Archives: arietta g25

Building the Arietta G25 Kernel

I’m using the Arietta G25 for a project of mine. Earlier I described how to build a bootloader for the 256MB version of the board.

Today I’m going to describe how to build the kernel for the Arietta G25. I needed ADC support as well as modules for some USB to ethernet adaptors that weren’t included in the kernel image ACME Systems provides.

First off you will need to install the toolchain to build armel binaries. ACME Systems has a page describing how to install the ARM9 toolchain. Here’s the short summary:

$ sudo apt-get install emdebian-archive-keyring libc6-armel-cross libc6-dev-armel-cross binutils-arm-linux-gnueabi gcc-arm-linux-gnueabi g++-arm-linux-gnueabi u-boot-tools libncurses5-dev

Once you have the environment setup it’s time to checkout the kernel and build. This is the Jenkins script I use to build the Arietta G25 kernel:

if [ ! -d "linux-3.14.7" ]; then
wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.7.tar.xz -O linux-3.14.7.tar.xz
tar xvfJ linux-3.14.7.tar.xz
cd linux-3.14.7
wget http://www.acmesystems.it/www/compile_linux_3_14/acme.patch -O acme.patch
patch -p1 < acme.patch

wget https://watchmysys.com/blog/wp-content/uploads/2014/08/linux-at91.config -O .config
wget https://watchmysys.com/blog/wp-content/uploads/2014/08/arietta_256m_ikconfig.patch -O arietta_256m_ikconfig.patch
patch -p1 < arietta_256m_ikconfig.patch
else
cd linux-3.14.7
fi
make ARCH=arm clean
CPUS=$(cat /proc/cpuinfo | grep -c "processor")

wget https://watchmysys.com/blog/wp-content/uploads/2014/08/acme-arietta-adc.dtb -O arch/arm/boot/dts/acme-arietta.dtb
make -j$CPUS ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- zImage
make modules -j$CPUS ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
make modules_install INSTALL_MOD_PATH=./modules ARCH=arm
mkdir -p modules/boot
cp arch/arm/boot/zImage modules/boot/
rm linux-3.14.7-arietta.tar.bz2
tar -C modules -cjvf linux-3.14.7-arietta.tar.bz2 lib/ boot/

The above commands are available in a bash/Jenkins script at the bottom of this post.

Installation is fairly simple, you need to mount the sdcard /boot and / partitions on your computer and then run:

tar -C /path/to/sdcard -jxvf linux-3.14.7-arietta.tar.bz2

My kernel configuration includes the Atmel ADC driver as a module (at91_adc) so you can unload/reload it (possibly to save power). It also includes the dm9601 and sr9700 modules for the Davicom DM96xx USB 2.0 10/100M Ethernet Adaptor, which is an inexpensive USB to ethernet adaptor available online (such as this one).

If you want to generate your own dtb (for instance enable PWM instead of the ADC) you can do that at this ACME Systems page.

Build script: linux-at91.sh
Kernel and modules: linux-3.14.7-arietta.tar.bz2
Kernel Config: linux-at91-3.14.7.config

ACME Systems Arietta G25 bootstrap

I’m using the ACME Systems Arietta G25 256MB model for a project I’m working on, but their website only provides a bootstrap for the 128MB version. Let’s build a bootstrap for the 256MB version.

The instructions on their website are for Ubuntu 13.10, but I run Debian so these instructions are for Debian 7.

As per their instructions you need to enable the emdebian repository:

user@debian7:~$ sudo -i
root@debian7:~# apt-get install emdebian-archive-keyring
root@debian7:~# echo "deb http://www.emdebian.org/debian/ squeeze main" > /etc/apt/sources.list.d/emdebian.list
root@debian7:~# echo "deb http://ftp.us.debian.org/debian/ squeeze main" >> /etc/apt/sources.list.d/emdebian.list

Even though I’m running Wheezy the repositories in /etc/apt/sources.list.d/emdebian.list are for squeeze. This is necessary due to unavailable packages on Wheezy which are present in squeeze. Please see the Emdebian page for an explanation.

user@debian7:~$ sudo apt-get install libc6-armel-cross libc6-dev-armel-cross binutils-arm-linux-gnueabi u-boot-tools libncurses5-dev gcc-4.4-arm-linux-gnueabi cpp-4.4-arm-linux-gnueabi g++-4.4-arm-linux-gnueabi

Clone the bootloader from ACME Systems:

user@debian7:~$ git clone git://github.com/linux4sam/at91bootstrap.git
user@debian7:~$ cd at91bootstrap
user@debian7:~/at91bootstrap$: git checkout origin/at91bootstrap-3.x -b at91bootstrap-3.x
user@debian7:~/at91bootstrap$: wget http://www.acmesystems.it/www/compile_at91bootstrap/acme.patch -O acme.patch
user@debian7:~/at91bootstrap$: patch -p1 < acme.patch
user@debian7:~/at91bootstrap$: make mrproper
user@debian7:~/at91bootstrap$: make acme_ariettasd_linux_zimage_dt_defconfig
user@debian7:~/at91bootstrap$: wget https://watchmysys.com/blog/wp-content/uploads/2014/07/256mb.patch_.txt -O 256mb.patch
user@debian7:~/at91bootstrap$: patch -p1 < 256mb.patch
user@debian7:~/at91bootstrap$: make CROSS_COMPILE=arm-linux-gnueabi-

Now copy the generated zimage to the boot partition on the sdcard (/dev/sdX1, mounted here at /tmp/arietta/boot):

user@debian7:~/at91bootstrap$: sudo cp binaries/acme_arietta-sdcardboot-linux-zimage-dt-3.6.2.bin /tmp/arietta/boot/boot.bin

Boot the Arietta G25. You should have 256MB of RAM available now.

The 256mb.patch does two things to the at91bootstrap:
1) Changes the size of the memory initialized from 128MB (0x8000000) to 256MB (0x10000000)
2) Changes the Kernel command line to mem=256M so the additional memory is utilized by the Linux kernel

If you aren’t interested in setting up a build environment, you can find the 256MB boot.bin: here. WordPress does not allow .bin files, so you will need to rename boot.bin_.zip to “boot.bin” before copying it to the sdcard boot partition.

Additionally if you want to automate building the bootstrap with Jenkins, here is a shell script you can put into a new Jenkins project to automatically build the zimage. You will need to manually install the toolchain (described above).