Skip to content

Commit bf27059

Browse files
committed
zephyr win install
1 parent ceb72f4 commit bf27059

File tree

1 file changed

+96
-1
lines changed

1 file changed

+96
-1
lines changed

documentation/devices/zephyr.md

Lines changed: 96 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ This document is a guide to building Moddable apps with the [Zephyr Project SDK]
1515
* [Instrumented](#build-instrumented)
1616
* [Release](#build-release)
1717
* Setup instructions
18+
*
1819
| [![Apple logo](./../assets/moddable/mac-logo.png)](#mac) | [![Windows logo](./../assets/moddable/win-logo.png)](#win) | [![Linux logo](./../assets/moddable/lin-logo.png)](#lin) |
1920
| :--- | :--- | :--- |
2021
| • [Installing](#mac-instructions)<BR>• [Troubleshooting](#mac-troubleshooting) | • [Installing](#win-instructions)<BR>• [Troubleshooting](#win-troubleshooting) | • [Installing](#lin-instructions)<BR>• [Troubleshooting](#lin-troubleshooting)
22+
2123
* [Using Zephyr Device Tree in JavaScript](#devicetree)
2224
* [Debugging Native Code](#debugging-native-code)
2325
* [Adding a new board](#new-board)
@@ -179,8 +181,101 @@ Other silicon families may have different requirements.
179181
<a id="win-instructions"></a>
180182
### Installing
181183

182-
*Not yet supported*
184+
1. Install the Moddable SDK tools by following the instructions in the [Getting Started document](./../Moddable%20SDK%20-%20Getting%20Started.md).
185+
186+
2. Install Zephyr for Windows by following the instructions in the Zephyr [Getting Started Guide](https://docs.zephyrproject.org/latest/develop/getting_started/index.html). A summary is presented below:
187+
188+
3. Install Zephyr requirements:
189+
190+
```sh
191+
winget install Kitware.CMake Ninja-build.Ninja oss-winget.gperf Python.Python.3.12 Git.Git oss-winget.dtc wget 7zip.7zip
192+
```
193+
194+
4. Create an `zephyrproject` directory in your home directory at `%USERPROFILE%\zephyrproject ` for required third party SDKs and tools.
195+
196+
```sh
197+
cd %USERPROFILE%
198+
mkdir zephyrproject
199+
cd zephyrproject
200+
```
201+
202+
5. Create a new virtual environment (one time):
203+
204+
```sh
205+
python -m venv .venv
206+
```
207+
208+
6. Activate the virtual environment (for each new shell):
209+
210+
```sh
211+
zephyrproject\.venv\Scripts\activate.bat
212+
```
213+
214+
> Note: You can deactivate the virtual environment by typing `deactivate` in your shell.
215+
216+
7. Install the `west` tool:
217+
218+
```sh
219+
pip install west
220+
```
221+
222+
8. Get the Zephyr source code
223+
224+
```sh
225+
cd %USERPROFILE%
226+
west init zephyrproject
227+
cd zephyrproject
228+
west update
229+
```
183230

231+
9. The Zephyr west extension command, west packages can be used to install Python dependencies.
232+
233+
```sh
234+
cmd /c zephyr\scripts\utils\west-packages-pip-install.cmd
235+
```
236+
237+
10. Install the Zephyr SDK
238+
239+
```sh
240+
cd %USERPROFILE%\zephyrproject\zephyr
241+
west sdk install
242+
```
243+
244+
3. Open the "Environment Variables" dialog of the Control Panel app by following [these instructions](https://www.architectryan.com/2018/08/31/how-to-change-environment-variables-on-windows-10/). From that dialog:
245+
- Create a User Variable called `ZEPHYR_BASE` and set it to %USERPROFILE%\zephyrproject\zephyr
246+
- Variable name: `ZEPHYR_BASE`
247+
- Variable value (Use the "Browse Directory..." button to make this selection): `C:\Users\<user>\zephyrproject\zephyr`
248+
249+
<a id="upload_port_win"></a>
250+
There is one optional environment variable for advanced users: `UPLOAD_PORT`.<br><br>
251+
252+
- `UPLOAD_PORT`: the COM port for your device, e.g. `COM3`
253+
254+
To identify the correct serial port, launch the Windows Device Manager. Open the "Ports (COM & LPT)" section, verify the Serial port adapter is displayed, and note the associated COM port (e.g. COM3).
255+
256+
11. Verify Zephyr SDK installation by building the `blinky` sample for your board.
257+
258+
```sh
259+
cd %USERPROFILE%\zephyrproject\zephyr
260+
west build -p always -b nucleo_f413zh samples/basic/blinky
261+
```
262+
263+
You can then flash the software to run it.
264+
265+
```sh
266+
west flash
267+
```
268+
269+
12. Verify the complete setup by building `helloworld` for your device target:
270+
271+
```sh
272+
cd %MODDABLE%\examples\helloworld
273+
mcconfig -d -m -p zephyr/nucleo_f413zh
274+
```
275+
276+
13. The device should connect to xsbug and stop at the `debugger` statement.
277+
> Note: Make sure you have built the Moddable tools in the Moddable Getting Started step.
278+
> Note: Make sure you have launched the `xsbug` debugger
184279

185280
<a id="lin"></a>
186281
## Linux

0 commit comments

Comments
 (0)