How to build real-time kernel for Apalis IMX6

hi all,

has anybody tried to build real-time kernel for Apalis or Colibri IMX6 module with Yocto or OE?

i’ve tried to apply RT patch on kernel 3.14.28 (the one which OE builds with meta-toradex layer), but this failed. i know, it was a bit naive, but i tried that anyway. :slight_smile:

thanks a lot,

david

Hello David

While this is not directly supported by Toradex one can apply the real-time patches to our i.MX6 Kernel.
In the meta-fsl-arm layer there is a recipe that applies the patches to the vanilla Freescale/NXP kernel tree. This includes addtional i.MX6 specific patches not included in the kernel.org real-time patch set.

https://github.com/Freescale/meta-fsl-arm/blob/fido/recipes-kernel/linux/linux-imx-rt_3.14.28.bb

As Toradex did backport the extcon subsystem for use with the unusual USB client/host switching on the Colibri i.MX6 the real-time patch itself fails in two hunks. Thus one has to patch the patch before applying it to the kernel tree.


To build the real-time kernel outside of OE one can follow:
http://developer.toradex.com/software-resources/arm-family/linux/board-support-package/build-u-boot-and-linux-kernel-from-source-code
Before the configuring and building steps one would patch the kernel tree.

First download and unzip the real time patch from kernel.org. Then apply the patch for rt-patch to it.

Secondly apply the patches given in the linux-imx-rt_3.14.28.bb recipe in the order given in the SRC_URI variable.

Third configure the Kernel for the wanted module and then change the configuration using whatever is needed for your real-time use case.

Then build and deploy the kernel as one would normally do


One could also put together a recipe similar to linux-imx-rt, doing the patching of the patchfile before the do_patch task and thus automating the above steps.


Max

As @max.krummenacher has already mentioned, we don’t officially support a real-time iMX6 kernel. However, we have one built & available for testing. Our real-time kernel is based on the linux-imx-rt_3.14.28 recipe from meta-fsl-arm. The steps to testing it are:

  1. Download additional repo entries to the package manager:

    wget –P /etc/opkg/ http://feeds.toradex.com/extra-kernel/2.5/conf/all/extra-kernel.conf

  2. Update the package manager’s package cache:

    opkg update

  3. Download and execute an installation script to install and configure the real-time kernel:

    cd

    wget http://feeds.toradex.com/extra-kernel/2.5/conf/colibri-imx6/install-rt-kernel.sh

    ./install-rt-kernel.sh

  4. Reset the system

    reboot

The system should now boot the newly installed real-time kernel. Please refer to Max’s post for the details of how to build the kernel.

hi max,

thank you very much. :slight_smile:

i’ve did what you suggested, ie. i’ve used the provided patch to patch RT patch (patch-3.14.28-rt25.patch) and let OE to patch the kernel from “meta-toradex” layer. i’m able to build 3.14.28-rt25 kernel now.

i’ve also included “rt-tools” into image. so, i can use “cyclictest” for initial tests, which already show some difference between RT and non-RT kernel.

thanks a lot guys.

david

hi brandon,

thanks for help. nevertheless, i can build rt kernel mine-self. :slight_smile:

but this can be a great help for others.

dave