Skip to content

[bsp][wch] Configure fast interrupts by QingKe core - #12004

Open
kaidegit wants to merge 1 commit into
RT-Thread:masterfrom
kaidegit:feat/wch-fast-irq
Open

kaidegit wants to merge 1 commit into
RT-Thread:masterfrom
kaidegit:feat/wch-fast-irq

Conversation

@kaidegit

@kaidegit kaidegit commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

拉取/合并请求描述:(PR description)

[

为什么提交这份PR (why to submit this PR)

WCH 不同 QingKe 内核对快速中断的支持不同,对于那些只有2级硬件中断的,rtos不应该使用。现有 BSP 和驱动中的中断处理方式需要根据芯片内核能力统一配置,以便在支持的芯片上使用快速中断,同时兼容其他芯片。

顺便,更新了下sdk,解决一下v203里面需要绕过的问题

sdk更新PR:RT-Thread/packages#2052

你的解决方案是什么 (what is your solution)

  • 根据 WCH 芯片系列配置对应的 QingKe 内核及快速中断能力,提供 CONFIG_WCH_USING_FAST_IRQ 配置项。
  • 使用统一的中断属性宏,按配置选择快速中断或普通中断,并调整相关外设驱动及 BSP 的中断处理函数。
  • 更新相关 BSP 的 SDK 版本配置,并调整 CH32V203 BSP 的启动文件使用方式。

请提供验证的bsp和config (provide the config and bsp)

  • BSP:

ch32v208w-r0

ch32v307v-r1

  • .config:

默认

  • action:

]

当前拉取/合并请求的状态 Intent for your PR

必须选择一项 Choose one (Mandatory):

  • 本拉取/合并请求是一个草稿版本 This PR is for a code-review and is intended to get feedback
  • 本拉取/合并请求是一个成熟版本 This PR is mature, and ready to be integrated into the repo

代码质量 Code Quality:

我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:

  • 已经仔细查看过代码改动的对比 Already check the difference between PR and old code
  • 代码风格正确,包括缩进空格,命名及其他风格 Style guide is adhered to, including spacing, naming and other styles
  • 没有垃圾代码,代码尽量精简,不包含#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up
  • 所有变更均有原因及合理的,并且不会影响到其他软件组件代码或BSP All modifications are justified and not affect other components or BSP
  • 对难懂代码均提供对应的注释 I've commented appropriately where code is tricky
  • 代码是高质量的 Code in this PR is of high quality
  • 已经使用clang-format 源码格式化工具确保格式符合RT-Thread代码规范 This PR has been formatted with clang-format and complies with RT-Thread code specification
  • 如果是新增bsp, 已经添加ci检查到.github/ALL_BSP_COMPILE.json 详细请参考链接BSP自查

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown

👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread!

为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。
To ensure your code complies with RT-Thread's coding style, please run the code formatting workflow by following the steps below (If the formatting of CI fails to run).


🛠 操作步骤 | Steps

  1. 前往 Actions 页面 | Go to the Actions page
    点击进入工作流 → | Click to open workflow →

  2. 点击 Run workflow | Click Run workflow

  • Use workflow from 保持默认分支(通常为 master)
    Keep the default branch (usually master) in Use workflow from
  • 在 branch 输入框填写 PR 分支 feat/wch-fast-irq
    Enter PR branch feat/wch-fast-irq in the branch field
  • 设置需排除的文件/目录(目录请以"/"结尾)
    Set files/directories to exclude (directories should end with "/")
  1. 等待工作流完成 | Wait for the workflow to complete
    格式化后的代码将作为独立提交推送至你的分支。
    The formatting changes will be pushed to your branch as a separate commit.

完成后,提交将自动更新至 feat/wch-fast-irq 分支,关联的 Pull Request 也会同步更新。
Once completed, commits will be pushed to the feat/wch-fast-irq branch automatically, and the related Pull Request will be updated.

如有问题欢迎联系我们,再次感谢您的贡献!💐
If you have any questions, feel free to reach out. Thanks again for your contribution!

@github-actions github-actions Bot added BSP BSP: WCH BSP related with WCH labels Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown

📌 Code Review Assignment

🏷️ Tag: bsp_wch

Reviewers: @Maihuanyi

Changed Files (Click to expand)
  • bsp/wch/risc-v/ch32v103r-evt/.config
  • bsp/wch/risc-v/ch32v103r-evt/rtconfig.h
  • bsp/wch/risc-v/ch32v203c-evt-r0/.config
  • bsp/wch/risc-v/ch32v203c-evt-r0/README.md
  • bsp/wch/risc-v/ch32v203c-evt-r0/SConstruct
  • bsp/wch/risc-v/ch32v203c-evt-r0/board/SConscript
  • bsp/wch/risc-v/ch32v203c-evt-r0/board/startup_ch32v20x_D6.S
  • bsp/wch/risc-v/ch32v203c-evt-r0/rtconfig.h
  • bsp/wch/risc-v/ch32v208w-r0/.config
  • bsp/wch/risc-v/ch32v208w-r0/rtconfig.h
  • bsp/wch/risc-v/ch32v307v-r1/.config
  • bsp/wch/risc-v/ch32v307v-r1/board/board.c
  • bsp/wch/risc-v/ch32v307v-r1/rtconfig.h
  • bsp/wch/risc-v/ch569w-evt/.config
  • bsp/wch/risc-v/ch569w-evt/rtconfig.h
  • bsp/wch/risc-v/libraries/Kconfig
  • bsp/wch/risc-v/libraries/ch32_drivers/drv_can.c
  • bsp/wch/risc-v/libraries/ch32_drivers/drv_common.h
  • bsp/wch/risc-v/libraries/ch32_drivers/drv_eth.c
  • bsp/wch/risc-v/libraries/ch32_drivers/drv_gpio.c
  • bsp/wch/risc-v/libraries/ch32_drivers/drv_timer.c
  • bsp/wch/risc-v/libraries/ch32_drivers/drv_usart.c
  • bsp/wch/risc-v/libraries/ch32_drivers/drv_usart_v2.c
  • bsp/wch/risc-v/libraries/ch32_drivers/drv_usbh.c
  • bsp/wch/risc-v/yd-ch32v307vct6/.config
  • bsp/wch/risc-v/yd-ch32v307vct6/board/board.c
  • bsp/wch/risc-v/yd-ch32v307vct6/rtconfig.h

📊 Current Review Status (Last Updated: 2026-11-07 21:23 CST)


📝 Review Instructions

  1. 维护者可以通过单击此处来刷新审查状态: 🔄 刷新状态
    Maintainers can refresh the review status by clicking here: 🔄 Refresh Status

  2. 确认审核通过后评论 LGTM/lgtm
    Comment LGTM/lgtm after confirming approval

  3. PR合并前需至少一位维护者确认
    PR must be confirmed by at least one maintainer before merging

ℹ️ 刷新CI状态操作需要具备仓库写入权限。
ℹ️ Refresh CI status operation requires repository Write permission.

@BernardXiong BernardXiong left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

CI 在 head f11d4bd9 失败,分类如下:

  1. 构建失败(代码):wch/risc-v/ch32v203c-evt-r0 在 SConscript 阶段直接退出:CH32V20x_D6 is not supported yet.,随后 scons -j4 以及 scons --dist 的 default / devices.gpio / devices.uart 均失败。本 PR 删除了该 BSP 自带的 board/startup_ch32v20x_D6.S,请确认内核/启动文件选择路径仍然支持 D6。
    构建日志:https://github.com/RT-Thread/rt-thread/actions/runs/42376766475

  2. 格式检查失败:30 处 clang-format 违规,涉及 10 个改动文件:drv_eth.c、drv_can.c、drv_common.h、drv_gpio.c、drv_timer.c、drv_usart.c、drv_usart_v2.c、drv_usbh.c、ch32v307v-r1/board/board.c、yd-ch32v307vct6/board/board.c。请用仓库固定的 clang-format 22.1.8 处理。

  3. 静态分析失败:cppcheck 报 drv_eth.c:685 Possible null pointer dereference: p [nullPointer]。该行 dump_hex(buffer, p->tot_len) 位于 #ifdef ETH_RX_DUMP 中,pbuf_alloc() 可能返回 NULL;这一行不是本 PR 修改的,但文件被本 PR 触及后检查变红,建议一并处理或明确豁免。

  4. ch32v208w-r0 的 CH32V20x_SDK v2.5 下载失败属于基础设施/网络问题,不是代码问题。

本轮先不做完整代码 review;修复 1-3、重跑 CI 后再基于新 head 复查。

@kaidegit

kaidegit commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

要packages那个先合进去,ci才会成功。

@kaidegit

kaidegit commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

所以其实对于bsp适配,加sdk这种两个仓库都要动的,其实ci至少有一边是会挂的。

@kaidegit kaidegit mentioned this pull request Nov 8, 2026
9 of 10 tasks

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BSP: WCH BSP related with WCH BSP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants