@@ -36,31 +36,37 @@ are going to create next.
36
36
git clone https://github.com/lf-lang/lf-west-template lf-zephyr-workspace && cd lf-zephyr-workspace
37
37
```
38
38
39
- 2 . Setup and activate a virtual environment
39
+ 2 . Setup the virtual environment
40
40
```
41
41
python3 -m venv .venv
42
+ ```
43
+
44
+ 3 . Activate the virtual environment and source Zephyr's environment
45
+ ```
42
46
source .venv/bin/activate
47
+ source deps/zephyr/zephyr-env.sh
43
48
```
44
49
45
- 3 . Install ` west `
50
+ 4 . Install ` west `
46
51
```
47
52
pip3 install west
48
53
```
49
54
50
55
Now ` 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.**
52
58
53
- 4 . Get the Zephyr source code
59
+ 5 . Get the Zephyr source code
54
60
```
55
61
west update
56
62
```
57
63
58
- 5 . Export CMake packages for Zephyr
64
+ 6 . Export CMake packages for Zephyr
59
65
```
60
66
west zephyr-export
61
67
```
62
68
63
- 6 . Install Python dependencies
69
+ 7 . Install Python dependencies
64
70
```
65
71
pip install -r deps/zephyr/scripts/requirements.txt
66
72
```
@@ -181,7 +187,8 @@ In this guide we have shown how LF Zephyr apps can be developed in a
181
187
approach. When you give ` lfc ` a LF program with the ` platform ` target property
182
188
set to ` Zephyr ` , it will generate a Zephyr project that can be built with
183
189
` 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
185
192
program:
186
193
```
187
194
cat >> LfcCentricZephyr.lf << 'END'
@@ -200,8 +207,7 @@ If `west` is installed in a virtual environment, activate it, and set up the
200
207
environment. Assuming that the template is located at ` /home/lf-zephyr-workspace `
201
208
202
209
```
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
205
211
lfc LfcCentricZephyr.lf
206
212
```
207
213
0 commit comments