Compiling and Deploying Wandboard Kernel

WANDBOARD:

The Wandboard is a low cost board based on the i.MX6 multicore ARM Cortex-A9 family of processors. In consists of a core module based on the EDM standard and a simple to extend baseboard.

There are various versions of Wandboard-SOLO , Wandboard-DUAL, Wandboard-QUAD and Wandboard-QUAD PLUS based on i.MX6 Processor

TOOLS REQUIRED:

For building the kernel we need several Tools excep Wandboard as given below:


1. PC or Laptop with Linux (Preferably Ubuntu 14.04)
2. Linux kernel source for Wandboard
3. Cross Compiler
4. U-Boot(Bootloader

U-boot:

U-boot is an open source universal Bootloader for Linux systems.
U-Boot is both a first-stage and second-stage bootloader. It is loaded by the system’s ROM or BIOS from a supported boot device, such as an SD card, SATA drive, NOR flash (e.g. using spi or i2c ), or NAND flash. If there are size constraints, U-Boot may be split into stages: the platform would load a small SPL (Secondary Program Loader), which is a stripped-down version of U-Boot, and the SPL would do initial hardware configuration and load the larger, fully featured version of U-Boot. Regardless of whether the SPL is used, U-Boot performs both first-stage (e.g., configuring memory controllers and SDRAM) and second-stage booting (performing multiple steps to load a modern operating system from a variety of devices that must be configured, presenting a menu for users to interact with and control the boot process, etc.).

Download the U-boot from google u-boot-2013.10.tar.bz2

Compile U-Boot:

Before, compiling U-Boot we need to configure it. Configure according your board..

$ tar xvf u-boot-2013.10.tar.bz2
$ cd u-boot-2013.10
$ sudo make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-wandboard_solo_config

After configuring, u-boot can be cross compiled using the following command.

$ sudo make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-

It will take some time depending on the system configuration. After successful compilation, several files will be produced in u-boot/ directory. as u-boot,u-boot.imx,u-boot.bin. Copy these files in the Boot Partition of SD Card..

Building a kernel for beaglebone black:


Building a custom kernel for Wandboard involves the below steps. Feel free to jump to the step you are currently in if you are not looking for a step-by-step guide.
Building a custom kernel for Wandboard involves the below steps. Feel free to jump to the step you are currently in if you are not looking for a step-by-step guide

Cloning the Kernel:

After installing the compiler, clone the kernel source for Wandboard from GitHub using:

$ sudo git clone https://github.com/wandboard-org/linux.git

Go to the linux directory and ensure that you have cloned the correct repo by executing the

$ cd linux
$ git branch -a

It will show all the kernel versions. now checkout the required version as
per your need

$ git checkout local_branch wandboard_imx_3.10.17_1.0.0_beta

Preparing the SD card:

For deploying kernel from SD card, we need to format it and place the files accordingly. For this process, “Gparted” tool is needed. Install Gparted by the following command.

$ suto apt-get install gparted

Insert your sd card by means of SD card reader and open Gparted. Select your sd card from the top right corner. it will be something like this, “/dev/sdb”

Note: Always use sd card of size greater than 2 GB. Although, 500 MB is more than enough for our task, having large free space will come handy at times.

Right click on the rectangular area showing your sd card name and select unmount as we need to unmount the existing partitions. Then, delete the existing partitions by again right clicking and selecting “delete”. This will delete all your files in sd card, so make sure you backed up any important files. We need two partitions in order to boot the kernel, one is for storing the bootable images and another one is for storing the minimal RFS(Root File System). Select new option by right clicking the partitions and provide the following details:

  • New size: 50MBembed journal
  • File System: FAT32
  • Label: BOOT

Click Add button. Then, create another partition for storing Rootfs by entering the options below

  • New Size: 1000MB
  • File System: EXT3/EXT4
  • Label: RFS

Finally, click the green tick mark at the menu bar. The partition will be created and you can see two partitions created as BOOT and Rootfs.

Compile Linux kernel:

Before compiling the kernel we need to configure it. It will be hard for the newbies. Once again, thanks to the kernel developers for providing all configurations in a single file. Go to the kernel directory and issue the following command.

$ sudo make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- wandboard_defconfig
$ sudo make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage LOADADDR=0x10008000 -j4

After compiling you can find the image files in “arch/arm/boot/” directory. Copy “uImage” file from this directory and also “imx6dl-wandboard.dtb” file from “arch/arm/boot/dts/” directory to the BOOT partition.

After completing the above steps you can find the following files in BOOT partition of sd card.

1. uImage
2. imx6dl-wandboard.dtb,imx6q-wandboard.dtb.
3. u-boot,u-boot.imx

Root File System (RFS):

For Creatin a minimal Rootfs please check my older post Building the Minimal Rootfs Using Busybox.
After creating the RFS no install the modules in Rootfs

Install Kernel Modules:

We need modules for proper working of the kernel. So, install the kernel and firmware modules by the following command.

$ sudo make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j4 modules
$ sudo make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=/path/to/ROOT modules_install headers_install firmware_install

That’s it. After completing the above steps, remove the SD card and place it in your Wandboard. Connect the Bone to your PC via putty. (Set baud rate as 115200). After ensuring all things are correct, power on your Wandboard. It will boot from your own custom kernel. Now you can enjoy that you have created your own kernel image and deployed it in Wandboard!!!.

If you encountered any issues on the way, just write it in the comments, we will try to resolve it.

Leave a comment