Bug 10894 - Zephyr BOARD value in local.conf is ignored
Summary: Zephyr BOARD value in local.conf is ignored
Status: RESOLVED FIXED
Alias: None
Product: Other YP Layers
Classification: Build System, Metadata & Runtime
Component: meta-zephyr (show other bugs)
Version: 2.3
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 2.3 M2
Assignee: Juro Bystricky
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2017-01-07 00:24 UTC by Henry Bruce
Modified: 2017-01-23 20:28 UTC (History)
0 users

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Henry Bruce 2017-01-07 00:24:32 UTC
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
Comment 1 Juro Bystricky 2017-01-09 18:15:24 UTC
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.
Comment 2 Juro Bystricky 2017-01-10 23:01:36 UTC
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 "_")