How to do it...

To configure Eclipse to use a Yocto toolchain, go to Window | Preferences | Yocto
Project SDK. The SDK configuration offers two cross-compiler options:

  1. Standalone pre-built toolchain: Choose this when you have installed a Yocto SDK including a toolchain
  2. Build system derived toolchain: Choose this when using a Yocto build directory prepared with meta-ide-support as explained previously

It also offers two target options:

  1. QEMU: Choose this if you are using Poky with a virtualized machine like qemuarm.
  2. External HW: Choose this if you are using real hardware like the Wandboard hardware. This option is the most useful for embedded development.

An example configuration when using a downloaded Yocto SDK installer would be to choose the Standalone pre-built toolchain option along with the QEMU emulator as follows:

  • Cross Compiler Options:
    • Standalone pre-built toolchain:
      • Toolchain Root Location: /opt/poky/2.4
      • Sysroot Location: /opt/poky/2.4/sysroots/armv5e-poky-linux-gnueabi
      • Target Architecture: armv5e-poky-linux-gnueabi
    • Target Options:
      • QEMU Kernel: /opt/poky/2.4/sysroots/armv5e-poky-linux-gnueabi/zImage-qemuarm.bin
Yocto Project SDK plugin Standalone pre-built toolchain QEMU configuration

To use the QEMU emulator with the Standalone pre-built toolchain, we need to download the following into the configured sysroot directory:

The runqemu application will look for this file in the configured sysroot directory root and will use it to configure some QEMU defaults. Apart from other defaults, it sets the qemuarm machine to versatilepb and specifies a device tree to use, as well as setting the default file system type to ext4:

qb_machine = -machine versatilepb
qb_dtb = zImage-versatile-pb.dtb
qb_default_fstype = ext4
Make sure the file permissions are set so that Eclipse has read/write access to them.

You will then be able to run QEMU using the Run | External Tools | External Tools Configurations | Run menu:

External tool configuration window

For a build system derived toolchain using the wandboard reference board, we first need to configure the project as follows:

$ cd /opt/yocto/fsl-community-bsp
$ source setup-environment wandboard
$ bitbake meta-ide-support

Then, we can configure the Eclipse Yocto plugin as shown next:

  • Cross Compiler Options:
    • Build system derived toolchain:
      • Toolchain Root Location: /opt/yocto/fsl-community-bsp/wandboard
      • Sysroot Location: /opt/yocto/fsl-community-bsp/wandboard/tmp/sysroots/wandboard
Yocto Project SDK plugin Build system-derived configuration for external hardware

Finally, we can configure to a Standalone pre-built toolchain for the Wandboard that we have previously compiled and installed too. We will see an example of this configuration in the next sections.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset