Skip to content

Conversation

@kurisaW
Copy link
Member

@kurisaW kurisaW commented Nov 26, 2025

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

[

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

目前gd32/arm下的各系列芯片bsp驱动并不兼容,另外驱动中存在大量硬编码代码,对于平台移植开箱即用不是很友好

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

1.先针对基础驱动(GPIO、UART)进行统一与优化
2.对于不同系列的bsp,在串口配置信息这块统一由各自bsp级别定义

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

我个人在H7全系列,gd32f527ist7测试通过,并召集GD32兴趣小组协助测试过

  • BSP:
  • .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
  • 已经使用formatting 等源码格式化工具确保格式符合RT-Thread代码规范 This PR complies with RT-Thread code specification
  • 如果是新增bsp, 已经添加ci检查到.github/ALL_BSP_COMPILE.json 详细请参考链接BSP自查

@kurisaW kurisaW requested a review from Rbb666 November 26, 2025 05:36
@github-actions
Copy link

👋 感谢您对 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

  • 设置需排除的文件/目录(目录请以"/"结尾)
    Set files/directories to exclude (directories should end with "/")
  • 将目标分支设置为 \ Set the target branch to:gd32
  • 设置PR number为 \ Set the PR number to:10981
  1. 等待工作流完成 | Wait for the workflow to complete
    格式化后的代码将自动推送至你的分支。
    The formatted code will be automatically pushed to your branch.

完成后,提交将自动更新至 gd32 分支,关联的 Pull Request 也会同步更新。
Once completed, commits will be pushed to the gd32 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
Copy link

github-actions bot commented Nov 26, 2025

📌 Code Review Assignment

🏷️ Tag: bsp_gd32105c-eval

Reviewers: CXSforHPU

Changed Files (Click to expand)
  • bsp/gd32/arm/gd32105c-eval/.config
  • bsp/gd32/arm/gd32105c-eval/board/Kconfig
  • bsp/gd32/arm/gd32105c-eval/project.ewp
  • bsp/gd32/arm/gd32105c-eval/project.uvoptx
  • bsp/gd32/arm/gd32105c-eval/project.uvprojx
  • bsp/gd32/arm/gd32105c-eval/rtconfig.h

📊 Current Review Status (Last Updated: 2025-11-26 14:09 CST)

  • CXSforHPU Pending Review

📝 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.

@github-actions github-actions bot added BSP BSP: GD32 BSP related with GD32 labels Nov 26, 2025
@Rbb666
Copy link
Member

Rbb666 commented Nov 26, 2025

@kurisaW PR的描述完善下吧

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request refactors GPIO and USART driver configurations for GD32 ARM BSPs, standardizing SOC naming conventions and introducing Serial V2 framework support.

  • Renamed SOC configuration identifiers to match GigaDevice's official naming scheme
  • Added Serial V1/V2 framework selection with comprehensive UART pin and DMA configuration options
  • Updated project files (Keil, IAR) to use new package paths and remove IDE-generated metadata

Reviewed changes

Copilot reviewed 38 out of 123 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
bsp/gd32/arm/*/board/Kconfig Added Serial V2 framework support, UART pin configuration options, and standardized SOC names
bsp/gd32/arm/*/.config Updated configuration files to reflect new Kconfig structure and removed obsolete options
bsp/gd32/arm/*/rtconfig.h Changed SOC macro definitions to official GigaDevice naming and added Serial V1 defines
bsp/gd32/arm/*/project.uvprojx Updated Keil project files with new package paths and removed auto-generated XML formatting
bsp/gd32/arm/*/project.uvoptx Removed *.md from text file extensions and deleted redundant group definitions
bsp/gd32/arm/*/project.ewp Updated IAR project files with reordered include paths and compiler defines

default y

config SOC_GD32303C
config SOC_GD32F303CG
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

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

PR title format issue / PR 标题格式问题: The PR title "[gd32/arm][drivers]: optimize GPIO and USART drivers" lacks specific details about the changes. According to RT-Thread guidelines, the title should describe what was actually modified based on the changed files. Consider changing to something like "[gd32/arm][bsp] Update SOC naming and add Serial V2 framework support" to better reflect the actual changes. / PR 标题 "[gd32/arm][drivers]: optimize GPIO and USART drivers" 缺少具体变更细节。根据 RT-Thread 指南,标题应该基于修改的文件描述实际的变更内容。建议改为类似 "[gd32/arm][bsp] Update SOC naming and add Serial V2 framework support" 以更好地反映实际变更。

Copilot generated this review using guidance from repository custom instructions.
default "PA9"

config BSP_UART0_RX_PIN
string "UART0 RX name, such as PA9"
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

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

Documentation mismatch / 文档不匹配: The help text says "such as PA9" but the default value is "PA10". This inconsistency could confuse users. Either update the example to match the default or clarify that the example is just one possibility. / 帮助文本显示 "such as PA9" 但默认值是 "PA10"。这种不一致可能会让用户困惑。要么更新示例以匹配默认值,要么说明示例只是一种可能性。

Suggested change
string "UART0 RX name, such as PA9"
string "UART0 RX name, such as PA10"

Copilot uses AI. Check for mistakes.
Comment on lines +137 to +142
string "UART2 TX name, such as PA8"
default "PA8"

config BSP_UART2_RX_PIN
string "UART2 RX name, such as PA9"
default "PA9"
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

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

Potentially incorrect default pin configuration / 可能不正确的默认引脚配置: UART2 TX and RX both default to PA8 and PA9 respectively, which matches the example text. However, this seems like placeholder values since actual UART pin assignments should differ between UARTs. Verify these are the correct pins for UART2 on this board, or update the defaults to reflect actual hardware connections. / UART2 的 TX 和 RX 默认值分别为 PA8 和 PA9,与示例文本匹配。但这看起来像是占位符值,因为不同 UART 的实际引脚分配应该有所不同。请验证这些是否是此开发板上 UART2 的正确引脚,或更新默认值以反映实际的硬件连接。

Suggested change
string "UART2 TX name, such as PA8"
default "PA8"
config BSP_UART2_RX_PIN
string "UART2 RX name, such as PA9"
default "PA9"
string "UART2 TX name, such as PD5"
default "PD5"
config BSP_UART2_RX_PIN
string "UART2 RX name, such as PD6"
default "PD6"

Copilot uses AI. Check for mistakes.
@kurisaW
Copy link
Member Author

kurisaW commented Nov 26, 2025

@kurisaW PR的描述完善下吧

已完善

@Rbb666 Rbb666 merged commit 5706c5e into RT-Thread:master Nov 26, 2025
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BSP: GD32 BSP related with GD32 BSP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants