To configure Eclipse to use a Yocto toolchain, go to Window | Preferences | Yocto
Project SDK. The SDK configuration offers two cross-compiler options:
- Standalone pre-built toolchain: Choose this when you have installed a Yocto SDK including a toolchain
- 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:
- QEMU: Choose this if you are using Poky with a virtualized machine like qemuarm.
- 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
- Standalone pre-built toolchain:
To use the QEMU emulator with the Standalone pre-built toolchain, we need to download the following into the configured sysroot directory:
- The qemuboot configuration file: http://downloads.yoctoproject.org/releases/yocto/yocto-2.4/machines/qemu/qemuarm/core-image-sato-sdk-qemuarm.qemuboot.conf
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
- A QEMU kernel image: For example, http://downloads.yoctoproject.org/releases/yocto/yocto-2.4/machines/qemu/qemuarm/zImage-qemuarm.bin
- A QEMU ARM versatilepb machine device tree: http://downloads.yoctoproject.org/releases/yocto/yocto-2.4/machines/qemu/qemuarm/zImage-versatile-pb.dtb
- An ext4 root filesystem SDK image: For example, core-image-sato-sdk: http://downloads.yoctoproject.org/releases/yocto/yocto-2.4/machines/qemu/qemuarm/core-image-sato-sdk-qemuarm.ext4
You will then be able to run QEMU using the Run | External Tools | External Tools Configurations | Run menu:
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
- Build system derived toolchain:
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.