meta-zephyr: add support for cortexm3 toolchain

Cortex-M3 is not supported natively by oe-embedded, so we need to
do it here. With these changes it should be possible to run:

To build all Zephyr tests:
    $ MACHINE=qemuarm bitbake zephyr-kernel-test-all
    $ MACHINE=qemuarm bitbake zephyr-kernel-test-all -ctestimage

To build "philosophers" sample:
    $ MACHINE=qemuarm 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-arm \
          -kernel ./tmp/deploy/images/qemuarm/philosophers.elf \
          -cpu cortex-m3 -machine lm3s6965evb -nographic -vga none

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
This commit is contained in:
Juro Bystricky
2016-12-28 10:33:39 -08:00
parent 97643716c2
commit 1e2da74cf0
3 changed files with 23 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
DEFAULTTUNE ?= "cortexm3"
#require conf/machine/include/arm/arch-armv7a.inc
TUNEVALID[cortexm3] = "Enable Cortex-M3 specific processor optimizations"
TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'cortexm3', ' -mcpu=cortex-m3', '', d)}"
AVAILTUNES += "cortexm3"
TUNEVALID[armv7m] = "Enable Cortex-M3 specific processor optimizations"
TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'armv7m', ' -march=armv7-m', '', d)}"
MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'armv7m', 'armv7m:', '' ,d)}"
TUNE_PKGARCH_tune-cortexm3 = "cortexm3"
ARMPKGARCH_tune-cortexm3 = "armv7m"
PACKAGE_EXTRA_ARCHS_tune-cortexm3 ="cortexm3"
TUNE_FEATURES_tune-cortexm3 = "armv7m vfp cortexm3"
PACKAGE_EXTRA_ARCHS_tune-cortexm3 = "${PACKAGE_EXTRA_ARCHS_tune-armv7at} armv7m-vfp"

View File

@@ -1,4 +1,5 @@
require conf/distro/poky.conf
require conf/distro/machine/include/tune-cortexm3.inc
DISTRO = "zephyr"
DISTRO_NAME = "Zephyr"
@@ -7,3 +8,4 @@ TCLIBC = "baremetal"
TEST_TARGET = "QemuTargetZephyr"
TEST_SUITES = "zephyr"
DEFAULTTUNE_arm ?= "cortexm3"

View File

@@ -0,0 +1 @@
EXTRA_OECONF_append_armv7m = " --with-arch=armv7-m --with-mode=thumb "