Skip to content

docs: 添加 Milk-V Duo (256M) LED Blink 插件使用案例#141

Open
3077126169lin-rgb wants to merge 1 commit into
ruyisdk:zhfrom
3077126169lin-rgb:add-case3-milkv-duo-256m-blink
Open

docs: 添加 Milk-V Duo (256M) LED Blink 插件使用案例#141
3077126169lin-rgb wants to merge 1 commit into
ruyisdk:zhfrom
3077126169lin-rgb:add-case3-milkv-duo-256m-blink

Conversation

@3077126169lin-rgb

@3077126169lin-rgb 3077126169lin-rgb commented Jun 9, 2026

Copy link
Copy Markdown

概述

本 PR 在「插件使用案例」分类下新增了 case3:Milk-V Duo (256M) LED Blink:使用 RuyiSDK 示例完成外设开发

内容说明

本案例演示了如何利用插件中的 RuyiSDK 示例 功能,找到 Milk-V Duo (256M) 开发板的 LED Blink 示例,并通过插件的包管理、虚拟环境和源码解包能力,完成从查找示例到板载 LED 闪烁的完整开发流程。

主要步骤包括:

  1. 通过 RuyiSDK 示例(Home 面板或命令面板
    uyi.board-docs\)查找 LED Blink 示例
  2. 安装 gnu-plct 工具链
  3. 创建 milkv-duo 虚拟环境
  4. 通过 Extract RuyiSDK Package 解包 milkv-duo-examples 源码
  5. 编译 LED 闪烁程序
  6. 传输到开发板并运行
  7. 恢复系统原有 LED 功能

与现有案例的区别

案例 开发板 示例 侧重
case1 LicheePi 4A CoreMark 构建流程
case2 Milk-V Duo (64M) 构建与调试 构建与远程调试
case3(本 PR) Milk-V Duo (256M) LED Blink RuyiSDK 示例功能 + 外设开发

本案例的特色:

  • 首个以 RuyiSDK 示例功能 为入口的案例,展示从示例面板查找和阅读文档的完整流程
  • 首个 外设交互 案例(GPIO LED 闪烁),区别于纯软件构建
  • Milk-V Duo (256M) 是搭载 SG2002 芯片的升级版,与 case2 的 64M 版本(CV1800B)为不同型号

参考来源

Summary by Sourcery

Documentation:

  • Document a step-by-step Milk-V Duo (256M) LED Blink workflow leveraging RuyiSDK examples, package management, virtual environments, and source extraction.

@sourcery-ai

sourcery-ai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Adds a new VSCode plugin usage case document (case3) describing how to use the RuyiSDK Examples feature with a Milk-V Duo (256M) board to build and run an LED blink demo end-to-end, including toolchain setup, virtual environment, source extraction, build, deployment, and cleanup.

Flow diagram for Milk-V Duo LED Blink development using RuyiSDK Examples

flowchart TD
    Dev[Developer] --> VSCode[VSCode RuyiSDK_Extension]

    VSCode --> Home[Open Ruyi Home and RuyiSDK Examples]
    Home --> SelectBoard[Select MilkV_Duo_256M Blink example]

    VSCode --> Packages[Install gnu_plct toolchain]
    VSCode --> Venv[Create milkv_duo virtual_environment]

    VSCode --> Extract[Extract RuyiSDK_Package milkv_duo_examples]
    Extract --> Source[Local blink source directory]

    Source --> Build[Build blink with riscv64_plct_linux_gnu_gcc]
    Build --> Binary[Blink binary]

    Binary --> SCP[scp to board 192_168_42_1]
    SCP --> Board[MilkV_Duo_256M board]

    Board --> DisableSysBlink[Disable system blink_sh and reboot]
    DisableSysBlink --> RunBlink[Run ./blink and observe LED]
    RunBlink --> RestoreSysBlink[Restore blink_sh and reboot]
Loading

File-Level Changes

Change Details Files
Document a new Milk-V Duo (256M) LED Blink end-to-end workflow using the RuyiSDK VSCode plugin examples feature.
  • Introduce a new case3 markdown page under VSCode-Plugins/cases with sidebar metadata for navigation ordering.
  • Describe prerequisites for using the RuyiSDK VSCode extension with a Milk-V Duo (256M) board on the same network.
  • Detail step-by-step usage of the Ruyi: Home and RuyiSDK Examples panels (and ruyi.board-docs command) to locate and read the Blink example for Milk-V Duo (256M).
  • Explain installing the gnu-plct toolchain via the Packages view and creating/activating a milkv-duo virtual environment bound to that toolchain.
  • Describe extracting the milkv-duo-examples package via Extract RuyiSDK Package and building the blink sample with riscv64-plct-linux-gnu-gcc using the proper include and library paths.
  • Provide instructions for copying the compiled binary to the board via scp, running it over SSH, temporarily disabling the system LED script to avoid conflicts, and later restoring the default LED behavior.
  • Add remarks clarifying board model differences (Duo 256M vs 64M) and optional Copilot / QEMU usage from the examples panel.
VSCode-Plugins/cases/case3.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="VSCode-Plugins/cases/case3.md" line_range="11" />
<code_context>
+
+## 前置条件
+
+- 已安装 RuyiSDK VSCode 扩展(如未安装,可在 VSCode 扩展市场搜索 RuyiSDK 安装)
+- 已连接互联网(RuyiSDK 示例功能需要网络)
+- 已准备 Milk-V Duo (256M) 开发板,并已完成系统启动(参考 [Milk-V Duo 官方文档](https://milkv.io/zh/docs/duo/getting-started/boot))
</code_context>
<issue_to_address>
**nitpick (typo):** 可以考虑将“VSCode”统一改为官方写法“VS Code”以保持专有名词拼写规范。

文中多处出现“VSCode”(包括本行和“在 VSCode 中打开”按钮)。建议统一改为“VS Code”以与微软官方写法保持一致,是否采纳可按团队约定决定。

Suggested implementation:

```
- 已安装 RuyiSDK VS Code 扩展(如未安装,可在 VS Code 扩展市场搜索 RuyiSDK 安装)

```

文档中其它位置若存在“VSCode”(例如按钮文案“在 VSCode 中打开”等),也应统一替换为“VS Code”,包括:
1. 普通文本中出现的“VSCode”。
2. UI 按钮、菜单项等出现的“VSCode”。
请在整个文档和相关翻译/配置文件中搜索“VSCode”并统一替换为“VS Code”,以保持专有名词拼写一致。
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.


## 前置条件

- 已安装 RuyiSDK VSCode 扩展(如未安装,可在 VSCode 扩展市场搜索 RuyiSDK 安装)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick (typo): 可以考虑将“VSCode”统一改为官方写法“VS Code”以保持专有名词拼写规范。

文中多处出现“VSCode”(包括本行和“在 VSCode 中打开”按钮)。建议统一改为“VS Code”以与微软官方写法保持一致,是否采纳可按团队约定决定。

Suggested implementation:

- 已安装 RuyiSDK VS Code 扩展(如未安装,可在 VS Code 扩展市场搜索 RuyiSDK 安装)

文档中其它位置若存在“VSCode”(例如按钮文案“在 VSCode 中打开”等),也应统一替换为“VS Code”,包括:

  1. 普通文本中出现的“VSCode”。
  2. UI 按钮、菜单项等出现的“VSCode”。
    请在整个文档和相关翻译/配置文件中搜索“VSCode”并统一替换为“VS Code”,以保持专有名词拼写一致。

@3077126169lin-rgb
3077126169lin-rgb force-pushed the add-case3-milkv-duo-256m-blink branch 9 times, most recently from eeb900e to 1b8017e Compare June 15, 2026 08:26
@3077126169lin-rgb
3077126169lin-rgb force-pushed the add-case3-milkv-duo-256m-blink branch from 1b8017e to 9e9fb4d Compare June 15, 2026 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant