Skip to content

Commit ed2ca09

Browse files
committed
Update docs to reflect fix on sourcing environments
1 parent d528bad commit ed2ca09

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

versioned_docs/version-0.6.0/embedded/zephyr.mdx

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,31 +36,37 @@ are going to create next.
3636
git 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
```
4141
python3 -m venv .venv
42+
```
43+
44+
3. Activate the virtual environment and source Zephyr's environment
45+
```
4246
source .venv/bin/activate
47+
source deps/zephyr/zephyr-env.sh
4348
```
4449

45-
3. Install `west`
50+
4. Install `west`
4651
```
4752
pip3 install west
4853
```
4954

5055
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.**
5258

53-
4. Get the Zephyr source code
59+
5. Get the Zephyr source code
5460
```
5561
west update
5662
```
5763

58-
5. Export CMake packages for Zephyr
64+
6. Export CMake packages for Zephyr
5965
```
6066
west zephyr-export
6167
```
6268

63-
6. Install Python dependencies
69+
7. Install Python dependencies
6470
```
6571
pip 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
181187
approach. When you give `lfc` a LF program with the `platform` target property
182188
set 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
185192
program:
186193
```
187194
cat >> LfcCentricZephyr.lf << 'END'
@@ -200,8 +207,7 @@ If `west` is installed in a virtual environment, activate it, and set up the
200207
environment. 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
205211
lfc LfcCentricZephyr.lf
206212
```
207213

0 commit comments

Comments
 (0)