Bug 10656

Summary: Support for out-of-tree development of Zephyr images
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: Medium+ CC: jose.perez.carranza
Version: 2.3   
Target Milestone: 2.3 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Yes (doc changes required)
Bug Depends on: 10655    
Bug Blocks:    

Description Juro Bystricky 2016-11-14 23:11:51 UTC
Provide a way to build a Zephyr image using out-of-tree source code layout.
Basically, support a very common use case when user source repo is different and independent from the Zephyr kernel source repo.
Comment 1 Juro Bystricky 2016-12-14 21:02:23 UTC
meta-zephyr with all recipes is here:
https://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=juro/meta-zephyr

I created a recipe that build out-of-tree Zephyr image:
https://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=juro/meta-zephyr&id=bd9f93c322370fca2eebe0062d91e2d6572e35bd

"zephyr-getchar_git.bb"

It DEPENDS on another package, created by "zephyr-kernel-src".

https://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=juro/meta-zephyr&id=708cb54f812817b1471163b78cffd6119cd296ab

To build the image:
download meta-zephyr and add to conf/bblayers.conf
local.conf: DISTRO="zephyr"

$ MACHINE=qemuarm bitbake zephyr-getchar

It is possible to run the created Zephyr image in qemu:
./tmp/sysroots/x86_64-linux/usr/bin/qemu-system-arm -kernel ./tmp/deploy/images/qemuarm/zephyr-getchar.elf -cpu cortex-m3 -machine lm3s6965evb -nographic -vga none

The image prints out hex number of a key pressed:
char: [0x00000062] b
char: [0x0000006f] o
char: [0x0000007a] z
char: [0x0000006f] o
...
Comment 2 Juro Bystricky 2017-01-04 19:49:41 UTC
zephyr-getchar_git: sample program

located in 
git@git.yoctoproject.org/meta-zephyr