Skip to content

gd32: add GD32F303 and GD32E230 support - #191

Draft
sendu2wfdx wants to merge 4 commits into
Arksine:masterfrom
sendu2wfdx:upstream-gd32-v1
Draft

sendu2wfdx wants to merge 4 commits into
Arksine:masterfrom
sendu2wfdx:upstream-gd32-v1

Conversation

@sendu2wfdx

@sendu2wfdx sendu2wfdx commented Sep 9, 2026 •

Copy link
Copy Markdown

Summary

Add GD32F303 and GD32E230 support through Katapult's existing src/stm32/ platform instead of maintaining a parallel GD32 backend.

GD32F303 reuses the STM32F1 GPIO, serial, USB, CAN, chip-ID, flash, and startup paths, with localized support for the Cortex-M4 core and 120 MHz GD32 clock/power behavior. GD32E230 also uses src/stm32/, sharing the common GPIO and STM32F0-style serial paths while keeping localized clock, timer, and flash programming code.

To match the existing STM32 menu style, the processor entries and exported MCU constants use the family names GigaDevice GD32F303 / gd32f303 and GigaDevice GD32E230 / gd32e230. GD32F303 uses a conservative xB link profile (128 KiB Flash, 32 KiB RAM), which runs on the validated xB and xC parts and leaves additional memory unused on larger densities. GD32E230 targets the validated x8 profile (64 KiB Flash, 8 KiB RAM). Internal use of an STM32F103 compatibility header does not change the reported model.

Supported models and validation status

Hardware validated:

  • GD32F303xB (GD32F303CBT6 nozzle board), hardware serial
  • GD32F303xC (GD32F303RCT6 motion board), hardware serial
  • GD32E230x8 (GD32E230F8P6 bed/leveling board), hardware serial
  • GD32F303xC development board (GD32F303CCT6), TTL serial, USB CDC, and classic CAN

The same conservative GD32F303 build profile is expected to run on xE devices, but xE has not been hardware tested. GD32E230x6 is not advertised because this series entry intentionally uses the validated x8 memory profile.

On all three production boards the contributor confirmed Katapult entry, firmware upload, and Klipper application jump over the internal 230400-baud serial links. The separate GD32F303CCT6 development board validates all three transport implementations.

Build validation

Built from current Katapult upstream with the Arm GNU toolchain:

  • GD32F303 hardware serial: PASS
  • GD32F303 USB CDC: PASS
  • GD32F303 classic CAN: PASS
  • GD32E230 serial on both supported USART pin mappings: PASS
  • Existing STM32F1 regression configuration: PASS

Generated ELFs export gd32f303 or gd32e230; the build system privately maps GD32F303 to the compatible STM32F103 CMSIS target.

Third-party material

The GD32E23x device headers are derived from CrealityOfficial/Ender-3_V3_KE_Klipper commit a63fb1a71672b91b505e0bda68fae2ede49f1168, path lib/gd32e23x/. They identify themselves as GigaDevice GD32E23x V1.1.0 (2020-12-12) and retain GigaDevice's BSD-3-Clause notice.

core_cm23.h matches Arm CMSIS 5.7.0 commit a65b7c9a3e6502127fdb80eb288d8cbdf251a6f4 and retains Apache-2.0 licensing.

GD32F303 does not add a separate vendor-header tree; it uses Katapult's existing STM32F1 CMSIS definitions internally.

Review notes

This candidate excludes product-specific configuration, private CI, Windows-only helper scripts, GD32F425 support, and the experimental USB double-buffer transmit path.

Signed-off-by: Xiaoyue Cui <2508041672@qq.com>
@sendu2wfdx
sendu2wfdx marked this pull request as draft September 9, 2026 10:46
Signed-off-by: Xiaoyue Cui <2508041672@qq.com>
Signed-off-by: Xiaoyue Cui <2508041672@qq.com>
Signed-off-by: Xiaoyue Cui <2508041672@qq.com>
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