<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>10655</bug_id>
          
          <creation_ts>2016-11-14 23:05:56 +0000</creation_ts>
          <short_desc>Add support for Zephyr</short_desc>
          <delta_ts>2017-01-17 14:04:22 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>Other YP Layers</product>
          <component>meta-zephyr</component>
          <version>2.3</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>High</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>2.3 M1</target_milestone>
          
          <blocked>10656</blocked>
    
    <blocked>10657</blocked>
    
    <blocked>10658</blocked>
    
    <blocked>10659</blocked>
    
    <blocked>10660</blocked>
    
    <blocked>10661</blocked>
    
    <blocked>10662</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Juro Bystricky">juro.bystricky</reporter>
          <assigned_to name="Juro Bystricky">juro.bystricky</assigned_to>
          <cc>jose.perez.carranza</cc>
          
          <qa_contact name="Jair Gonzalez">jair.de.jesus.gonzalez.plascencia</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Yes (doc changes required)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>68297</commentid>
    <comment_count>0</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2016-11-14 23:05:56 +0000</bug_when>
    <thetext>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 &quot;Hello World&quot; image:

$ bitbake hello-world

Probably the best way to implement this would be via a yocto supported layer &quot;meta-zephyr&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68763</commentid>
    <comment_count>1</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2016-12-01 00:37:39 +0000</bug_when>
    <thetext>The build should target Zephyr release 1.6, as this release is the first one with &quot;unified&quot; kernel (no separate micro and nano kernels anymore)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69017</commentid>
    <comment_count>2</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2016-12-10 20:08:35 +0000</bug_when>
    <thetext>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 &quot;philosophers&quot; sample.
This sample is a bit more sophisticated than &quot;hello world&quot; sample.
It is trivial to create &quot;hello world&quot; 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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69018</commentid>
    <comment_count>3</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2016-12-10 20:20:36 +0000</bug_when>
    <thetext>Also, in order to perform &quot;testimage&quot;, 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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69063</commentid>
    <comment_count>4</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2016-12-12 22:20:10 +0000</bug_when>
    <thetext>Sent notice to the yocto mailing list:
https://lists.yoctoproject.org/pipermail/yocto/2016-December/033521.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69134</commentid>
    <comment_count>5</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2016-12-14 18:36:49 +0000</bug_when>
    <thetext>I also managed to get the Cortex-M3 images to be build.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69494</commentid>
    <comment_count>6</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2017-01-04 19:45:36 +0000</bug_when>
    <thetext>A new layer &quot;meta-zephyr&quot; 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</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>