@@ -36,31 +36,37 @@ are going to create next.
3636git clone https://github.com/lf-lang/lf-west-template lf-zephyr-workspace && cd lf-zephyr-workspace
3737```
3838
39- 2 . Setup and activate a virtual environment
39+ 2 . Setup the virtual environment
4040```
4141python3 -m venv .venv
42+ ```
43+
44+ 3 . Activate the virtual environment and source Zephyr's environment
45+ ```
4246source .venv/bin/activate
47+ source deps/zephyr/zephyr-env.sh
4348```
4449
45- 3 . Install ` west `
50+ 4 . Install ` west `
4651```
4752pip3 install west
4853```
4954
5055Now ` west ` is installed within a virtual environment. ** This environment has to
51- be activated every time you want to use west with LF**
56+ be activated every time you want to use west with LF; use ` source env.sh ` as a
57+ shorthand to activate both.**
5258
53- 4 . Get the Zephyr source code
59+ 5 . Get the Zephyr source code
5460```
5561west update
5662```
5763
58- 5 . Export CMake packages for Zephyr
64+ 6 . Export CMake packages for Zephyr
5965```
6066west zephyr-export
6167```
6268
63- 6 . Install Python dependencies
69+ 7 . Install Python dependencies
6470```
6571pip install -r deps/zephyr/scripts/requirements.txt
6672```
@@ -181,7 +187,8 @@ In this guide we have shown how LF Zephyr apps can be developed in a
181187approach. When you give ` lfc ` a LF program with the ` platform ` target property
182188set to ` Zephyr ` , it will generate a Zephyr project that can be built with
183189` west ` . For this to work, the environment variable ` ZEPHYR_BASE ` must be set to
184- point to the Zephyr RTOS sources. To demonstrate this, create a simple example
190+ point to the Zephyr RTOS sources. This is done by sourcing ` zephyr-env.sh ` at
191+ the root of the Zephyr repository. To demonstrate this, create a simple example
185192program:
186193```
187194cat >> LfcCentricZephyr.lf << 'END'
@@ -200,8 +207,7 @@ If `west` is installed in a virtual environment, activate it, and set up the
200207environment. Assuming that the template is located at ` /home/lf-zephyr-workspace `
201208
202209```
203- source /home/lf-zephyr-workspace/.venv/bin/activate
204- export ZEPHYR_BASE=/home/lf-zephyr-workspace/deps/zephyr
210+ source /home/lf-zephyr-workspace/env.sh
205211lfc LfcCentricZephyr.lf
206212```
207213
0 commit comments