i.MX Yocto Project: How can I compile the kernel manually?

Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.MX Yocto Project: How can I compile the kernel manually?

No ratings

i.MX Yocto Project: How can I compile the kernel manually?

1. To setup the Yocto environment, from the BASE folder run

fsl-community-bsp $ . setup-environment build

2. Build the toolchain

build $ bitbake meta-toolchain

# Other toolchains:

# Qt Embedded toolchain build: bitbake meta-toolchain-qte

# Qt X11 toolchain build: bitbake meta-toolchain-qt

3. Install it on your PC

build $ sudo sh \


4. Setup the toolchain environment

build $ source \


5. Get the Linux Kernel's source code.

$ git clone git://git.freescale.com/imx/linux-2.6-imx.git linux-imx

$ cd linux-imx

6. Create a local branch

linux-imx $ BRANCH=imx_3.0.35_4.0.0 # Change to any branch you want,

  # Use 'git branch -a' to list all

linux-imx $ git checkout -b ${BRANCH} origin/${BRANCH}


linux-imx $ export ARCH=arm 

linux-imx $ export CROSS_COMPILE=arm-poky-linux-gnueabi-

linux-imx $ unset LDFLAGS

8. Choose configuration and compile

linux-imx $ make imx6_defconfig 

linux-imx $ make uImage 

9. To Test your changes, copy the `uImage` into your SD Card

linux-imx $ sudo cp arch/arm/boot/uImage /media/boot

10. If case you want your changes to be reflected on your Yocto Framework, create the patches following the document i.MX Yocto Project: How can I patch the kernel?

Labels (2)


For 3.10.17 Kernel above steps remains same?

make imx6_defconfig gives error

Can't find default configuration "arch/arm/configs/imx6_defconfig"!

You are right saurabh206, the defconfig is indeed different. It is imx_v7_defconfig. You can check all possibles configs either on the folder you mentioned or with 'make help':

$ make help | grep imx

  imx6_ssd_lite_defconfig  - Build for imx6_ssd_lite

  imx6_ssd_net_lite_defconfig - Build for imx6_ssd_net_lite

  imx_v4_v5_defconfig      - Build for imx_v4_v5

  imx_v6_v7_defconfig      - Build for imx_v6_v7

  imx_v7_defconfig         - Build for imx_v7

  imx_v7_mfg_defconfig     - Build for imx_v7_mfg

Hi, I have imx6q sabresd board, compile & run imx yocto(bitbake fsl-image-gui) without any problem. Now i tried kernel branch imx_3.0.35_4.1.0 as shown above step 5 onwards, compile no issue, however, when run, I can't see any gui on the lcd, I already enable devtmpfs.

Please don't base new products in 3.0.35 kernel as the Freescale GA is now the 3.10.17-1.0.1 one. Regarding building the kernel, my advice goes to use the toolchain generated for this so your development process is highly boosted.

You may want to also look at: Embedded Linux Development with Yocto Project book released | Freescale Community

I follow the steps above and compile kernel 3.10.17-1.0.1, and got this error:

  CC  drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.o

drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c:29:27: fatal error: mach/hardware.h: No such file or directory

#include <mach/hardware.h>


compilation terminated.

make[3]: *** [drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.o] Error 1

I ran also into this problem. Please follow Eric's comment


Hi Otavio,

I want to link to the link you mentioned as below for learning how to do kernel related tasks. But it can't be access. May you redirect me?

Embedded Linux Development with Yocto Project book released | Freescale Community


Access to this place or content is restricted. If you think this is a mistake, please contact your administrator or the person who directed you here.

Sure, you can link to our blog post about it:

O.S. Systems 

Hi Leo,

Which one is suit for i.mx53 I tried with imx_v7_defconfig but kernel panic on my i.mx53 quick start board.



The kernel panic may have several causes; without further information it is hard to guess.

In any case you should open a new topic specific for this as this is not related to the original topic context.

Version history
Last update:
‎07-30-2013 09:49 AM
Updated by: