Skip to content

Conversation

@MuChenger
Copy link
Contributor

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

[

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

add gd32470i-eval bsp

]

当前拉取/合并请求的状态 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自查

@github-actions github-actions bot added BSP BSP: GD32 BSP related with GD32 labels Sep 2, 2025
@Rbb666 Rbb666 requested a review from Copilot September 2, 2025 03:23
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 PR adds support for the GD32470I-EVAL board, expanding RT-Thread's hardware support to include this GigaDevice evaluation board based on the GD32F470ZG microcontroller.

  • Adds complete BSP implementation for GD32470I-EVAL board
  • Includes IDE project templates for Keil µVision and IAR EWARM
  • Provides build configuration and board-specific settings

Reviewed Changes

Copilot reviewed 35 out of 36 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
template.uvprojx Keil µVision project file with device configuration for GD32F470ZG
template.uvproj Keil µVision legacy project file with peripheral driver references
template.uvoptx Keil µVision project options for debugging and compilation settings
template.ewp IAR EWARM project file with compiler and linker configurations
rtconfig.py Python build configuration script with toolchain settings
rtconfig.h RT-Thread configuration header with kernel and driver settings

<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>
<Device>GD32F450ZK</Device>
Copy link

Copilot AI Sep 2, 2025

Choose a reason for hiding this comment

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

bug / 错误: Device specification mismatch. The file is for GD32470I-EVAL board but specifies GD32F450ZK device instead of GD32F470ZG.

English: The device configuration incorrectly specifies GD32F450ZK instead of the expected GD32F470ZG for the 470I-EVAL board.
中文:设备配置错误地指定了 GD32F450ZK 而不是 470I-EVAL 板预期的 GD32F470ZG。

Suggested change
<Device>GD32F450ZK</Device>
<Device>GD32F470ZG</Device>

Copilot uses AI. Check for mistakes.
Comment on lines 18 to 21
<Cpu>IRAM(0x20000000-0x20030000) IRAM2(0x10000000-0x10010000) IROM(0x08000000-0x08300000) CLOCK(25000000) CPUTYPE("Cortex-M4") FPU2</Cpu>
<FlashUtilSpec></FlashUtilSpec>
<StartupFile>"Startup\GD\GD32F4xx\startup_gd32f4xx.s" ("GD32F4xx Startup Code")</StartupFile>
<FlashDriverDll>UL2CM3(-O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F4xx_3MB -FS08000000 -FL0300000)</FlashDriverDll>
Copy link

Copilot AI Sep 2, 2025

Choose a reason for hiding this comment

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

bug / 错误: Memory configuration mismatch for GD32F470ZG device. The ROM size specifies 3MB (0x300000) but GD32F470ZG has 1MB flash.

English: The CPU configuration specifies incorrect memory sizes - ROM shows 3MB but GD32F470ZG has 1MB flash memory.
中文:CPU 配置指定了错误的内存大小 - ROM 显示 3MB 但 GD32F470ZG 只有 1MB 闪存。

Suggested change
<Cpu>IRAM(0x20000000-0x20030000) IRAM2(0x10000000-0x10010000) IROM(0x08000000-0x08300000) CLOCK(25000000) CPUTYPE("Cortex-M4") FPU2</Cpu>
<FlashUtilSpec></FlashUtilSpec>
<StartupFile>"Startup\GD\GD32F4xx\startup_gd32f4xx.s" ("GD32F4xx Startup Code")</StartupFile>
<FlashDriverDll>UL2CM3(-O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F4xx_3MB -FS08000000 -FL0300000)</FlashDriverDll>
<Cpu>IRAM(0x20000000-0x20030000) IRAM2(0x10000000-0x10010000) IROM(0x08000000-0x08100000) CLOCK(25000000) CPUTYPE("Cortex-M4") FPU2</Cpu>
<FlashUtilSpec></FlashUtilSpec>
<StartupFile>"Startup\GD\GD32F4xx\startup_gd32f4xx.s" ("GD32F4xx Startup Code")</StartupFile>
<FlashDriverDll>UL2CM3(-O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0GD32F4xx_1MB -FS08000000 -FL0100000)</FlashDriverDll>

Copilot uses AI. Check for mistakes.
<IRAM>
<Type>0</Type>
<StartAddress>0x20000000</StartAddress>
<Size>0x30000</Size>
Copy link

Copilot AI Sep 2, 2025

Choose a reason for hiding this comment

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

bug / 错误: IRAM size configuration inconsistent with GD32F470ZG specifications. Shows 0x30000 (192KB) but should be 0x70000 (448KB).

English: The IRAM size is configured as 192KB but GD32F470ZG has 448KB of RAM according to the device specifications.
中文:IRAM 大小配置为 192KB,但根据设备规格,GD32F470ZG 有 448KB 的 RAM。

Suggested change
<Size>0x30000</Size>
<Size>0x70000</Size>

Copilot uses AI. Check for mistakes.
<IROM>
<Type>1</Type>
<StartAddress>0x8000000</StartAddress>
<Size>0x300000</Size>
Copy link

Copilot AI Sep 2, 2025

Choose a reason for hiding this comment

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

bug / 错误: IROM size configuration incorrect for GD32F470ZG. Shows 0x300000 (3MB) but device has 0x100000 (1MB) flash.

English: The IROM size is configured as 3MB but GD32F470ZG only has 1MB of flash memory.
中文:IROM 大小配置为 3MB,但 GD32F470ZG 只有 1MB 的闪存。

Suggested change
<Size>0x300000</Size>
<Size>0x100000</Size>

Copilot uses AI. Check for mistakes.
<OCR_RVCT4>
<Type>1</Type>
<StartAddress>0x8000000</StartAddress>
<Size>0x300000</Size>
Copy link

Copilot AI Sep 2, 2025

Choose a reason for hiding this comment

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

bug / 错误: OCR_RVCT4 ROM configuration shows 3MB instead of 1MB for GD32F470ZG device.

English: Another instance of incorrect ROM size configuration - should be 0x100000 (1MB) not 0x300000 (3MB).
中文:ROM 大小配置的另一个错误实例 - 应该是 0x100000 (1MB) 而不是 0x300000 (3MB)。

Suggested change
<Size>0x300000</Size>
<Size>0x100000</Size>

Copilot uses AI. Check for mistakes.
<OCR_RVCT9>
<Type>0</Type>
<StartAddress>0x20000000</StartAddress>
<Size>0x30000</Size>
Copy link

Copilot AI Sep 2, 2025

Choose a reason for hiding this comment

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

bug / 错误: OCR_RVCT9 RAM configuration shows 192KB instead of 448KB for GD32F470ZG device.

English: The OCR_RVCT9 RAM size should be 0x70000 (448KB) to match the GD32F470ZG specifications.
中文:OCR_RVCT9 RAM 大小应该是 0x70000 (448KB) 以匹配 GD32F470ZG 规格。

Suggested change
<Size>0x30000</Size>
<Size>0x70000</Size>

Copilot uses AI. Check for mistakes.
# EXEC_PATH is the compiler execute path, for example, CodeSourcery, Keil MDK, IAR
if CROSS_TOOL == 'gcc':
PLATFORM = 'gcc'
EXEC_PATH = r'C:\Users\XXYYZZ'
Copy link

Copilot AI Sep 2, 2025

Choose a reason for hiding this comment

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

[nitpick] best_practices / 最佳实践: Hardcoded placeholder path should be replaced with appropriate default or environment detection.

English: The placeholder path 'C:\Users\XXYYZZ' should be replaced with a more meaningful default or better environment detection logic.
中文:占位符路径 'C:\Users\XXYYZZ' 应该替换为更有意义的默认值或更好的环境检测逻辑。

Copilot uses AI. Check for mistakes.
OBJDUMP = PREFIX + 'objdump'
OBJCPY = PREFIX + 'objcopy'

DEVICE = ' -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections -DGD32F450'
Copy link

Copilot AI Sep 2, 2025

Choose a reason for hiding this comment

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

bug / 错误: Compiler macro defines GD32F450 instead of GD32F470 for the 470I-EVAL board.

English: The device macro should be -DGD32F470 to match the actual target device, not -DGD32F450.
中文:设备宏应该是 -DGD32F470 以匹配实际目标设备,而不是 -DGD32F450。

Suggested change
DEVICE = ' -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections -DGD32F450'
DEVICE = ' -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections -DGD32F470'

Copilot uses AI. Check for mistakes.
@Rbb666 Rbb666 merged commit c1e9403 into RT-Thread:master Sep 2, 2025
35 checks passed
tomjielii pushed a commit to tomjielii/rt-thread that referenced this pull request Sep 9, 2025
tomjielii pushed a commit to tomjielii/rt-thread that referenced this pull request Sep 12, 2025
@Rbb666 Rbb666 added this to the v5.2.2 milestone Sep 23, 2025
@MuChenger MuChenger deleted the gd32f470 branch October 29, 2025 08:01
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