Skip to content

Commit

Permalink
feat: add pico-sdk windows for x series
Browse files Browse the repository at this point in the history
Signed-off-by: Nascs Fang <[email protected]>
  • Loading branch information
nascs committed Nov 29, 2024
1 parent 5714b4d commit 1d24635
Show file tree
Hide file tree
Showing 16 changed files with 234 additions and 0 deletions.
99 changes: 99 additions & 0 deletions docs/common/dev/_pico-sdk-windows.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
### 安装必要工具

- [Git for Windows](https://github.com/git-for-windows/git/releases/download/v2.47.1.windows.1/Git-2.47.1-64-bit.exe)

该工具主要方便用户使用 git 命令, 以及为用户提供一些 Linux 命令, 我们可以在该工具下进行编译

{" "}

<img
src="/img/x/git_for_windows.webp"
style={{ width: "80%" }}
alt="git for windows"
/>

- [Vscode for Windows](https://code.visualstudio.com/download)

{" "}

<img
src="/img/x/vscode_install.webp"
style={{ width: "80%" }}
alt="vscode for windows"
/>

- [CMAKE](https://github.com/Kitware/CMake/releases/download/v3.31.1/cmake-3.31.1-windows-x86_64.msi)

{" "}

<img
src="/img/x/vscode_install.webp"
style={{ width: "80%" }}
alt="cmake for windows"
/>

- [Pico Setup Windows](https://github.com/raspberrypi/pico-setup-windows/releases/latest/download/pico-setup-windows-x64-standalone.exe)

{" "}

<img
src="/img/x/pico-sdk_install.webp"
style={{ width: "80%" }}
alt="cmake for windows"
/>

- [Ninja](https://github.com/ninja-build/ninja/releases)

下载后解压即可,

- [Python3 for Windows](https://www.python.org/downloads/windows/)

### 设置环境变量

- 在搜索栏搜索 "编辑系统环境"

- 点击 "环境变量"

- 添加系统变量或者用户变量

- 添加变量 PICO_INSTALL_PATH 和 PICO-SDK_PATH

{" "}

<img
src="/img/x/pico_install_path.webp"
style={{ width: "80%" }}
alt="pico install path"
/>

{" "}

<img
src="/img/x/pico-sdk_path.webp"
style={{ width: "80%" }}
alt="pico sdk path"
/>

- 添加 PATH

{" "}

<img
src="/img/x/pico_var_env.webp"
style={{ width: "80%" }}
alt="pico path env"
/>

### 构建编译

打开 git bash, 进入到 pico-examples/build 目录下,执行以下命令进行构建编译

```bash
cmake -G "Ninja" ..

ninja
```

<img src="/img/x/cmake_ninja.webp" style= {{ width: "80%"}} alt="cmake ninja" />

<img src="/img/x/ninja_build.webp" style= {{ width: "80%"}} alt="ninja build" />
9 changes: 9 additions & 0 deletions docs/x/x2l/software-development/c-sdk-windows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
sidebar_position: 31
---

import PICO_SDK_WINDOWS from "../../../common/dev/\_pico-sdk-windows.mdx";

# 在 Windows 下搭建 RP2040 的 C/C++ 编译环境

<PICO_SDK_WINDOWS />
9 changes: 9 additions & 0 deletions docs/x/x4/software/c-sdk-windows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
sidebar_position: 31
---

import PICO_SDK_WINDOWS from "../../../common/dev/\_pico-sdk-windows.mdx";

# 在 Windows 下搭建 RP2040 的 C/C++ 编译环境

<PICO_SDK_WINDOWS />
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
### 安装必要工具

- [Git for Windows](https://github.com/git-for-windows/git/releases/download/v2.47.1.windows.1/Git-2.47.1-64-bit.exe)

This tool facilitates the use of git commands and provides you with some Linux commands that you can use to build the

{" "}

<img
src="/img/x/git_for_windows.webp"
style={{ width: "80%" }}
alt="git for windows"
/>

- [Vscode for Windows](https://code.visualstudio.com/download)

{" "}

<img
src="/img/x/vscode_install.webp"
style={{ width: "80%" }}
alt="vscode for windows"
/>

- [CMAKE](https://github.com/Kitware/CMake/releases/download/v3.31.1/cmake-3.31.1-windows-x86_64.msi)

{" "}

<img
src="/img/x/vscode_install.webp"
style={{ width: "80%" }}
alt="cmake for windows"
/>

- [Pico Setup Windows](https://github.com/raspberrypi/pico-setup-windows/releases/latest/download/pico-setup-windows-x64-standalone.exe)

{" "}

<img
src="/img/x/pico-sdk_install.webp"
style={{ width: "80%" }}
alt="cmake for windows"
/>

- [Ninja](https://github.com/ninja-build/ninja/releases)

Download and unzip it.

- [Python3 for Windows](https://www.python.org/downloads/windows/)

### Set Environment Variables

- Search for ‘Edit the system environment’ in the search bar.

- Click "Environment Variables"

- Add system or user variables

- Add variables PICO_INSTALL_PATH and PICO-SDK_PATH

{" "}

<img
src="/img/x/pico_install_path.webp"
style={{ width: "80%" }}
alt="pico install path"
/>

{" "}

<img
src="/img/x/pico-sdk_path.webp"
style={{ width: "80%" }}
alt="pico sdk path"
/>

- Ads PATH

{" "}

<img
src="/img/x/pico_var_env.webp"
style={{ width: "80%" }}
alt="pico path env"
/>

### Build

Open git bash, go to the pico-examples/build directory, and execute the following command to build the system

```bash
cmake -G "Ninja" ..

ninja
```

<img src="/img/x/cmake_ninja.webp" style= {{ width: "80%"}} alt="cmake ninja" />

<img src="/img/x/ninja_build.webp" style= {{ width: "80%"}} alt="ninja build" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
sidebar_position: 31
---

import PICO_SDK_WINDOWS from "../../../common/dev/\_pico-sdk-windows.mdx";

# Build C/C++ compilation environment for RP2040 on Windows

<PICO_SDK_WINDOWS />
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
sidebar_position: 31
---

import PICO_SDK_WINDOWS from "../../../common/dev/\_pico-sdk-windows.mdx";

# Build C/C++ compilation environment for RP2040 on Windows

<PICO_SDK_WINDOWS />
Binary file added static/img/x/cmake_install.webp
Binary file not shown.
Binary file added static/img/x/cmake_ninja.webp
Binary file not shown.
Binary file added static/img/x/env_path.webp
Binary file not shown.
Binary file added static/img/x/git_for_windows.webp
Binary file not shown.
Binary file added static/img/x/ninja_build.webp
Binary file not shown.
Binary file added static/img/x/pico-sdk_install.webp
Binary file not shown.
Binary file added static/img/x/pico-sdk_path.webp
Binary file not shown.
Binary file added static/img/x/pico_install_path.webp
Binary file not shown.
Binary file added static/img/x/pico_var_env.webp
Binary file not shown.
Binary file added static/img/x/vscode_install.webp
Binary file not shown.

0 comments on commit 1d24635

Please sign in to comment.