Compiling Linux Kernel 3.13.6

This article illustrates how to generate a bootable Linux Kernel image for all the Acme board based on Atmel MPUs:

Hardware requirements:

  • a PC with Linux Ubuntu 13.10 installed to cross compile the Kernel
  • an Acme board with Atmel MPU inside
  • a microSD card
  • a Debug Port Interface

Software requirements

Step-by-step Kernel cross-compilation procedure:

Download and save in your home directory the Linux Kernel sources:

Extract the Kernel sources from the compressed file by typing:

~$ tar xvfJ linux-3.13.6.tar.xz
...

Move inside the new folder:

~$ cd linux-3.13.6
~/linux-3.13.6$

Applying patches

Aria G25 and Terra

Download the patch file ariag25.patch and apply it:

~/linux-3.13.6$ patch -p1 < ariag25.patch

FOX Board G20

Download the patch file foxg20.patch and apply it:

~/linux-3.13.6$ patch -p1 < foxg20.patch

Set the basic Kernel configuration

Aria G25 and Terra

~/linux-3.13.6$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- at91-ariag25_defconfig
...
# configuration written to .config

FOX Board G20

~/linux-3.13.6$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- at91-foxg20_defconfig
...
# configuration written to .config

Customize the default Linux Kernel configuration:

If you need to customize the Kernel configuration or just taking a look to the drivers and features activated type:

~/linux-3.13.6$ make ARCH=arm menuconfig

and navigate inside the Kernel configuration using the arrow keys and following the help provided by the menuconfig interface.

Compile the Device Tree Blob file

Aria G25 and Terra

~/linux-3.13.6$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- at91-ariag25.dtb
...

FOX Board G20

~/linux-3.13.6$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- at91-foxg20.dtb
...

Compile the Kernel image

Compile the Linux Kernel sources and generate a binary image file to save in the first partition of microSD card.

Aria G25 and Terra

~/linux-3.13.6$ make -j8 ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage
...
  Image arch/arm/boot/uImage is ready

FOX Board G20

~/linux-3.13.6$ make -j8 ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
...
  Kernel: arch/arm/boot/zImage is ready

Append the compiled device tree blog file at91-foxg20.dtb to the end of new Kernel zImage just created:

~/linux-3.13.6$ cat arch/arm/boot/zImage arch/arm/boot/dts/at91-foxg20.dtb > zImage_w_dtb

Create a file loadable by the FOX Board G20 bootloader AcmeBoot by typing:

~/linux-3.13.6$ mkimage -A arm -O linux -C none -T kernel -a 20008000 -e 20008000 -n linux-3.13.6 -d zImage_w_dtb uImage

On a mid-power PC the whole source compilation requires about 5 minutes.

Compile the Kernel modules

The image generated contains the Linux Kernel and all the built-in device drivers (option [*] in menuconfig) compiled with it.

Al the drivers compiled as external modules (option [M] in menuconfig) need to be compiled and saved in the rootfs /lib directory on the second partition of the microSD. To compile them type:

~/linux-3.13.6$ make modules -j8 ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
...
~/linux-3.13.6$ make modules_install INSTALL_MOD_PATH=./modules ARCH=arm
...

Copy the boot files into the first microSD partition

Method 1 - Direct write on microSD

Insert a formatted microSD in your Linux PC and copy on it the files directly:

Write the Linux Kernel image and Device tree blog files in the first microSD partition:

Aria G25 and Terra

~/linux-3.13.6$ cp arch/arm/boot/dts/at91-ariag25.dtb /media/$USER/KERNEL/at91-ariag25.dtb
~/linux-3.13.6$ cp arch/arm/boot/uImage /media/$USER/KERNEL/image.bin

FOX Board G20

~/linux-3.13.6$ cp uImage /media/$USER/KERNEL/uImage

If you are using an Ubuntu release older than 13.10 remove $USER in the path

Write the Kernel modules in the rootfs (second microSD partition):

~/linux-3.13.6$ sudo rsync -avc modules/lib/. /media/$USER/rootfs/lib/.

Method 2 - Remote writing via ssh

Use this method if you have a working board accessible via LAN

Write the Linux Kernel image and Device tree blog files in the first microSD partition:

Aria G25 and Terra

~/linux-3.13.6$ scp arch/arm/boot/dts/at91-ariag25.dtb root@ariag25.local:/media/mmc_p1
~/linux-3.13.6$ scp arch/arm/boot/uImage root@ariag25.local:/media/mmc_p1/image.bin

FOX Board G20

~/linux-3.13.6$ scp uImage root@foxg20.local:/media/mmc_p1/uImage

Write the Kernel modules in the rootfs (second microSD partition):

~/linux-3.13.6$ rsync -avc modules/lib/. root@ariag25.local:/lib/.

If this command doesn't work verify if rsync in installed on your board. Use apt-get install rsync.

After the first boot

At the first access to the board command line update the module dependencies by typing this command:

~# depmod -a

Use the new Kernel with EmDebian Wheezy Grip rootfs

Related links

ARIAG25-128
EUR 27.60


ARM9 Linux Embedded Module

Aria G25 is a small and low-cost multi-chip module that integrates:* an ARM9 @ 400Mhz CPU Atmel AT91SAM9G25* a 128MB of DDR2 RAM* 10/100 Ethernet interface* up to 3 USB 2.0 host ports* Normal temperature range version (-0° +70°)

| Product description || Flat price up to 999 pcs |

ARIETTA-G25
EUR 25.00


ARM9 Linux Embedded Module (128MB)

Arietta G25 is a small and low-cost multi-chip module that integrates:

  • a ARM9 @ 400Mhz CPU Atmel AT91SAM9G25
  • a 128MB of DDR2 RAM
  • up to 3 USB 2.0 host ports
  • 20x2 pads for strip pitch 2.54mm (100mil)

Basic Version with no strips mounted. If you need to have any strip mounted take a look to the Welding services

| Product description |

TERRA
EUR 169.00


Linux embedded board for fast prototyping

TERRA is a carrier board conceived both to evaluate the Aria G25 SoM and to make prototypes or small production batches of OEM equipments using the Daisy cabling system.

| Product description | Terra catalog |

FOXG20
EUR 139.00


FOX Board G20

FOX Board G20 is a "ready-to-run" Embedded Linux System perfect to use as a solid state WEB server or as a core engine for your embedded appliances.

A fully Open Source environment is available to customize and build your own kernel image or to develop user applications using standard GNU tools. Version with Atmel AT91SAM9G20 with 256KB of FLASH memory, 64MB of RAM and up to 16GB of microSD.

FOXG20 needs some extra accessories in order to be operative:

  • a bootable microSD with Linux OS (see DEBM2G or DEBM4G products)
  • a 5 Volt DC power source (see PS5V1A product)
  • a 3V lithium battery for internal RTC circuitry (see CH23-1220 product)

An evalution kit with all the accessories you need to get started with FOX Board G20 is available on-line on this link: COMBO-2.

Please note

Currently the FOX board G20 are shipped without the daisy connector mounted on top. If you need these connector please ask.

| Product description |