Task #8 - Build kernel manually using created toolchain

Document created by Daiane Angolini Employee on Jul 24, 2013Last modified by Daiane Angolini Employee on Nov 7, 2014
Version 5Show Document
  • View in full screen mode

After bitbake meta-toolchain the script to install the toolchain package is located under

 

$ ls tmp/deploy/sdk/poky-eglibc-x86_64-arm-toolchain-1.4.1.sh

   tmp/deploy/sdk/poky-eglibc-x86_64-arm-toolchain-1.4.1.sh

In order to install it:

 

$ source poky-eglibc-x86_64-arm-toolchain-1.4.1.sh

    [sudo] password for daiane:

    Enter target directory for SDK (default: /opt/poky/1.4.1):

    You are about to install the SDK to "/opt/poky/1.4.1". Proceed[Y/n]?y

    Extracting SDK...done

    Setting it up...done

    SDK has been successfully set up and is ready to be used.

 

 

Hello World

 

$ source /opt/poky/1.4.1/environment-setup-armv7a-vfp-neon-poky-linux-gnueabi

$ cd ~/test/

$ arm-poky-linux-gnueabi-gcc helloworld.c

$ ls

a.out                                                 helloworld.c                          

$ ./a.out

-bash: ./a.out: cannot execute binary file

$ file a.out

a.out: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped

 

 

Kernel

 

$ source /opt/poky/1.4.1/environment-setup-armv7a-vfp-neon-poky-linux-gnueabi

$ cd linux-2.6-imx

$ git checkout remotes/origin/imx_3.0.35

$ export ARCH=arm

$ export CROSS_COMPILE=$TARGET_PREFIX

$ unset LDFLAGS

$ make imx6_defconfig

$ make uImage

 

Make sure to have mkimage available on bin patch (if using mkimage from u-boot export its patch)

 

Or, download the ubuntu pachage:

 

sudo apt-get install uboot-mkimage

 

UPDATE

You may find the following error:

  OBJCOPY arch/arm/boot/zImage

  Kernel: arch/arm/boot/zImage is ready

multiple (or no) load addresses:

This is incompatible with uImages

Specify LOADADDR on the commandline to build an uImage

make[1]: *** [arch/arm/boot/uImage] Error 1

make: *** [uImage] Error 2

 

This is regarding a missing LOADADDR for mkimage to use to generate uImage with the right offset to be placed in the right LOADADDR.

 

The address value is dependent on your hardware! And it is different depending on imx6 variations. So please be aware regarding what is your right value.

 

If the machine you are using is supported in yocto project/meta-fsl-arm, for example, you can find the value related with your board in the file conf/machine/include/imx-base.inc or online here meta-fsl-arm - Layer containing Freescale ARM hardware support metadata

It is the same value used in variable UBOOT_ENTRYPOINT.

 

 

For example as of this writing for the Freescale SABRE-SD board looking in conf/machine/include/imx-base.inc

UBOOT_ENTRYPOINT_mx6  = "0x10008000"

 

Thus the build command would be:

 

$ make uImage LOADADDR=0x10008000

 

 

 

So, as a quick reference table, I point here the 3 most wanted make command lines:

 

 

imx28evk:

$ make LOADADDR=0x40008000

imx53qsb:

$ make LOADADDR=0x70008000

imx6qsabresd:

$ make LOADADDR=0x10008000

 

 

Update 2

 

Suggested by Craig McQueen

 

Building an autotools-based package. E.g.

 

$ source /opt/poky/1.4.1/environment-setup-armv7a-vfp-neon-poky-linux-gnueabi

$ ./configure ${CONFIGURE_FLAGS}

$ make

$ make install


the CONFIGURE_FLAGS is the variable depending on your very-own project.



Go to Yocto Training - HOME

Go to Task #7 - Create the toolchain

Attachments

    Outcomes