<?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>10894</bug_id>
          
          <creation_ts>2017-01-07 00:24:32 +0000</creation_ts>
          <short_desc>Zephyr BOARD value in local.conf is ignored</short_desc>
          <delta_ts>2017-01-23 20:28:57 +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>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.3 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Henry Bruce">henry.bruce</reporter>
          <assigned_to name="Juro Bystricky">juro.bystricky</assigned_to>
          
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>69609</commentid>
    <comment_count>0</comment_count>
    <who name="Henry Bruce">henry.bruce</who>
    <bug_when>2017-01-07 00:24:32 +0000</bug_when>
    <thetext>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 = \&quot;zephyr\&quot; &gt; conf/local.conf
$ echo BOARD = \&quot;arduino_101\&quot; &gt; 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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69630</commentid>
    <comment_count>1</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2017-01-09 18:15:24 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69696</commentid>
    <comment_count>2</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2017-01-10 23:01:36 +0000</bug_when>
    <thetext>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 &quot;-&quot; to &quot;_&quot;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70045</commentid>
    <comment_count>3</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2017-01-23 20:28:57 +0000</bug_when>
    <thetext>meta-zephyr:
https://git.yoctoproject.org/cgit/cgit.cgi/meta-zephyr/commit/?id=7c3f7c10de57ae4f4add938fa5188095c5230a69</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>