From 5c3e2279283a2a4d877500056f871d33aa873d98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20J=C3=A4ger?= Date: Mon, 9 Nov 2020 17:39:37 +0100 Subject: [PATCH] Add west.yml to use native Zephyr build system properly --- .gitignore | 2 +- README.md | 16 ++++++++++++++-- zephyr/.gitignore | 5 +++++ zephyr/west.yml | 20 ++++++++++++++++++++ 4 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 zephyr/west.yml diff --git a/.gitignore b/.gitignore index 91bb5d6..57be60e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,10 +3,10 @@ .gcc-flags.json .vscode/browse.vc.db* .vscode +.west html memory.map custom.ini -zephyr/build tools *.bak *_bak diff --git a/README.md b/README.md index 7846d48..66283d7 100644 --- a/README.md +++ b/README.md @@ -48,9 +48,21 @@ It is suggested to use Visual Studio Code and PlatformIO for firmware developmen ### Native Zephyr environment -You can also use the Zephyr build system directly for advanced configuration using `menuconfig` or if you need more recently added features. +You can also use the Zephyr build system directly for advanced configuration with `menuconfig` or if you need more recently added features. -The CMake entry point is in the `zephyr` subfolder, so you need to run `west` command in that directory. +This guide assumes you have already installed the Zephyr SDK and the west tool according to the [Zephyr documentation](https://docs.zephyrproject.org/latest/getting_started/). Also make sure that `west` is at least at version `0.8.0`. + +Now after you cloned the repository (see above), go into the root firmware directory and initialize a west workspace: + + west init -l zephyr + +This command will create a `.west/config` file and set up the repository as specified in `zephyr/west.yml` file. Afterwards the following command pulls the Zephyr source and all necessary modules, which might take a while: + + west update + +The CMake entry point is in the `zephyr` subfolder, so you need to run `west build` and `west flash` command in that directory. + + cd zephyr Initial board selection (see `boards subfolder for correct names): diff --git a/zephyr/.gitignore b/zephyr/.gitignore index 15dfe17..0b28f71 100644 --- a/zephyr/.gitignore +++ b/zephyr/.gitignore @@ -7,3 +7,8 @@ prj_*.conf # alternative location for custom DTS overlays or conf files boards* + +# folders generated by west +build +modules +rtos diff --git a/zephyr/west.yml b/zephyr/west.yml new file mode 100644 index 0000000..67e556d --- /dev/null +++ b/zephyr/west.yml @@ -0,0 +1,20 @@ +manifest: + remotes: + - name: zephyrproject-rtos + url-base: https://github.com/zephyrproject-rtos + - name: libresolar + url-base: https://github.com/LibreSolar + projects: + - name: zephyr + remote: libresolar + revision: v2.4-branch + # path must be something else than zephyr as we get a Kconfig include recursion otherwise + path: rtos + import: + # main zephyr modules should be placed in here into zephyr subdirectory + path-prefix: zephyr + # only get modules we actually need + name-whitelist: + - cmsis + - edtt + - hal_stm32