Steps to Repeat ================ $ git clone git://git.yoctoproject.org/poky $ git clone git://git.yoctoproject.org/meta-zephyr $ source poky/oe-init-build-env $ bitbake-layers add-layer ../meta-zephyr $ echo DISTRO = \"zephyr\" > conf/local.conf $ echo BOARD = \"arduino_101\" > conf/local.conf $ bitbake zephyr-philosophers Observed Behavior ================= BOARD remains at default value of qemu_x86 See tmp/work/i586-yocto-elf/zephyr-philosophers/1.6.0-r0/temp/run.do_compile In task do_compile, make command is make -j V=1 BOARD=qemu_x86 CROSS_COMPILE=/path/to/build/tmp/sysroots/x86_64-linux/usr/bin/i586-yocto-elf/i586-yocto-elf- -C samples/philosophers Expected Behavior ================= BOARD is set to same value as in local.conf In task do_compile, make command should be make -j V=1 BOARD=arduino_101 CROSS_COMPILE=/path/to/build/tmp/sysroots/x86_64-linux/usr/bin/i586-yocto-elf/i586-yocto-elf- -C samples/philosophers
After pondering this somewhat, I believe the best way to fix this is deprecate the variable BOARD altogether and replace it with MACHINE. The meaning of BOARD in Zephyr environment is pretty much equivalent to MACHINE in yocto environment. So the envisioned solution would look something like: $ MACHINE=arduino_101 bitbake zephyr-philosophers or $ MACHINE=qemu_cortex_m3 bitbake zephyr-philosophers etc. where, of course, MACHINE can be set in local.conf as well.
I created support for these new MACHINES: MACHINE=arduino-101 MACHINE=arduino-101-sss MACHINE=qemu-cortx-m3 (with more to follow) These correspond to Zephyr boards: BOARD=arduino_101 BOARD=arduino_101_sss BOARD=qemu_cortx_m3 Specifying MACHINE will implicitly determine cross-compiler toolchain as well. (There is 1:1 correspondence between Zephyr BOARD and Yocto MACHINE so a lookup table BOARD:MACHINE may be needed in the future, presently all that is required is to convert "-" to "_")
meta-zephyr: https://git.yoctoproject.org/cgit/cgit.cgi/meta-zephyr/commit/?id=7c3f7c10de57ae4f4add938fa5188095c5230a69