There is interest in the community to support building Zephyr images: https://www.zephyrproject.org/ in Yocto. Presently the only way (AFAIK) to build Zephyr images is based on command line/Kconfig, similar to building Linux kernel images. It should be possible/desirable to provide support to build Zephyr images via yocto/bitbake recipes. As a proof of concept, create a recipe to build a simple "Hello World" image: $ bitbake hello-world Probably the best way to implement this would be via a yocto supported layer "meta-zephyr".
The build should target Zephyr release 1.6, as this release is the first one with "unified" kernel (no separate micro and nano kernels anymore)
Pushed the initial commit here: http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=juro/meta-zephyr The layer works fine, builds and tests various Zephyr tests program. The layer also contains a recipe to build Zephyr "philosophers" sample. This sample is a bit more sophisticated than "hello world" sample. It is trivial to create "hello world" sample, I will probably add it at some point as well. It is also possible to run the samples in qemu. The meta-zephyr supports properly only x86 toolchains. Some work has been done to support ARM, but this needs a proper Cortex-M3 code generation. Presently, there is no tune for ARM in poky that supports Cortex-M3.
Also, in order to perform "testimage", you need these two patches: http://lists.openembedded.org/pipermail/openembedded-core/2016-December/129996.html http://lists.openembedded.org/pipermail/openembedded-core/2016-December/129997.html
Sent notice to the yocto mailing list: https://lists.yoctoproject.org/pipermail/yocto/2016-December/033521.html
I also managed to get the Cortex-M3 images to be build.
A new layer "meta-zephyr" implements the functionality (and more) as specified as the objective for this enhancement. There is a README file describing the usage as well. git@git.yoctoproject.org/meta-zephyr