diff --git a/docs/common/dev/_pico-fan.mdx b/docs/common/dev/_pico-fan.mdx index ff5aeb4a2..3d01fefb8 100644 --- a/docs/common/dev/_pico-fan.mdx +++ b/docs/common/dev/_pico-fan.mdx @@ -1,3 +1,5 @@ +import { PreView } from "@site/src/utils/docs"; + ##### 风扇 本段示例旨在为用户提供一个 {props.product_name} CPU 与 MCU RP2040 通信的例子,通过获取 {props.product_name} CPU 的温度,当达到指定温度时,让风扇转起来。 @@ -188,12 +190,38 @@ sudo apt-get install minicom ###### 7. 编译 -```bash -cd pico-example/build -rm -rf * -cmake .. -make -j$(nproc) -``` +{" "} + +{" "} + +
+ {props.platform === "Linux" ? ( +
+ + cd pico-examples/build +
+ rm -rf *
+ cmake .. +
+ make -j$(nproc) +
+
{" "} +
+ ) : null} + {props.platform === "Windows" ? ( +
+ + cd pico-examples/build/ +
+ rm -rf *
+ cmake -G "Ninja" .. +
+ ninja +
+
{" "} +
+ ) : null} +
成功编译后,在 build/pwm/pwm_fan 目录下会产生一个名为 pwm_fan.uf2 的文件 diff --git a/docs/common/dev/_pico-gpio-controlled-by-intel.mdx b/docs/common/dev/_pico-gpio-controlled-by-intel.mdx index 45180f6a8..cca9a048e 100644 --- a/docs/common/dev/_pico-gpio-controlled-by-intel.mdx +++ b/docs/common/dev/_pico-gpio-controlled-by-intel.mdx @@ -105,12 +105,34 @@ import { PreView } from "@site/src/utils/docs"; - 编译 -```bash -cd pico-examples/build -rm -rf * -cmake .. -make -j$(nproc) -``` +
+ {props.platform === "Linux" ? ( +
+ + cd pico-examples/build +
+ rm -rf *
+ cmake .. +
+ make -j$(nproc) +
+
{" "} +
+ ) : null} + {props.platform === "Windows" ? ( +
+ + cd pico-examples/build/ +
+ rm -rf *
+ cmake -G "Ninja" .. +
+ ninja +
+
{" "} +
+ ) : null} +
编译成功后, 在 pico-examples/build/pwm/led_fade/ 目录下会产生一个名为 hello_uart.uf2 的文件 diff --git a/docs/common/dev/_pico-gpio.mdx b/docs/common/dev/_pico-gpio.mdx index e11c3a013..03a472c41 100644 --- a/docs/common/dev/_pico-gpio.mdx +++ b/docs/common/dev/_pico-gpio.mdx @@ -1,3 +1,5 @@ +import { PreView } from "@site/src/utils/docs"; + #### GPIO ##### 1. 准备 @@ -69,12 +71,34 @@ - 编译 - ```bash - cd pico-examples/build - rm -rf * - cmake .. - make -j$(nproc) - ``` +
+ {props.platform === "Linux" ? ( +
+ + cd pico-examples/build +
+ rm -rf *
+ cmake .. +
+ make -j$(nproc) +
+
{" "} +
+ ) : null} + {props.platform === "Windows" ? ( +
+ + cd pico-examples/build/ +
+ rm -rf *
+ cmake -G "Ninja" .. +
+ ninja +
+
{" "} +
+ ) : null} +
成功编译后,在 pico-examples/build/blink/ 目录下会产生一个名为 blink.uf2 的文件 diff --git a/docs/common/dev/_pico-i2c.mdx b/docs/common/dev/_pico-i2c.mdx index 1fe39f168..f9eaeddc6 100644 --- a/docs/common/dev/_pico-i2c.mdx +++ b/docs/common/dev/_pico-i2c.mdx @@ -1,3 +1,5 @@ +import { PreView } from "@site/src/utils/docs"; + #### I2C ##### 1. 准备 @@ -202,12 +204,34 @@ - 编译 -```bash -cd pico-examples/build -rm -rf * -cmake .. -make -j$(nproc) -``` +
+ {props.platform === "Linux" ? ( +
+ + cd pico-examples/build +
+ rm -rf *
+ cmake .. +
+ make -j$(nproc) +
+
{" "} +
+ ) : null} + {props.platform === "Windows" ? ( +
+ + cd pico-examples/build/ +
+ rm -rf *
+ cmake -G "Ninja" .. +
+ ninja +
+
{" "} +
+ ) : null} +
成功编译后,在 pico-examples/build/i2c/lcd_1602_i2c/ 目录下会产生一个名为 lcd_1602_i2c.uf2 的文件 diff --git a/docs/common/dev/_pico-poe-fan.mdx b/docs/common/dev/_pico-poe-fan.mdx index 35e558819..eac4a60c7 100644 --- a/docs/common/dev/_pico-poe-fan.mdx +++ b/docs/common/dev/_pico-poe-fan.mdx @@ -1,3 +1,4 @@ +import { PreView } from "@site/src/utils/docs"; import { Image } from "@site/src/utils/docs"; #### PoE FAN @@ -107,12 +108,34 @@ int main() { - 编译 -```bash -cd pico-examples/build -rm -rf * -cmake .. -make -j$(nproc) -``` +
+ {props.platform === "Linux" ? ( +
+ + cd pico-examples/build +
+ rm -rf *
+ cmake .. +
+ make -j$(nproc) +
+
{" "} +
+ ) : null} + {props.platform === "Windows" ? ( +
+ + cd pico-examples/build/ +
+ rm -rf *
+ cmake -G "Ninja" .. +
+ ninja +
+
{" "} +
+ ) : null} +
成功编译后,在 pico-examples/build/pio/onewire/ 目录下会产生一个名为 pio_onwire.uf2 的文件 diff --git a/docs/common/dev/_pico-pwm.mdx b/docs/common/dev/_pico-pwm.mdx index 760e87273..d0e23f8e9 100644 --- a/docs/common/dev/_pico-pwm.mdx +++ b/docs/common/dev/_pico-pwm.mdx @@ -1,3 +1,5 @@ +import { PreView } from "@site/src/utils/docs"; + #### PWM ##### 1. 准备 @@ -100,12 +102,34 @@ int main() { - 编译 -```bash -cd pico-examples/build -rm -rf * -cmake .. -make -j$(nproc) -``` +
+ {props.platform === "Linux" ? ( +
+ + cd pico-examples/build +
+ rm -rf *
+ cmake .. +
+ make -j$(nproc) +
+
{" "} +
+ ) : null} + {props.platform === "Windows" ? ( +
+ + cd pico-examples/build/ +
+ rm -rf *
+ cmake -G "Ninja" .. +
+ ninja +
+
{" "} +
+ ) : null} +
编译成功后, 在 pico-examples/build/pwm/led_fade/ 目录下会产生一个名为 pwm_led_fade.uf2 的文件 diff --git a/docs/common/dev/_pico-sdk-windows.mdx b/docs/common/dev/_pico-sdk-windows.mdx new file mode 100644 index 000000000..e68b5c4fd --- /dev/null +++ b/docs/common/dev/_pico-sdk-windows.mdx @@ -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 命令, 我们可以在该工具下进行编译 + + {" "} + + git for windows + +- [Vscode for Windows](https://code.visualstudio.com/download) + + {" "} + + vscode for windows + +- [CMAKE](https://github.com/Kitware/CMake/releases/download/v3.31.1/cmake-3.31.1-windows-x86_64.msi) + + {" "} + + cmake for windows + +- [Pico Setup Windows](https://github.com/raspberrypi/pico-setup-windows/releases/latest/download/pico-setup-windows-x64-standalone.exe) + + {" "} + + 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 + + {" "} + + pico install path + + {" "} + + pico sdk path + +- 添加 PATH + + {" "} + + pico path env + +### 构建编译 + +打开 git bash, 进入到 pico-examples/build 目录下,执行以下命令进行构建编译 + +```bash +cmake -G "Ninja" .. + +ninja +``` + + cmake ninja + + ninja build diff --git a/docs/common/dev/_pico-uart.mdx b/docs/common/dev/_pico-uart.mdx index 972e528f8..170d8cc15 100644 --- a/docs/common/dev/_pico-uart.mdx +++ b/docs/common/dev/_pico-uart.mdx @@ -1,3 +1,5 @@ +import { PreView } from "@site/src/utils/docs"; + ##### UART - 将以下代码替换 pico-examples/uart/hello_uart/hello_uart.c @@ -90,12 +92,34 @@ pico_enable_stdio_uart(hello_uart 1) - 编译 -```bash -cd pico-examples/build -rm -rf * -cmake .. -make -j$(nproc) -``` +
+ {props.platform === "Linux" ? ( +
+ + cd pico-examples/build +
+ rm -rf *
+ cmake .. +
+ make -j$(nproc) +
+
{" "} +
+ ) : null} + {props.platform === "Windows" ? ( +
+ + cd pico-examples/build/ +
+ rm -rf *
+ cmake -G "Ninja" .. +
+ ninja +
+
{" "} +
+ ) : null} +
编译成功后, 在 pico-examples/build/uart/hello_uart/ 目录下会产生一个名为 hello_uart.uf2 的文件 diff --git a/docs/x/x2l/software-development/_relation.mdx b/docs/x/x2l/software-development/_relation.mdx index 359ba564e..8e7216c63 100644 --- a/docs/x/x2l/software-development/_relation.mdx +++ b/docs/x/x2l/software-development/_relation.mdx @@ -1,6 +1,6 @@ 在 Radxa X2L 上集成了 Intel J4125 的 CPU 和一块 [RP2040](https://en.wikipedia.org/wiki/RP2040) MCU,两者通过 USB 和 UART 两种方式进行通信。 RP2040 在系统中以 USB 存储设备的形式存在,程序烧录时只需将文件拖拽至该 USB 设备中即可。 -此外,它们还共用 UART 通信接口,使得 Intel N100 能够通过 UART 控制 RP2040,例如,通过 UART 接口实现对 RP2040 GPIO 的操控。 +此外,它们还共用 UART 通信接口,使得 Intel J4125 能够通过 UART 控制 RP2040,例如,通过 UART 接口实现对 RP2040 GPIO 的操控。 两者关系,如图所示: diff --git a/docs/x/x2l/software-development/c-sdk-windows.md b/docs/x/x2l/software-development/c-sdk-windows.md new file mode 100644 index 000000000..3cd181f5d --- /dev/null +++ b/docs/x/x2l/software-development/c-sdk-windows.md @@ -0,0 +1,43 @@ +--- +sidebar_position: 5 +--- + +import PICO_SDK_WINDOWS from "../../../common/dev/\_pico-sdk-windows.mdx"; +import GPIO from "../../../common/dev/\_pico-gpio.mdx"; +import PWM from "../../../common/dev/\_pico-pwm.mdx"; +import I2C from "../../../common/dev/\_pico-i2c.mdx"; +import UART from "../../../common/dev/\_pico-uart.mdx"; +import RELATION from "./\_relation.mdx" + +# 在 Windows 下控制 RP2040 + +## Intel J4125 与 RP2040 和 40-PIN GPIO 的关系介绍 + + + +## 40-PIN 使用 + +为了操作 RP2040 上的 IO 资源, 我们需要一套完善的软件环境,如 MicroPython 或者 C/C++ SDK,在这里我们主要介绍一套 C/C++ SDK,即 pico-sdk 和 pico-example。 pico-sdk 主要是提供了一些操作 RP2040 的 API, 而 pico-examples 则为我们提供了一套程序编译框架,我们可以根据 pico-examples 提供的编译框架来添加我们自己的程序。 + + + +### 烧录 + +按下 BOOTSEL 键后, 会弹出一个 USB 设备。将编译后产生的 .uf2 文件拷贝到 RP2040 的 USB 设备中, 待该 USB 设备消失后, 程序开始执行。 + +### 示例 + + + + + + + + + + + + + + + diff --git a/docs/x/x2l/software-development/c_sdk_examples.md b/docs/x/x2l/software-development/c_sdk_examples.md index b96c61da6..a020b8e9a 100644 --- a/docs/x/x2l/software-development/c_sdk_examples.md +++ b/docs/x/x2l/software-development/c_sdk_examples.md @@ -1,5 +1,5 @@ --- -sidebar_position: 30 +sidebar_position: 4 --- import SDK_EXAMPLE from "../../../common/dev/\_pico-sdk-example.mdx"; @@ -10,7 +10,7 @@ import FAN from "../../../common/dev/\_pico-fan.mdx"; import RELATION from "./\_relation.mdx" import UART from "../../../common/dev/\_pico-uart.mdx"; -# 40-PIN 使用指南 +# 在 Linux 下控制 RP2040 ## Intel J4125 与 RP2040 和 40-PIN GPIO 的关系介绍 @@ -26,14 +26,21 @@ import UART from "../../../common/dev/\_pico-uart.mdx"; #### RP2040 单独控制 40-PIN GPIO - - - - - - - + + + + + + + + + + + + + + #### CPU 通过 UART 来控制 RP2040 的 40-PIN GPIO - + diff --git a/docs/x/x2l/software-development/flash.md b/docs/x/x2l/software-development/flash.md index 01fe5ba3d..837d75999 100644 --- a/docs/x/x2l/software-development/flash.md +++ b/docs/x/x2l/software-development/flash.md @@ -1,5 +1,5 @@ --- -sidebar_position: 30 +sidebar_position: 2 --- # 烧录 diff --git a/docs/x/x2l/software-development/micro_python.md b/docs/x/x2l/software-development/micro_python.md index c1c95f439..05b2d37d9 100644 --- a/docs/x/x2l/software-development/micro_python.md +++ b/docs/x/x2l/software-development/micro_python.md @@ -1,5 +1,5 @@ --- -sidebar_position: 30 +sidebar_position: 3 --- # MicroPython diff --git a/docs/x/x4/software/c-sdk-windows.md b/docs/x/x4/software/c-sdk-windows.md new file mode 100644 index 000000000..97b45f9bd --- /dev/null +++ b/docs/x/x4/software/c-sdk-windows.md @@ -0,0 +1,46 @@ +--- +sidebar_position: 5 +--- + +import PICO_SDK_WINDOWS from "../../../common/dev/\_pico-sdk-windows.mdx"; +import GPIO from "../../../common/dev/\_pico-gpio.mdx"; +import PWM from "../../../common/dev/\_pico-pwm.mdx"; +import I2C from "../../../common/dev/\_pico-i2c.mdx"; +import PoE from "../../../common/dev/\_pico-poe-fan.mdx"; +import FAN from "../../../common/dev/\_pico-fan.mdx"; +import RELATION from "./\_relation.mdx" +import UART from "../../../common/dev/\_pico-uart.mdx"; + +# 在 Windows 下控制 RP2040 + +## Intel J4125 与 RP2040 和 40-PIN GPIO 的关系介绍 + + + + + +## 烧录 + +按下 BOOTSEL 键后, 会弹出一个 USB 设备。将编译后产生的 .uf2 文件拷贝到 RP2040 的 USB 设备中, 待该 USB 设备消失后, 程序开始执行。 + +## 示例 + +### RP2040 控制 40-PIN + + + + + + + + + + + + + + + + + + diff --git a/docs/x/x4/software/c_sdk_examples.md b/docs/x/x4/software/c_sdk_examples.md index f4d1215ab..b0ea69742 100644 --- a/docs/x/x4/software/c_sdk_examples.md +++ b/docs/x/x4/software/c_sdk_examples.md @@ -1,5 +1,5 @@ --- -sidebar_position: 2 +sidebar_position: 4 --- import SDK_EXAMPLE from "../../../common/dev/\_pico-sdk-example.mdx"; @@ -12,7 +12,7 @@ import RELATION from "./\_relation.mdx" import UART from "../../../common/dev/\_pico-uart.mdx"; import INTEL_UART from "../../../common/dev/\_pico-gpio-controlled-by-intel.mdx"; -# 40-PIN 使用指南 +# 在 Linux 下控制 RP2040 ## 概述 @@ -30,19 +30,22 @@ import INTEL_UART from "../../../common/dev/\_pico-gpio-controlled-by-intel.mdx" - + - + - + - + - + @@ -50,9 +53,9 @@ import INTEL_UART from "../../../common/dev/\_pico-gpio-controlled-by-intel.mdx" - + - + diff --git a/docs/x/x4/software/flash.md b/docs/x/x4/software/flash.md index 7f59a5e72..58660f983 100644 --- a/docs/x/x4/software/flash.md +++ b/docs/x/x4/software/flash.md @@ -1,5 +1,5 @@ --- -sidebar_position: 3 +sidebar_position: 2 --- # 烧录程序到 RP2040 diff --git a/i18n/en/docusaurus-plugin-content-docs/current/common/dev/_pico-fan.mdx b/i18n/en/docusaurus-plugin-content-docs/current/common/dev/_pico-fan.mdx index 151354a99..aa9516e3f 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/common/dev/_pico-fan.mdx +++ b/i18n/en/docusaurus-plugin-content-docs/current/common/dev/_pico-fan.mdx @@ -1,3 +1,5 @@ +import { PreView } from "@site/src/utils/docs"; + ##### FAN The purpose of this paragraph is to provide the user with an example of the {props.product_name} CPU communicating with the MCU RP2040 by obtaining the temperature of the {props.product_name} CPU and making the fan spin up when the specified temperature is reached. @@ -188,12 +190,38 @@ Replace pico-example/pwm/CMakeLists.txt with the following code ###### 7. Compile -```bash -cd pico-example/build -rm -rf * -cmake .. -make -j$(nproc) -``` +{" "} + +{" "} + +
+ {props.platform === "Linux" ? ( +
+ + cd pico-examples/build +
+ rm -rf *
+ cmake .. +
+ make -j$(nproc) +
+
{" "} +
+ ) : null} + {props.platform === "Windows" ? ( +
+ + cd pico-examples/build/ +
+ rm -rf *
+ cmake -G "Ninja" .. +
+ ninja +
+
{" "} +
+ ) : null} +
After successful compilation, a file named pwm_fan.uf2 is generated in the build/pwm/pwm_fan directory diff --git a/i18n/en/docusaurus-plugin-content-docs/current/common/dev/_pico-gpio-controlled-by-intel.mdx b/i18n/en/docusaurus-plugin-content-docs/current/common/dev/_pico-gpio-controlled-by-intel.mdx index f2d91ebc2..b50bd258a 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/common/dev/_pico-gpio-controlled-by-intel.mdx +++ b/i18n/en/docusaurus-plugin-content-docs/current/common/dev/_pico-gpio-controlled-by-intel.mdx @@ -105,12 +105,34 @@ Here {props.led_pin} corresponds to GPIO{props.gpio_num} in the following code, - Compile -```bash -cd pico-examples/build -rm -rf * -cmake .. -make -j$(nproc) -``` +
+ {props.platform === "Linux" ? ( +
+ + cd pico-examples/build +
+ rm -rf *
+ cmake .. +
+ make -j$(nproc) +
+
{" "} +
+ ) : null} + {props.platform === "Windows" ? ( +
+ + cd pico-examples/build/ +
+ rm -rf *
+ cmake -G "Ninja" .. +
+ ninja +
+
{" "} +
+ ) : null} +
After successful compilation, a file named hello_uart.uf2 will be created in the pico-examples/build/pwm/led_fade/ directory. diff --git a/i18n/en/docusaurus-plugin-content-docs/current/common/dev/_pico-gpio.mdx b/i18n/en/docusaurus-plugin-content-docs/current/common/dev/_pico-gpio.mdx index adf863868..7a17f81be 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/common/dev/_pico-gpio.mdx +++ b/i18n/en/docusaurus-plugin-content-docs/current/common/dev/_pico-gpio.mdx @@ -1,3 +1,5 @@ +import { PreView } from "@site/src/utils/docs"; + ##### GPIO ###### 1. Preparation @@ -69,12 +71,34 @@ Here {props.led_pin} corresponds to GPIO29 in the following code, please refer t - Compile - ```bash - cd pico-examples/build - rm -rf * - cmake .. - make -j$(nproc) - ``` +
+ {props.platform === "Linux" ? ( +
+ + cd pico-examples/build +
+ rm -rf *
+ cmake .. +
+ make -j$(nproc) +
+
{" "} +
+ ) : null} + {props.platform === "Windows" ? ( +
+ + cd pico-examples/build/ +
+ rm -rf *
+ cmake -G "Ninja" .. +
+ ninja +
+
{" "} +
+ ) : null} +
After successful compilation, a file named blink.uf2 will be created in the pico-examples/build/blink/ directory. diff --git a/i18n/en/docusaurus-plugin-content-docs/current/common/dev/_pico-i2c.mdx b/i18n/en/docusaurus-plugin-content-docs/current/common/dev/_pico-i2c.mdx index 455a0ae7e..279fc8ff9 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/common/dev/_pico-i2c.mdx +++ b/i18n/en/docusaurus-plugin-content-docs/current/common/dev/_pico-i2c.mdx @@ -1,3 +1,5 @@ +import { PreView } from "@site/src/utils/docs"; + ##### I2C ###### 1. Preparation @@ -202,12 +204,34 @@ Here {props.scl_pin} corresponds to I2C0 SDA for GPIO29 in the following code, a - Compile - ```bash - cd pico-examples/build - rm -rf * - cmake .. - make -j$(nproc) - ``` +
+ {props.platform === "Linux" ? ( +
+ + cd pico-examples/build +
+ rm -rf *
+ cmake .. +
+ make -j$(nproc) +
+
{" "} +
+ ) : null} + {props.platform === "Windows" ? ( +
+ + cd pico-examples/build/ +
+ rm -rf *
+ cmake -G "Ninja" .. +
+ ninja +
+
{" "} +
+ ) : null} +
After successful compilation, a file named lcd_1602_i2c.uf2 will be created in the pico-examples/build/i2c/lcd_1602_i2c/ directory diff --git a/i18n/en/docusaurus-plugin-content-docs/current/common/dev/_pico-poe-fan.mdx b/i18n/en/docusaurus-plugin-content-docs/current/common/dev/_pico-poe-fan.mdx index d44234d1b..f1501b8dd 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/common/dev/_pico-poe-fan.mdx +++ b/i18n/en/docusaurus-plugin-content-docs/current/common/dev/_pico-poe-fan.mdx @@ -1,4 +1,5 @@ import { Image } from "@site/src/utils/docs"; +import { PreView } from "@site/src/utils/docs"; ##### PoE FAN @@ -107,12 +108,34 @@ int main() { - compile -```bash -cd pico-examples/build -rm -rf * -cmake .. -make -j$(nproc) -``` +
+ {props.platform === "Linux" ? ( +
+ + cd pico-examples/build +
+ rm -rf *
+ cmake .. +
+ make -j$(nproc) +
+
{" "} +
+ ) : null} + {props.platform === "Windows" ? ( +
+ + cd pico-examples/build/ +
+ rm -rf *
+ cmake -G "Ninja" .. +
+ ninja +
+
{" "} +
+ ) : null} +
After successful compilation, a file named pio_onwire.uf2 will be generated in the pico-examples/build/pio/onewire/ directory. diff --git a/i18n/en/docusaurus-plugin-content-docs/current/common/dev/_pico-pwm.mdx b/i18n/en/docusaurus-plugin-content-docs/current/common/dev/_pico-pwm.mdx index 6f625e7b3..bd3190418 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/common/dev/_pico-pwm.mdx +++ b/i18n/en/docusaurus-plugin-content-docs/current/common/dev/_pico-pwm.mdx @@ -1,3 +1,5 @@ +import { PreView } from "@site/src/utils/docs"; + ##### PWM ###### 1. Preparation @@ -102,12 +104,34 @@ Here {props.led_pin} corresponds to GPIO29 in the following code, please refer t - Compile - ```bash - cd pico-examples/build - rm -rf * - cmake .. - make -j$(nproc) - ``` +
+ {props.platform === "Linux" ? ( +
+ + cd pico-examples/build +
+ rm -rf *
+ cmake .. +
+ make -j$(nproc) +
+
{" "} +
+ ) : null} + {props.platform === "Windows" ? ( +
+ + cd pico-examples/build/ +
+ rm -rf *
+ cmake -G "Ninja" .. +
+ ninja +
+
{" "} +
+ ) : null} +
After successful compilation, a file named pwm_led_fade.uf2 will be created in the pico-examples/build/pwm/led_fade/ directory. diff --git a/i18n/en/docusaurus-plugin-content-docs/current/common/dev/_pico-sdk-windows.mdx b/i18n/en/docusaurus-plugin-content-docs/current/common/dev/_pico-sdk-windows.mdx new file mode 100644 index 000000000..7d9e3f145 --- /dev/null +++ b/i18n/en/docusaurus-plugin-content-docs/current/common/dev/_pico-sdk-windows.mdx @@ -0,0 +1,99 @@ +### Install necessary Tools + +- [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 + + {" "} + + git for windows + +- [Vscode for Windows](https://code.visualstudio.com/download) + + {" "} + + vscode for windows + +- [CMAKE](https://github.com/Kitware/CMake/releases/download/v3.31.1/cmake-3.31.1-windows-x86_64.msi) + + {" "} + + cmake for windows + +- [Pico Setup Windows](https://github.com/raspberrypi/pico-setup-windows/releases/latest/download/pico-setup-windows-x64-standalone.exe) + + {" "} + + 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 + + {" "} + + pico install path + + {" "} + + pico sdk path + +- Ads PATH + + {" "} + + 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 +``` + + cmake ninja + + ninja build diff --git a/i18n/en/docusaurus-plugin-content-docs/current/common/dev/_pico-uart.mdx b/i18n/en/docusaurus-plugin-content-docs/current/common/dev/_pico-uart.mdx index c9c8d9e0e..0d69c09c4 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/common/dev/_pico-uart.mdx +++ b/i18n/en/docusaurus-plugin-content-docs/current/common/dev/_pico-uart.mdx @@ -1,3 +1,5 @@ +import { PreView } from "@site/src/utils/docs"; + ##### UART - Replace pico-examples/uart/hello_uart/hello_uart.c with the following code @@ -90,12 +92,34 @@ pico_enable_stdio_uart(hello_uart 1) - Compile -```bash -cd pico-examples/build -rm -rf * -cmake .. -make -j$(nproc) -``` +
+ {props.platform === "Linux" ? ( +
+ + cd pico-examples/build +
+ rm -rf *
+ cmake .. +
+ make -j$(nproc) +
+
{" "} +
+ ) : null} + {props.platform === "Windows" ? ( +
+ + cd pico-examples/build/ +
+ rm -rf *
+ cmake -G "Ninja" .. +
+ ninja +
+
{" "} +
+ ) : null} +
After successful compilation, a file named hello_uart.uf2 will be created in the pico-examples/build/uart/hello_uart/ directory. diff --git a/i18n/en/docusaurus-plugin-content-docs/current/x/x2l/software-development/_relation.mdx b/i18n/en/docusaurus-plugin-content-docs/current/x/x2l/software-development/_relation.mdx index 0ba6ab74b..8f5d393a0 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/x/x2l/software-development/_relation.mdx +++ b/i18n/en/docusaurus-plugin-content-docs/current/x/x2l/software-development/_relation.mdx @@ -1,6 +1,6 @@ The Radxa X2L integrates an Intel J4125 CPU and a [RP2040](https://en.wikipedia.org/wiki/RP2040) MCU, which communicate with each other via USB and UART. The RP2040 exists as a USB memory device in the system, and the program can be burned by dragging and dropping the files to the USB device. -In addition, they share the same UART communication interface, which enables Intel N100 to control the RP2040 through UART, for example, to realize the control of RP2040 GPIO through the UART interface. +In addition, they share the same UART communication interface, which enables Intel J4125 to control the RP2040 through UART, for example, to realize the control of RP2040 GPIO through the UART interface. The relationship between the two is shown in the following figure: diff --git a/i18n/en/docusaurus-plugin-content-docs/current/x/x2l/software-development/c-sdk-windows.md b/i18n/en/docusaurus-plugin-content-docs/current/x/x2l/software-development/c-sdk-windows.md new file mode 100644 index 000000000..13725bae5 --- /dev/null +++ b/i18n/en/docusaurus-plugin-content-docs/current/x/x2l/software-development/c-sdk-windows.md @@ -0,0 +1,43 @@ +--- +sidebar_position: 5 +--- + +import PICO_SDK_WINDOWS from "../../../common/dev/\_pico-sdk-windows.mdx"; +import GPIO from "../../../common/dev/\_pico-gpio.mdx"; +import PWM from "../../../common/dev/\_pico-pwm.mdx"; +import I2C from "../../../common/dev/\_pico-i2c.mdx"; +import UART from "../../../common/dev/\_pico-uart.mdx"; +import RELATION from "./\_relation.mdx" + +# Control RP2040 on Windows + +## Introducts relationship between Intel N100,RP2040 and 40-PIN GPIO + + + +## 40 PIN Usage + +In order to operate the IO resources on RP2040, we need a complete software environment, such as MicroPython or C/C++ SDK, here we mainly introduce a set of C/C++ SDKs, namely pico-sdk and pico-examples. pico-sdk mainly provides some APIs to operate the RP2040, while pico-examples provides a compilation framework for us to add our own programs according to the compilation framework provided by pico-examples. pico-sdk provides some APIs to operate the RP2040, while pico-examples provides a compilation framework for us to add our own programs according to the compilation framework provided by pico-examples. + + + +### Flash + +Press the BOOTSEL key and a USB device will pop up. Copy the compiled .uf2 file to the USB device of RP2040 and wait until the USB device disappears, then the programme will start to execute. + +### Examples + + + + + + + + + + + + + + + diff --git a/i18n/en/docusaurus-plugin-content-docs/current/x/x2l/software-development/c_sdk_examples.md b/i18n/en/docusaurus-plugin-content-docs/current/x/x2l/software-development/c_sdk_examples.md index a73a8e4cd..ee2d95c75 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/x/x2l/software-development/c_sdk_examples.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/x/x2l/software-development/c_sdk_examples.md @@ -1,5 +1,5 @@ --- -sidebar_position: 30 +sidebar_position: 4 --- import SDK_EXAMPLE from "../../../common/dev/\_pico-sdk-example.mdx"; @@ -10,13 +10,13 @@ import FAN from "../../../common/dev/\_pico-fan.mdx"; import RELATION from "./\_relation.mdx" import UART from "../../../common/dev/\_pico-uart.mdx"; -# 40-PIN Usage +# Control RP2040 on Linux ## Introduction to Intel N100 and RP2040 and 40-PIN GPIO Relationships -## 40-PIN Usage +## Control RP2040 on Linux In order to operate the IO resources on RP2040, we need a complete software environment, such as MicroPython or C/C++ SDK, here we mainly introduce a set of C/C++ SDKs, namely pico-sdk and pico-examples. pico-sdk mainly provides some APIs to operate the RP2040, while pico-examples provides a compilation framework for us to add our own programs according to the compilation framework provided by pico-examples. pico-sdk provides some APIs to operate the RP2040, while pico-examples provides a compilation framework for us to add our own programs according to the compilation framework provided by pico-examples. @@ -26,14 +26,21 @@ In order to operate the IO resources on RP2040, we need a complete software envi #### RP2040 Individually control - - - - - - - + + + + + + + + + + + + + + #### Communication between CPU and RP2040 - + diff --git a/i18n/en/docusaurus-plugin-content-docs/current/x/x2l/software-development/flash.md b/i18n/en/docusaurus-plugin-content-docs/current/x/x2l/software-development/flash.md index 53b218152..98b1f7197 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/x/x2l/software-development/flash.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/x/x2l/software-development/flash.md @@ -1,5 +1,5 @@ --- -sidebar_position: 30 +sidebar_position: 2 --- # Burning diff --git a/i18n/en/docusaurus-plugin-content-docs/current/x/x2l/software-development/gpio.md b/i18n/en/docusaurus-plugin-content-docs/current/x/x2l/software-development/gpio.md index 7573da0ce..ae4ddeb58 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/x/x2l/software-development/gpio.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/x/x2l/software-development/gpio.md @@ -1,5 +1,5 @@ --- -sidebar_position: 10 +sidebar_position: 1 --- # GPIO diff --git a/i18n/en/docusaurus-plugin-content-docs/current/x/x2l/software-development/micro_python.md b/i18n/en/docusaurus-plugin-content-docs/current/x/x2l/software-development/micro_python.md index d91ab4bd0..c9dc2fa36 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/x/x2l/software-development/micro_python.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/x/x2l/software-development/micro_python.md @@ -1,5 +1,5 @@ --- -sidebar_position: 30 +sidebar_position: 3 --- # MicroPython diff --git a/i18n/en/docusaurus-plugin-content-docs/current/x/x4/software/c-sdk-windows.md b/i18n/en/docusaurus-plugin-content-docs/current/x/x4/software/c-sdk-windows.md new file mode 100644 index 000000000..9070bcbf6 --- /dev/null +++ b/i18n/en/docusaurus-plugin-content-docs/current/x/x4/software/c-sdk-windows.md @@ -0,0 +1,46 @@ +--- +sidebar_position: 5 +--- + +import PICO_SDK_WINDOWS from "../../../common/dev/\_pico-sdk-windows.mdx"; +import GPIO from "../../../common/dev/\_pico-gpio.mdx"; +import PWM from "../../../common/dev/\_pico-pwm.mdx"; +import I2C from "../../../common/dev/\_pico-i2c.mdx"; +import PoE from "../../../common/dev/\_pico-poe-fan.mdx"; +import FAN from "../../../common/dev/\_pico-fan.mdx"; +import RELATION from "./\_relation.mdx" +import UART from "../../../common/dev/\_pico-uart.mdx"; + +# Control RP2040 on Windows + +## Relation introduction between J4215 and 40-PIN GPIO + + + + + +## Flash + +Press the BOOTSEL key and a USB device will pop up. Copy the compiled .uf2 file to the USB device of RP2040 and wait until the USB device disappears, then the programme will start to execute. + +## Examples + +### RP2040 Control the 40-PIN + + + + + + + + + + + + + + + + + + diff --git a/i18n/en/docusaurus-plugin-content-docs/current/x/x4/software/c_sdk_examples.md b/i18n/en/docusaurus-plugin-content-docs/current/x/x4/software/c_sdk_examples.md index a11f7ce7b..da394a270 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/x/x4/software/c_sdk_examples.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/x/x4/software/c_sdk_examples.md @@ -1,5 +1,5 @@ --- -sidebar_position: 2 +sidebar_position: 4 --- import SDK_EXAMPLE from "../../../common/dev/\_pico-sdk-example.mdx"; @@ -12,10 +12,12 @@ import RELATION from "./\_relation.mdx" import UART from "../../../common/dev/\_pico-uart.mdx"; import INTEL_UART from "../../../common/dev/\_pico-gpio-controlled-by-intel.mdx"; -# 40-PIN Usage +# Control RP2040 on Linux ## OverView +## Relation introduction between J4215 and 40-PIN GPIO + ## Tools Introduction @@ -30,19 +32,19 @@ In order to operate the IO resources on RP2040, we need a complete software envi - + - + - + - + - + @@ -50,9 +52,9 @@ In order to operate the IO resources on RP2040, we need a complete software envi - + - + diff --git a/i18n/en/docusaurus-plugin-content-docs/current/x/x4/software/flash.md b/i18n/en/docusaurus-plugin-content-docs/current/x/x4/software/flash.md index 43f4a204c..4a84504c8 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/x/x4/software/flash.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/x/x4/software/flash.md @@ -1,5 +1,5 @@ --- -sidebar_position: 3 +sidebar_position: 2 --- # Flash program to RP2040 diff --git a/i18n/en/docusaurus-plugin-content-docs/current/x/x4/software/micro_python.md b/i18n/en/docusaurus-plugin-content-docs/current/x/x4/software/micro_python.md index 07858f6a5..662f1abc1 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/x/x4/software/micro_python.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/x/x4/software/micro_python.md @@ -1,5 +1,5 @@ --- -sidebar_position: 30 +sidebar_position: 3 --- import GPIO from "../../../common/dev/\_micropython-gpio.mdx" diff --git a/static/img/x/cmake_install.webp b/static/img/x/cmake_install.webp new file mode 100644 index 000000000..2b5d21653 Binary files /dev/null and b/static/img/x/cmake_install.webp differ diff --git a/static/img/x/cmake_ninja.webp b/static/img/x/cmake_ninja.webp new file mode 100644 index 000000000..ddddae96d Binary files /dev/null and b/static/img/x/cmake_ninja.webp differ diff --git a/static/img/x/env_path.webp b/static/img/x/env_path.webp new file mode 100644 index 000000000..d157199eb Binary files /dev/null and b/static/img/x/env_path.webp differ diff --git a/static/img/x/git_for_windows.webp b/static/img/x/git_for_windows.webp new file mode 100644 index 000000000..7884cafd1 Binary files /dev/null and b/static/img/x/git_for_windows.webp differ diff --git a/static/img/x/ninja_build.webp b/static/img/x/ninja_build.webp new file mode 100644 index 000000000..7b1524f9c Binary files /dev/null and b/static/img/x/ninja_build.webp differ diff --git a/static/img/x/pico-sdk_install.webp b/static/img/x/pico-sdk_install.webp new file mode 100644 index 000000000..0badec8bf Binary files /dev/null and b/static/img/x/pico-sdk_install.webp differ diff --git a/static/img/x/pico-sdk_path.webp b/static/img/x/pico-sdk_path.webp new file mode 100644 index 000000000..a4bac24c3 Binary files /dev/null and b/static/img/x/pico-sdk_path.webp differ diff --git a/static/img/x/pico_install_path.webp b/static/img/x/pico_install_path.webp new file mode 100644 index 000000000..2d01a5a2d Binary files /dev/null and b/static/img/x/pico_install_path.webp differ diff --git a/static/img/x/pico_var_env.webp b/static/img/x/pico_var_env.webp new file mode 100644 index 000000000..3f63ca68b Binary files /dev/null and b/static/img/x/pico_var_env.webp differ diff --git a/static/img/x/vscode_install.webp b/static/img/x/vscode_install.webp new file mode 100644 index 000000000..83224cbf3 Binary files /dev/null and b/static/img/x/vscode_install.webp differ