-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[gd32/arm][drivers]: optimize GPIO and USART drivers #10981
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
📌 Code Review Assignment🏷️ Tag: bsp_gd32105c-evalReviewers: CXSforHPU Changed Files (Click to expand)
📊 Current Review Status (Last Updated: 2025-11-26 14:09 CST)
📝 Review Instructions
|
|
@kurisaW PR的描述完善下吧 |
There was a problem hiding this 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 |
Copilot
AI
Nov 26, 2025
There was a problem hiding this comment.
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" 以更好地反映实际变更。
| default "PA9" | ||
|
|
||
| config BSP_UART0_RX_PIN | ||
| string "UART0 RX name, such as PA9" |
Copilot
AI
Nov 26, 2025
There was a problem hiding this comment.
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"。这种不一致可能会让用户困惑。要么更新示例以匹配默认值,要么说明示例只是一种可能性。
| string "UART0 RX name, such as PA9" | |
| string "UART0 RX name, such as PA10" |
| string "UART2 TX name, such as PA8" | ||
| default "PA8" | ||
|
|
||
| config BSP_UART2_RX_PIN | ||
| string "UART2 RX name, such as PA9" | ||
| default "PA9" |
Copilot
AI
Nov 26, 2025
There was a problem hiding this comment.
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 的正确引脚,或更新默认值以反映实际的硬件连接。
| 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" |
已完善 |
拉取/合并请求描述:(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兴趣小组协助测试过
]
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up