diff --git a/.gitignore b/.gitignore
index e65e6e698..ff1c5a4e8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,4 @@
# editors
-.vscode
*.swp
*~
@@ -8,3 +7,8 @@
# build
/build*
+
+# zephyr
+/zephyr*
+
+/modules*
\ No newline at end of file
diff --git a/.gitpod.yml b/.gitpod.yml
new file mode 100644
index 000000000..bb11a07c9
--- /dev/null
+++ b/.gitpod.yml
@@ -0,0 +1,31 @@
+image:
+ file: .gitpod/.gitpod.Dockerfile
+
+#Initialize west workspace inside of the repository cloned by gitpod
+tasks:
+ - name: West Init
+ init: |
+ sudo cp -R /workaround/zephyr/ $GITPOD_REPO_ROOT/
+ sudo cp -R /workaround/modules/ $GITPOD_REPO_ROOT/
+ sudo cp -R /workaround/golioth/ $GITPOD_REPO_ROOT/
+ sudo west update
+
+
+github:
+ prebuilds:
+ # enable for the master/default branch (defaults to true)
+ master: true
+ # enable for all branches in this repo (defaults to false)
+ branches: true
+ # enable for pull requests coming from this repo (defaults to true)
+ pullRequests: true
+ # enable for pull requests coming from forks (defaults to false)
+ pullRequestsFromForks: true
+ # add a check to pull requests (defaults to true)
+ addCheck: true
+ # add a "Review in Gitpod" button as a comment to pull requests (defaults to false)
+ addComment: false
+ # add a "Review in Gitpod" button to the pull request's description (defaults to false)
+ addBadge: true
+ # add a label once the prebuild is ready to pull requests (defaults to false)
+ addLabel: true
\ No newline at end of file
diff --git a/.gitpod/.gitpod.Dockerfile b/.gitpod/.gitpod.Dockerfile
new file mode 100644
index 000000000..b3c1459af
--- /dev/null
+++ b/.gitpod/.gitpod.Dockerfile
@@ -0,0 +1,24 @@
+FROM zephyrprojectrtos/zephyr-build:v0.20.0
+
+USER root
+
+### Gitpod user ###
+# https://community.gitpod.io/t/how-to-resolve-password-issue-in-sudo-mode-for-custom-image/2395
+#
+# '-l': see https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#user
+RUN useradd -l -u 33333 -G sudo -md /home/gitpod -s /bin/bash -p gitpod gitpod \
+ # passwordless sudo for users in the 'sudo' group
+ && sed -i.bkp -e 's/%sudo\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%sudo ALL=NOPASSWD:ALL/g' /etc/sudoers
+
+RUN apt-get update && apt-get install -y libncurses5
+
+
+USER gitpod
+# Zephyr SDK
+RUN mkdir /workaround
+ENV ZEPHYR_SDK_INSTALL_DIR=/opt/toolchains/zephyr-sdk-0.13.1
+ENV PATH="/opt/toolchains/gcc-arm-none-eabi-10-2020-q4-major/bin:${PATH}"
+RUN git clone --branch gitpod https://github.com/golioth/example-application.git /workaround
+WORKDIR /workaround
+RUN west update
+USER root
\ No newline at end of file
diff --git a/.vscode/launch.json b/.vscode/launch.json
new file mode 100644
index 000000000..549fb41f6
--- /dev/null
+++ b/.vscode/launch.json
@@ -0,0 +1,20 @@
+{
+ // Use IntelliSense to learn about possible attributes.
+ // Hover to view descriptions of existing attributes.
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "name": "(gdb-remote) Debug",
+ "type": "cortex-debug",
+ "request": "launch",
+ "servertype": "external",
+ "device":"nRF9160_xxAA",
+ "interface": "swd",
+ "cwd": "${workspaceRoot}",
+ "runToMain": true,
+ "executable": "${workspaceRoot}/build/zephyr/zephyr.elf",
+ "gdbTarget": "localhost:2331",
+ }
+ ]
+}
\ No newline at end of file
diff --git a/.west/config b/.west/config
new file mode 100644
index 000000000..9bb3595a6
--- /dev/null
+++ b/.west/config
@@ -0,0 +1,7 @@
+[manifest]
+path = .
+file = app-manifest.west.yml
+
+[zephyr]
+base = zephyr
+
diff --git a/README.md b/README.md
index 8e7821a32..8554e6209 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,8 @@
+
+[](https://gitpod.io/from-referrer/)
+
+----
+
# Zephyr Example Application
This repository contains a Zephyr example application. The main purpose of this
@@ -10,25 +15,21 @@ applications. Some of the features demonstrated in this example are:
- Out-of-tree [drivers][drivers]
- Example CI configuration (using Github Actions)
-This repository is versioned together with the [Zephyr main tree][zephyr]. This
-means that every time that Zephyr is tagged, this repository is tagged as well
-with the same version number, and the [manifest](west.yml) entry for `zephyr`
-will point to the corresponding Zephyr tag. For example, `example-application`
-v2.6.0 will point to Zephyr v2.6.0. Note that the `main` branch will always
-point to the development branch of Zephyr, also `main`.
[board_porting]: https://docs.zephyrproject.org/latest/guides/porting/board_porting.html
[bindings]: https://docs.zephyrproject.org/latest/guides/dts/bindings.html
[drivers]: https://docs.zephyrproject.org/latest/reference/drivers/index.html
[zephyr]: https://github.com/zephyrproject-rtos/zephyr
-## Getting Started
+
-Before getting started, make sure you have a proper Zephyr development
-environment. You can follow the official
-[Zephyr Getting Started Guide](https://docs.zephyrproject.org/latest/getting_started/index.html).
+# Getting Started
-### Initialization
+We reccomend using the provided gitpod workspace template to get started. (Click the button at the top of this readme) Unless of course you are the type of masochist who likes to build houses made from cards.
+
+
+
+# Initialization
The first step is to initialize the workspace folder (``my-workspace``) where
the ``example-application`` and all Zephyr modules will be cloned. You can do
@@ -42,7 +43,9 @@ cd my-workspace
west update
```
-### Build & Run
+
+
+# Build & Run
The application can be built by running:
diff --git a/app-manifest.west.yml b/app-manifest.west.yml
new file mode 100644
index 000000000..2fcf628c4
--- /dev/null
+++ b/app-manifest.west.yml
@@ -0,0 +1,15 @@
+# Copyright (c) 2021 Nordic Semiconductor ASA
+# SPDX-License-Identifier: Apache-2.0
+
+manifest:
+ projects:
+ - name: zephyr
+ revision: v2.7-branch
+ url: https://github.com/zephyrproject-rtos/zephyr.git
+ import: true
+
+ - name: golioth
+ revision: main
+ url: https://github.com/golioth/zephyr-sdk.git
+ import: true
+
diff --git a/app/src/main.c b/app/src/main.c
index 6663a4319..aa68e4568 100644
--- a/app/src/main.c
+++ b/app/src/main.c
@@ -4,7 +4,7 @@
*/
#include
-#include
+//#include
#include "app_version.h"
@@ -14,34 +14,39 @@ LOG_MODULE_REGISTER(main, CONFIG_APP_LOG_LEVEL);
void main(void)
{
int ret;
- const struct device *sensor;
+ //const struct device *sensor;
printk("Zephyr Example Application %s\n", APP_VERSION_STR);
-
- sensor = DEVICE_DT_GET(DT_NODELABEL(examplesensor0));
- if (!device_is_ready(sensor)) {
- LOG_ERR("Sensor not ready");
- return;
+ while(1)
+ {
+ LOG_ERR("Board Ready");
+ //wait(100);
}
- while (1) {
- struct sensor_value val;
+ // sensor = DEVICE_DT_GET(DT_NODELABEL(examplesensor0));
+ // if (!device_is_ready(sensor)) {
+ // LOG_ERR("Sensor not ready");
+ // return;
+ // }
- ret = sensor_sample_fetch(sensor);
- if (ret < 0) {
- LOG_ERR("Could not fetch sample (%d)", ret);
- return;
- }
+ // while (1) {
+ // struct sensor_value val;
- ret = sensor_channel_get(sensor, SENSOR_CHAN_PROX, &val);
- if (ret < 0) {
- LOG_ERR("Could not get sample (%d)", ret);
- return;
- }
+ // ret = sensor_sample_fetch(sensor);
+ // if (ret < 0) {
+ // LOG_ERR("Could not fetch sample (%d)", ret);
+ // return;
+ // }
- printk("Sensor value: %d\n", val.val1);
+ // ret = sensor_channel_get(sensor, SENSOR_CHAN_PROX, &val);
+ // if (ret < 0) {
+ // LOG_ERR("Could not get sample (%d)", ret);
+ // return;
+ // }
- k_sleep(K_MSEC(1000));
- }
+ // printk("Sensor value: %d\n", val.val1);
+
+ // k_sleep(K_MSEC(1000));
+ // }
}
diff --git a/west.yml b/west.yml
deleted file mode 100644
index 6373e65e6..000000000
--- a/west.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright (c) 2021 Nordic Semiconductor ASA
-# SPDX-License-Identifier: Apache-2.0
-
-manifest:
- self:
- path: example-application
-
- remotes:
- - name: zephyrproject-rtos
- url-base: https://github.com/zephyrproject-rtos
-
- projects:
- - name: zephyr
- remote: zephyrproject-rtos
- revision: main
- import: true