samples: Create a zephyr sample
Most of the meat of this is in the Makefile, which is able to build the
bootloader, and two small applications, along with instructions on how
to load these into flash and test that upgrades work.
JIRA: MCUB-62
Signed-off-by: David Brown <david.brown@linaro.org>
diff --git a/samples/zephyr/build-hello.sh b/samples/zephyr/build-hello.sh
new file mode 100755
index 0000000..d8a3af4
--- /dev/null
+++ b/samples/zephyr/build-hello.sh
@@ -0,0 +1,22 @@
+#! /bin/bash
+
+# Build the Sample hello program
+
+# In order to build successfully, ZEPHYR_SDK_INSTALL_DIR and
+# ZEPHYR_GCC_VARIANT need to be set, as well as zephyr/zephyr-env.sh
+# must be sourced.
+
+die() {
+ echo error: "$@"
+ exit 1
+}
+
+if [ -z "$ZEPHYR_BASE" ]; then
+ die "Please setup for a Zephyr build before running this script."
+fi
+
+if [ -z "$BOARD" ]; then
+ die "Please set BOARD to a valid board before running this script."
+fi
+
+make -C hello1 BOARD=${BOARD} -j$(nproc) || die "Build hello1"