Bug 10655

Summary: Add support for Zephyr
Product: [Build System, Metadata & Runtime] Other YP Layers Reporter: Juro Bystricky <juro.bystricky>
Component: meta-zephyrAssignee: Juro Bystricky <juro.bystricky>
Status: RESOLVED FIXED QA Contact: Jair Gonzalez <jair.de.jesus.gonzalez.plascencia>
Severity: enhancement    
Priority: High CC: jose.perez.carranza
Version: 2.3   
Target Milestone: 2.3 M1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Yes (doc changes required)
Bug Depends on:    
Bug Blocks: 10656, 10657, 10658, 10659, 10660, 10661, 10662    

Description Juro Bystricky 2016-11-14 23:05:56 UTC
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".
Comment 1 Juro Bystricky 2016-12-01 00:37:39 UTC
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)
Comment 2 Juro Bystricky 2016-12-10 20:08:35 UTC
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.
Comment 4 Juro Bystricky 2016-12-12 22:20:10 UTC
Sent notice to the yocto mailing list:
https://lists.yoctoproject.org/pipermail/yocto/2016-December/033521.html
Comment 5 Juro Bystricky 2016-12-14 18:36:49 UTC
I also managed to get the Cortex-M3 images to be build.
Comment 6 Juro Bystricky 2017-01-04 19:45:36 UTC
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