mirror of
https://git.yoctoproject.org/meta-zephyr
synced 2026-01-29 21:58:41 +01:00
meta-zephyr: basic upgrade
Numerous changes to allow building and running various
Zephyr tests using Zephyr release 1.6 and Yocto master distro
(commit 3676601335b4673e3572d5a9987a351f0bb44bcb and later)
Work in progress.
Notable changes:
1. Zephyr 1.6 does not support the concept of nano and micro kernel
anymore.
2. Location of various tests have changed
3. Changes due to subtle python3/python2 differences
4. Zephyr Makefile changes (including renaming)
5. Improved failed test detection
6. Remove patch files no longer needed
With these changes, it is now possible to run Zephyr test suite and
Zephyr sample programs. Currently only x86 CPUs are supported, with
additional CPU support coming in the near future, in particular
support for ARM Cortex-M3 CPUs
Prerequisites:
Modify local conf by adding:
DISTRO="zephyr"
MACHINE?="qemux86"
Modify bblayers.conf by adding "meta-zephyr" to BBLAYERS
To build all Zephyr tests:
$ bitbake zephyr-kernel-test-all
To test all built test images:
$ bitbake zephyr-kernel-test-all -ctestimage
You can also build and test an individual test. This is done by appending
the actual test name to the "zephyr-kernel-test", for example:
$ bitbake zephyr-kernel-test-test_sleep
$ bitbake zephyr-kernel-test-test_sleep -ctestimage
It is also possible to build Zephyr sample programs. Included is a sample recipe
that builds the Zephyr "philosophers" sample:
$ bitbake zephyr-philosophers
Once built, you can run the created "philosophers" image in qemu (at this point
the various paths have to be entered manually):
$ ./tmp/sysroots/x86_64-linux/usr/bin/qemu-system-i386 \
-kernel ./tmp/deploy/images/qemux86/philosophers.elf \
-nographic -machine type=pc-0.14 -display none -clock dynticks \
-no-acpi -balloon none
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
This commit is contained in:
@@ -6,18 +6,16 @@ python zephyrtest_virtclass_handler () {
|
||||
# ipk doesn't like underscores in pacakges names. So just use dashes
|
||||
# for PN and the image name.
|
||||
variant_dashes = variant.replace('_', '-')
|
||||
|
||||
pn = e.data.getVar("PN", True) + "-" + variant_dashes
|
||||
pn_underscores = e.data.getVar("PN", True) + "-" + variant
|
||||
|
||||
# kerneltype should be micro or nano
|
||||
kerneltype = pn.replace(variant_dashes, '').rsplit('-', 2)[1]
|
||||
e.data.setVar("PN", pn)
|
||||
e.data.setVar("ZEPHYR_IMAGENAME", "test_" + variant_dashes + '-' + kerneltype + ".elf")
|
||||
e.data.setVar("ZEPHYR_IMAGE_SRCDIR", "samples/" + kerneltype + "kernel/test/test_" + variant)
|
||||
if kerneltype == "micro":
|
||||
e.data.setVar("ZEPHYR_MAKE_OUTPUT", "microkernel.elf")
|
||||
else:
|
||||
e.data.setVar("ZEPHYR_MAKE_OUTPUT", "nanokernel.elf")
|
||||
e.data.setVar("ZEPHYR_IMAGENAME", "test_" + variant_dashes + ".elf")
|
||||
|
||||
# Most tests for Zephyr 1.6 are in the "legacy" folder
|
||||
e.data.setVar("ZEPHYR_IMAGE_SRCDIR", "tests/legacy/kernel/" + variant)
|
||||
e.data.setVar("ZEPHYR_MAKE_OUTPUT", "zephyr.elf")
|
||||
|
||||
# Allow to build using both foo-some_test form as well ass foo-some-test
|
||||
e.data.setVar("PROVIDES", e.data.getVar("PROVIDES", True) + pn_underscores)
|
||||
|
||||
@@ -8,3 +8,9 @@ BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
|
||||
BBFILE_COLLECTIONS += "zephyr"
|
||||
BBFILE_PATTERN_zephyr = "^${LAYERDIR}/"
|
||||
BBFILE_PRIORITY_zephyr = "6"
|
||||
|
||||
# This should only be incremented on significant changes that will
|
||||
# cause compatibility issues with other layers
|
||||
LAYERVERSION_zephyr = "1"
|
||||
|
||||
LAYERDEPENDS_zephyr = "core"
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
# Enable other layers to have modules in the same named directory
|
||||
from pkgutil import extend_path
|
||||
__path__ = extend_path(__path__, __name__)
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2013 Intel Corporation
|
||||
# Copyright (C) 2013-2016 Intel Corporation
|
||||
#
|
||||
# Released under the MIT license (see COPYING.MIT)
|
||||
|
||||
@@ -17,7 +17,6 @@ class QemuTargetZephyr(QemuTarget):
|
||||
def __init__(self, d):
|
||||
|
||||
super(QemuTarget, self).__init__(d)
|
||||
|
||||
self.qemulog = os.path.join(self.testdir, "qemu_boot_log.%s" % self.datetime)
|
||||
dump_target_cmds = d.getVar("testimage_dump_target", True)
|
||||
dump_host_cmds = d.getVar("testimage_dump_host", True)
|
||||
@@ -28,6 +27,7 @@ class QemuTargetZephyr(QemuTarget):
|
||||
|
||||
# Log QemuRunner log output to a file
|
||||
import oe.path
|
||||
from oeqa.utils.qemuzephyrrunner import QemuZephyrRunner
|
||||
bb.utils.mkdirhier(self.testdir)
|
||||
self.qemurunnerlog = os.path.join(self.testdir, 'qemurunner_log.%s' % self.datetime)
|
||||
logger = logging.getLogger('BitBake.QemuRunner')
|
||||
@@ -35,7 +35,6 @@ class QemuTargetZephyr(QemuTarget):
|
||||
loggerhandler.setFormatter(logging.Formatter("%(levelname)s: %(message)s"))
|
||||
logger.addHandler(loggerhandler)
|
||||
oe.path.symlink(os.path.basename(self.qemurunnerlog), os.path.join(self.testdir, 'qemurunner_log'), force=True)
|
||||
|
||||
self.runner = QemuZephyrRunner(machine=d.getVar("MACHINE", True),
|
||||
rootfs=self.rootfs,
|
||||
tmpdir = d.getVar("TMPDIR", True),
|
||||
|
||||
@@ -3,14 +3,21 @@ from oeqa.oetest import oeRuntimeTest
|
||||
|
||||
class ZephyrTest(oeRuntimeTest):
|
||||
|
||||
def test_boot_tiny(self):
|
||||
def test_boot_zephyr(self):
|
||||
success = False
|
||||
logfile = self.target.wait_for_serial(300, 30)
|
||||
logfile = self.target.wait_for_serial(180, 30)
|
||||
|
||||
with open(logfile) as f:
|
||||
for line in f:
|
||||
# All good
|
||||
if "PROJECT EXECUTION SUCCESSFUL" in line:
|
||||
success = True
|
||||
break
|
||||
# Most likely cause for faults is incorrectly compiled code
|
||||
if "***** USAGE FAULT *****" in line:
|
||||
success = False
|
||||
self.assertTrue(success, msg='***** USAGE FAULT *****" in file:///%s' % logfile)
|
||||
break
|
||||
|
||||
self.assertTrue(success, msg='"PROJECT EXECUTION SUCCESSFUL" not in %s' % logfile)
|
||||
# test program finished, complain if no success message
|
||||
self.assertTrue(success, msg='"PROJECT EXECUTION SUCCESSFUL" not in file:///%s' % logfile)
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
# Enable other layers to have modules in the same named directory
|
||||
from pkgutil import extend_path
|
||||
__path__ = extend_path(__path__, __name__)
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2015 Intel Corporation
|
||||
# Copyright (C) 2015-2016 Intel Corporation
|
||||
#
|
||||
# Released under the MIT license (see COPYING.MIT)
|
||||
|
||||
@@ -13,35 +13,43 @@ import socket
|
||||
import select
|
||||
import bb
|
||||
import tempfile
|
||||
from qemurunner import QemuRunner
|
||||
from oeqa.utils.qemurunner import QemuRunner
|
||||
|
||||
class QemuZephyrRunner(QemuRunner):
|
||||
|
||||
def __init__(self, machine, rootfs, display, tmpdir, deploy_dir_image, logfile, kernel, boottime):
|
||||
QemuRunner.__init__(self, machine, rootfs, display, tmpdir,
|
||||
deploy_dir_image, logfile, boottime, None,
|
||||
None)
|
||||
None, True)
|
||||
|
||||
# Popen object for runqemu
|
||||
self.socketfile = tempfile.NamedTemporaryFile()
|
||||
self.runqemu = None
|
||||
self.socketname = self.socketfile.name
|
||||
self.server_socket = None
|
||||
self.kernel = kernel
|
||||
|
||||
def create_socket(self):
|
||||
tries = 3
|
||||
bb.note("waiting at most %s seconds for qemu pid" % self.runqemutime)
|
||||
tries = self.runqemutime
|
||||
while tries > 0:
|
||||
time.sleep(1)
|
||||
try:
|
||||
self.server_socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
||||
self.server_socket.connect(self.socketname)
|
||||
bb.note("Created listening socket for qemu serial console.")
|
||||
tries = 0
|
||||
except socket.error, msg:
|
||||
break
|
||||
|
||||
except socket.error:
|
||||
self.server_socket.close()
|
||||
bb.error("Failed to create listening socket %s: %s" % (self.socketname, msg))
|
||||
tries -= 1
|
||||
|
||||
def start(self, qemuparams = None):
|
||||
if tries == 0:
|
||||
bb.error("Failed to create listening socket %s: " % (self.socketname))
|
||||
return False
|
||||
return True
|
||||
|
||||
def start(self, qemuparams = None, get_ip = True, extra_bootparams = None):
|
||||
|
||||
if not os.path.exists(self.tmpdir):
|
||||
bb.error("Invalid TMPDIR path %s" % self.tmpdir)
|
||||
@@ -75,12 +83,12 @@ class QemuZephyrRunner(QemuRunner):
|
||||
self.runqemu = subprocess.Popen(launch_cmd,shell=True,stdout=subprocess.PIPE,stderr=subprocess.STDOUT,preexec_fn=os.setpgrp)
|
||||
|
||||
#
|
||||
# We need the preexec_fn above so that all runqemu processes can easily be killed
|
||||
# We need the preexec_fn above so that all runqemu processes can easily be killed
|
||||
# (by killing their process group). This presents a problem if this controlling
|
||||
# process itself is killed however since those processes don't notice the death
|
||||
# process itself is killed however since those processes don't notice the death
|
||||
# of the parent and merrily continue on.
|
||||
#
|
||||
# Rather than hack runqemu to deal with this, we add something here instead.
|
||||
# Rather than hack runqemu to deal with this, we add something here instead.
|
||||
# Basically we fork off another process which holds an open pipe to the parent
|
||||
# and also is setpgrp. If/when the pipe sees EOF from the parent dieing, it kills
|
||||
# the process group. This is like pctrl's PDEATHSIG but for a process group
|
||||
@@ -101,16 +109,7 @@ class QemuZephyrRunner(QemuRunner):
|
||||
sys.exit(0)
|
||||
|
||||
bb.note("qemu started, pid is %s" % self.runqemu.pid)
|
||||
#Hack to wait for socket to show up because I'm tired
|
||||
time.sleep(5)
|
||||
self.create_socket()
|
||||
|
||||
return True
|
||||
|
||||
def is_alive(self):
|
||||
if not self.runqemu:
|
||||
return False
|
||||
return True
|
||||
return self.create_socket()
|
||||
|
||||
def wait_for_serial(self, func_timeout, data_timeout):
|
||||
stopread = False
|
||||
|
||||
@@ -1,32 +1,26 @@
|
||||
From 6f6f75cae61750e104d9601d4060e4cd782bd217 Mon Sep 17 00:00:00 2001
|
||||
From: Randy Witt <randy.e.witt@linux.intel.com>
|
||||
Date: Thu, 10 Sep 2015 11:08:14 -0700
|
||||
Subject: [PATCH 1/3] Makefile.toolchain.yocto: Don't error out if
|
||||
CROSS_COMPILE is set
|
||||
|
||||
If CROSS_COMPILE is set, that means the user is trying to specify the
|
||||
compiler manually. So don't error out when YOCTO_SDK_INSTALL_DIR isn't
|
||||
set but CROSS_COMPILE is set.
|
||||
|
||||
Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
|
||||
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
|
||||
---
|
||||
scripts/Makefile.toolchain.yocto | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/scripts/Makefile.toolchain.yocto b/scripts/Makefile.toolchain.yocto
|
||||
index cf6918e..77b1a12 100644
|
||||
--- a/scripts/Makefile.toolchain.yocto
|
||||
+++ b/scripts/Makefile.toolchain.yocto
|
||||
@@ -1,6 +1,8 @@
|
||||
diff --git a/scripts/Makefile.toolchain.zephyr b/scripts/Makefile.toolchain.zephyr
|
||||
index b964abf..69093f3 100644
|
||||
--- a/scripts/Makefile.toolchain.zephyr
|
||||
+++ b/scripts/Makefile.toolchain.zephyr
|
||||
@@ -12,6 +12,7 @@
|
||||
#
|
||||
#######################################################################
|
||||
|
||||
+ifndef CROSS_COMPILE
|
||||
ifndef YOCTO_SDK_INSTALL_DIR
|
||||
-$(error YOCTO_SDK_INSTALL_DIR is not set)
|
||||
+ $(error YOCTO_SDK_INSTALL_DIR is not set)
|
||||
+endif
|
||||
endif
|
||||
REQUIRED_SDK_VER=0.8.2
|
||||
|
||||
# arm
|
||||
--
|
||||
2.4.3
|
||||
|
||||
ifndef ZEPHYR_SDK_INSTALL_DIR
|
||||
@@ -25,6 +26,7 @@ ifeq ($(SDK_CHECK),1)
|
||||
$(error (The SDK version you are using is old, please update your SDK. You need at least SDK version $(REQUIRED_SDK_VER)))
|
||||
endif
|
||||
endif
|
||||
+endif
|
||||
|
||||
ifeq ($(HOST_OS),MINGW)
|
||||
TOOLCHAIN_HOME = ${ZEPHYR_SDK_INSTALL_DIR}/sysroots/i686-pokysdk-mingw32
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
From 9c5edc055897c4acc365e8cf874ab2664a68d7ea Mon Sep 17 00:00:00 2001
|
||||
From: Randy Witt <randy.e.witt@linux.intel.com>
|
||||
Date: Thu, 10 Sep 2015 11:10:18 -0700
|
||||
Subject: [PATCH 2/3] zephyr-env.sh: Work with zsh
|
||||
|
||||
Without this change ZEPHYR_BASE won't be set up properly when using zsh.
|
||||
This makes it so the path of the zephyr-env.sh is found sucessfully when
|
||||
using zsh.
|
||||
|
||||
Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
|
||||
---
|
||||
zephyr-env.sh | 8 +++++++-
|
||||
1 file changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/zephyr-env.sh b/zephyr-env.sh
|
||||
index e62d8e2..971be8d 100644
|
||||
--- a/zephyr-env.sh
|
||||
+++ b/zephyr-env.sh
|
||||
@@ -9,7 +9,13 @@ fi
|
||||
# run (if it exists) by this script.
|
||||
|
||||
# identify OS source tree root directory
|
||||
-export ZEPHYR_BASE=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
+if [ -n "$BASH_SOURCE" ]; then
|
||||
+ export ZEPHYR_BASE="`dirname $BASH_SOURCE`"
|
||||
+elif [ -n "$ZSH_NAME" ]; then
|
||||
+ export ZEPHYR_BASE="`dirname $0`"
|
||||
+else
|
||||
+ export ZEPHYR_BASE="`pwd`"
|
||||
+fi
|
||||
|
||||
scripts_path=${ZEPHYR_BASE}/scripts
|
||||
echo "${PATH}" | grep -q "${scripts_path}"
|
||||
--
|
||||
2.4.3
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
From b7e1267f98a7ee7e571afa919a0489b4e2cc92f7 Mon Sep 17 00:00:00 2001
|
||||
From: Randy Witt <randy.e.witt@linux.intel.com>
|
||||
Date: Thu, 10 Sep 2015 11:12:29 -0700
|
||||
Subject: [PATCH 3/3] zephyr-env.sh: Don't wait to test for error condition
|
||||
|
||||
Previously if a user had done "set -e" in their shell and ran this script
|
||||
it was possible that "echo "${PATH}" | grep -q "${scripts_path}" could
|
||||
cause the script to error out completely.
|
||||
|
||||
Instead of runnning the command then doing a test on $?, just run the
|
||||
test on the command itself.
|
||||
|
||||
Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
|
||||
---
|
||||
zephyr-env.sh | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/zephyr-env.sh b/zephyr-env.sh
|
||||
index 971be8d..a17a681 100644
|
||||
--- a/zephyr-env.sh
|
||||
+++ b/zephyr-env.sh
|
||||
@@ -18,8 +18,9 @@ else
|
||||
fi
|
||||
|
||||
scripts_path=${ZEPHYR_BASE}/scripts
|
||||
-echo "${PATH}" | grep -q "${scripts_path}"
|
||||
-[ $? != 0 ] && export PATH=${scripts_path}:${PATH}
|
||||
+if ! echo "${PATH}" | grep -q "${scripts_path}"; then
|
||||
+ export PATH=${scripts_path}:${PATH}
|
||||
+fi
|
||||
unset scripts_path
|
||||
|
||||
# enable custom environment settings
|
||||
--
|
||||
2.4.3
|
||||
|
||||
@@ -6,22 +6,25 @@ inherit deploy
|
||||
INHIBIT_DEFAULT_DEPS = "1"
|
||||
DEPENDS += "gcc-cross-${TARGET_ARCH} libgcc"
|
||||
|
||||
export ZEPHYR_GCC_VARIANT="yocto"
|
||||
export ZEPHYR_GCC_VARIANT="zephyr"
|
||||
|
||||
LIB_INCLUDE_DIR = "-L`dirname \`$CC -print-libgcc-file-name\``"
|
||||
CROSS_COMPILE = "${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}"
|
||||
QEMU_BIN_PATH = "${STAGING_BINDIR_NATIVE}"
|
||||
|
||||
PLATFORM_CONFIG_arm = "basic_cortex_m3"
|
||||
ARCH_arm = "${TRANSLATED_TARGET_ARCH}"
|
||||
ARCH_x86 = "x86"
|
||||
|
||||
OE_TERMINAL_EXPORTS += "CROSS_COMPILE"
|
||||
OE_TERMINAL_EXPORTS += "PLATFORM_CONFIG"
|
||||
OE_TERMINAL_EXPORTS += "BOARD"
|
||||
OE_TERMINAL_EXPORTS += "ARCH"
|
||||
|
||||
BOARD_arm ?= "qemu_cortex_m3"
|
||||
BOARD_x86 ?= "qemu_x86"
|
||||
|
||||
# oe_runmake isn't used because of the make -e causing issues with some
|
||||
# make variables.
|
||||
MAKE_COMMAND = "make -j V=1 ARCH=${ARCH} PLATFORM_CONFIG=${PLATFORM_CONFIG} CROSS_COMPILE=${CROSS_COMPILE} LIB_INCLUDE_DIR=${LIB_INCLUDE_DIR}"
|
||||
MAKE_COMMAND = "make -j V=1 BOARD=${BOARD} ARCH=${ARCH} CROSS_COMPILE=${CROSS_COMPILE} LIB_INCLUDE_DIR=${LIB_INCLUDE_DIR}"
|
||||
|
||||
do_configure[noexec] = "1"
|
||||
|
||||
@@ -39,13 +42,15 @@ python () {
|
||||
# oe_runmake isn't used because of the make -e causing issues with some
|
||||
# make variables.
|
||||
do_compile () {
|
||||
source ${S}/zephyr-env.sh
|
||||
cd ${S}
|
||||
export ZEPHYR_BASE=${S}
|
||||
#source ${S}/zephyr-env.sh
|
||||
|
||||
${MAKE_COMMAND} -C ${ZEPHYR_IMAGE_SRCDIR} pristine
|
||||
#${MAKE_COMMAND} -C ${ZEPHYR_IMAGE_SRCDIR} pristine
|
||||
${MAKE_COMMAND} -C ${ZEPHYR_IMAGE_SRCDIR}
|
||||
}
|
||||
|
||||
do_deploy () {
|
||||
install -D ${ZEPHYR_IMAGE_SRCDIR}/outdir/${ZEPHYR_MAKE_OUTPUT} ${DEPLOYDIR}/${ZEPHYR_IMAGENAME}
|
||||
install -D ${ZEPHYR_IMAGE_SRCDIR}/outdir/${BOARD}/${ZEPHYR_MAKE_OUTPUT} ${DEPLOYDIR}/${ZEPHYR_IMAGENAME}
|
||||
}
|
||||
addtask deploy after do_compile
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
LICENSE = "CLOSED"
|
||||
INHIBIT_DEFAULT_DEPS = "1"
|
||||
|
||||
require zephyr-kernel-test-micro.inc
|
||||
require zephyr-kernel-test-nano.inc
|
||||
require zephyr-kernel-test.inc
|
||||
|
||||
addtask testimage
|
||||
deltask configure
|
||||
@@ -13,8 +12,7 @@ do_testimage () {
|
||||
:
|
||||
}
|
||||
|
||||
do_testimage[depends] = '${@" ".join(["zephyr-kernel-test-micro-" + x + ":do_testimage" for x in d.getVar("ZEPHYRMICROTESTS", True).split()])}'
|
||||
do_testimage[depends] += '${@" ".join(["zephyr-kernel-test-nano-" + x + ":do_testimage" for x in d.getVar("ZEPHYRNANOTESTS", True).split()])}'
|
||||
do_testimage[depends] = '${@" ".join(["zephyr-kernel-test-" + x + ":do_testimage" for x in d.getVar("ZEPHYRTESTS", True).split()])}'
|
||||
|
||||
do_build[depends] = '${@" ".join(["zephyr-kernel-test-" + x + ":do_build" for x in d.getVar("ZEPHYRTESTS", True).split()])}'
|
||||
|
||||
do_build[depends] = '${@" ".join(["zephyr-kernel-test-micro-" + x + ":do_build" for x in d.getVar("ZEPHYRMICROTESTS", True).split()])}'
|
||||
do_build[depends] += '${@" ".join(["zephyr-kernel-test-nano-" + x + ":do_build" for x in d.getVar("ZEPHYRNANOTESTS", True).split()])}'
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
# libs
|
||||
ZEPHYRMICROTESTS_remove_arm = "tickless fp_sharing static_idt"
|
||||
|
||||
ZEPHYRMICROTESTS_arc = ""
|
||||
|
||||
ZEPHYRMICROTESTS = "critical fifo map pipe sprintf static_idt task_irq timer events fp_sharing mail mutex pool sema stackprot task tickless xip"
|
||||
@@ -1,4 +0,0 @@
|
||||
require zephyr-image.inc
|
||||
require zephyr-kernel-test-nano.inc
|
||||
|
||||
BBCLASSEXTEND = '${@" ".join(["zephyrtest:" + x for x in d.getVar("ZEPHYRNANOTESTS", True).split()])}'
|
||||
@@ -1,5 +0,0 @@
|
||||
|
||||
ZEPHYRNANOTESTS_arm += "arm_m3_irq_vector_table"
|
||||
ZEPHYRNANOTESTS_arc = ""
|
||||
|
||||
ZEPHYRNANOTESTS += "fp_sharing stack timer context lifo stackprot xip fifo sema static_idt"
|
||||
@@ -1,7 +1,7 @@
|
||||
require zephyr-image.inc
|
||||
require zephyr-kernel-test-micro.inc
|
||||
require zephyr-kernel-test.inc
|
||||
|
||||
BBCLASSEXTEND = '${@" ".join(["zephyrtest:" + x for x in d.getVar("ZEPHYRMICROTESTS", True).split()])}'
|
||||
BBCLASSEXTEND = '${@" ".join(["zephyrtest:" + x for x in d.getVar("ZEPHYRTESTS", True).split()])}'
|
||||
|
||||
|
||||
|
||||
48
recipes-kernel/zephyr-kernel/zephyr-kernel-test.inc
Normal file
48
recipes-kernel/zephyr-kernel/zephyr-kernel-test.inc
Normal file
@@ -0,0 +1,48 @@
|
||||
|
||||
ZEPHYRTESTS_remove = "test_static_idt test_fifo test_fp_sharing \
|
||||
test_sema test_stackprot test_obj_tracing test_stack \
|
||||
test_tickless test_timer"
|
||||
|
||||
#TBD
|
||||
ZEPHYRTESTS_remove_arm += ""
|
||||
|
||||
#Remove ARM specific tests
|
||||
ZEPHYRTESTS_remove_x86 += "test_context test_arm_irq_vector_table"
|
||||
|
||||
# List of all available tests
|
||||
ZEPHYRTESTS = " \
|
||||
test_arm_irq_vector_table \
|
||||
test_context \
|
||||
test_critical \
|
||||
test_early_sleep \
|
||||
test_errno \
|
||||
test_events \
|
||||
test_fifo \
|
||||
test_fifo_priv \
|
||||
test_fp_sharing \
|
||||
test_irq_offload \
|
||||
test_libs \
|
||||
test_lifo \
|
||||
test_mail \
|
||||
test_mail_priv \
|
||||
test_map \
|
||||
test_map_priv \
|
||||
test_mem_safe \
|
||||
test_mutex \
|
||||
test_nano_work \
|
||||
test_obj_tracing \
|
||||
test_pend \
|
||||
test_pipe \
|
||||
test_pipe_priv \
|
||||
test_pool \
|
||||
test_sema \
|
||||
test_sema_priv \
|
||||
test_sleep \
|
||||
test_stack \
|
||||
test_stackprot \
|
||||
test_static_idt \
|
||||
test_task \
|
||||
test_task_priv \
|
||||
test_tickless \
|
||||
test_timer \
|
||||
"
|
||||
@@ -1,62 +0,0 @@
|
||||
require zephyr-kernel.inc
|
||||
|
||||
inherit deploy
|
||||
|
||||
INHIBIT_DEFAULT_DEPS = "1"
|
||||
DEPENDS += "gcc-cross-${TARGET_ARCH} libgcc"
|
||||
|
||||
#SRC_URI += "file://0001-defs.host-Allow-HOS_Bin-to-be-overridden.patch"
|
||||
|
||||
export ZEPHYR_GCC_VARIANT="yocto"
|
||||
|
||||
# The makefiles are explicit about the flags they want, so don't unset
|
||||
# them so zephyr flags actually get used. Should we set EXTRA_CFLAGS so our
|
||||
# additional flags get picked up?
|
||||
# This is done here rather than in the task so that things still work
|
||||
# in devshell.
|
||||
python () {
|
||||
d.delVar('CFLAGS')
|
||||
d.delVar('CXXFLAGS')
|
||||
d.delVar('LDFLAGS')
|
||||
}
|
||||
|
||||
do_configure[noexec] = "1"
|
||||
|
||||
MACRO_SUPPORT = "1"
|
||||
MACRO_SUPPORT_arc = "0"
|
||||
|
||||
LIB_INCLUDE_DIR="-L`dirname \`$CC -print-libgcc-file-name\``"
|
||||
CROSS_COMPILE="${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}"
|
||||
|
||||
# oe_runmake isn't used because of the make -e causing issues with some
|
||||
# make variables.
|
||||
MAKE_COMMAND = "make -j V=1 CROSS_COMPILE=${CROSS_COMPILE} LIB_INCLUDE_DIR=${LIB_INCLUDE_DIR}"
|
||||
|
||||
do_compile () {
|
||||
. ${S}/zephyr-env.sh
|
||||
|
||||
if [ "${MACRO_SUPPORT}" -eq "1" ]; then
|
||||
${MAKE_COMMAND} -C samples/microkernel/apps/hello_world pristine
|
||||
${MAKE_COMMAND} -C samples/microkernel/apps/hello_world
|
||||
|
||||
${MAKE_COMMAND} -C samples/microkernel/apps/philosophers pristine
|
||||
${MAKE_COMMAND} -C samples/microkernel/apps/philosophers
|
||||
fi
|
||||
|
||||
${MAKE_COMMAND} -C samples/nanokernel/apps/hello_world pristine
|
||||
${MAKE_COMMAND} -C samples/nanokernel/apps/hello_world
|
||||
|
||||
${MAKE_COMMAND} -C samples/nanokernel/apps/philosophers pristine
|
||||
${MAKE_COMMAND} -C samples/nanokernel/apps/philosophers
|
||||
}
|
||||
|
||||
do_deploy () {
|
||||
if [ "${MACRO_SUPPORT}" -eq "1" ]; then
|
||||
install -D samples/microkernel/apps/hello_world/outdir/microkernel.elf ${DEPLOYDIR}/hello_world_micro.elf
|
||||
install -D samples/microkernel/apps/philosophers/outdir/microkernel.elf ${DEPLOYDIR}/philosophers_micro.elf
|
||||
fi
|
||||
|
||||
install -D samples/nanokernel/apps/hello_world/outdir/nanokernel.elf ${DEPLOYDIR}/hello_world_nano.elf
|
||||
install -D samples/nanokernel/apps/philosophers/outdir/nanokernel.elf ${DEPLOYDIR}/philosophers_nano.elf
|
||||
}
|
||||
addtask deploy after do_compile
|
||||
@@ -1,14 +1,18 @@
|
||||
LICENSE = "CLOSED"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc"
|
||||
|
||||
# tag v1.6.0
|
||||
SRCREV="d4e799d77a36eaf6d678b357c207411ec32b2d62"
|
||||
SRC_URI = "git://gerrit.zephyrproject.org/r/zephyr.git;protocol=https;branch=v1.6.0-branch"
|
||||
SRC_URI += "file://0001-Makefile.toolchain.yocto-Don-t-error-out-if-CROSS_CO.patch"
|
||||
SRC_URI += "file://0002-zephyr-env.sh-Work-with-zsh.patch"
|
||||
SRC_URI += "file://0003-zephyr-env.sh-Don-t-wait-to-test-for-error-condition.patch"
|
||||
|
||||
# Modify these as desired
|
||||
PV = "1.0+git${SRCPV}"
|
||||
PV = "1.6.0"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
# There shouldn't be a manifest for zephyr kernels since there is no root
|
||||
# filesystem.
|
||||
IMAGE_NO_MANIFEST = "1"
|
||||
|
||||
#DEFAULTTUNE_arm = "cortexm3"
|
||||
TUNE_FEATURES_arm ="cortexm3"
|
||||
|
||||
47
recipes-kernel/zephyr-kernel/zephyr-philosophers.bb
Normal file
47
recipes-kernel/zephyr-kernel/zephyr-philosophers.bb
Normal file
@@ -0,0 +1,47 @@
|
||||
require zephyr-kernel.inc
|
||||
|
||||
inherit deploy
|
||||
|
||||
INHIBIT_DEFAULT_DEPS = "1"
|
||||
|
||||
TUNE_PKGARCH_arm = "cortexm3"
|
||||
DEPENDS += "gcc-cross-${TARGET_ARCH} libgcc"
|
||||
|
||||
export ZEPHYR_GCC_VARIANT="zephyr"
|
||||
|
||||
# The makefiles are explicit about the flags they want, so don't unset
|
||||
# them so zephyr flags actually get used. Should we set EXTRA_CFLAGS so our
|
||||
# additional flags get picked up?
|
||||
# This is done here rather than in the task so that things still work
|
||||
# in devshell.
|
||||
python () {
|
||||
d.delVar('CFLAGS')
|
||||
d.delVar('CXXFLAGS')
|
||||
d.delVar('LDFLAGS')
|
||||
}
|
||||
|
||||
do_configure[noexec] = "1"
|
||||
|
||||
BOARD_arm ?= "qemu_cortex_m3"
|
||||
BOARD_x86 ?= "qemu_x86"
|
||||
|
||||
LIB_INCLUDE_DIR="-L`dirname \`$CC -print-libgcc-file-name\``"
|
||||
CROSS_COMPILE="${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}"
|
||||
|
||||
# oe_runmake isn't used because of the make -e causing issues with some
|
||||
# make variables.
|
||||
MAKE_COMMAND = "make -j V=1 BOARD=${BOARD} CROSS_COMPILE=${CROSS_COMPILE} LIB_INCLUDE_DIR=${LIB_INCLUDE_DIR}"
|
||||
|
||||
do_compile () {
|
||||
cd ${S}
|
||||
export ZEPHYR_BASE=${S}
|
||||
${MAKE_COMMAND} -C samples/philosophers pristine
|
||||
${MAKE_COMMAND} -C samples/philosophers
|
||||
}
|
||||
|
||||
do_deploy () {
|
||||
install -D samples/philosophers/outdir/${BOARD}/zephyr.elf ${DEPLOYDIR}/philosophers.elf
|
||||
export DEPLOY_DIR_IMAGE=${DEPLOYDIR}/philosophers.elf
|
||||
}
|
||||
|
||||
addtask deploy after do_compile
|
||||
Reference in New Issue
Block a user