Bug 10656 - Support for out-of-tree development of Zephyr images
Summary: Support for out-of-tree development of Zephyr images
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+ enhancement
Target Milestone: 2.3 M2
Assignee: Juro Bystricky
QA Contact: Jair Gonzalez
URL:
Whiteboard:
Depends on: 10655
Blocks:
  Show dependency tree
 
Reported: 2016-11-14 23:11 UTC by Juro Bystricky
Modified: 2017-01-17 14:04 UTC (History)
1 user (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Yes (doc changes required)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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