klipper icon indicating copy to clipboard operation
klipper copied to clipboard

Add support for gd32f303xe MCU temperature used on Creality K1 Max (and others)

Open happytechca opened this issue 9 months ago • 6 comments

Summary

This PR adds support for the gd32f303xe MCU, which is used in the Creality K1 Max and other printers, by adding necessary code into temperature_mcu.py.

Background

I recently converted my Creality K1 Max printer to mainline Klipper, moving away from Creality's forked version. However, I discovered that the gd32f303xe MCU—which is used for the toolhead or temperature sensor MCU—is not currently supported in upstream Klipper.

Error message upon starting: MCU temperature not supported on gd32f303xe

image

Changes Made

  • Modified temperature_mcu.py to add support for the gd32f303xe MCU.
  • Only 4 lines of code were added to include this MCU in the supported list.

Testing

  • Verified functionality by ensuring correct temperature readings and general toolhead operation.
  • Printed multiple test models without issues.
  • No other functionality is affected beyond enabling this MCU.

Signed-off-by: Serge Latulippe [email protected]

happytechca avatar Feb 26 '25 18:02 happytechca

Thanks, but this Klipper repo doesn't support mcus that report gd32f303 as the cpu type, and we don't add code to this repo to support external modifications.

-Kevin

KevinOConnor avatar Feb 27 '25 00:02 KevinOConnor

@KevinOConnor Understood, thank you. Any plans on having support for GD32 based MCUs? What are the roadblocks? From my understanding, they are quite similar to the STM32Fxxx series

happytechca avatar Feb 28 '25 16:02 happytechca

My rough understanding is that the gd32f303 chips are supported by Klipper - one selects an stm32f103 chip during "make menuconfig". I'm not sure what code you are running.

-Kevin

KevinOConnor avatar Feb 28 '25 17:02 KevinOConnor

I can confirm GD32F303 and GD32F103 are clones that are code compatible with the STM32F103 chip. With the GD32F303 actually being more compatible than its GD32F103 counterpart, as that needs the Disable SWD at startup setting in the make, whereas the F303 usually does not.

Creality have been using these since pandemic times, as they were more available and likely cheaper, also Sovol uses them too. Klipper compiled firmware works on these fine. Unless the K1 has modifications to the hardware that would make it not work.

Thanks James

JamesH1978 avatar Mar 05 '25 12:03 JamesH1978

My rough understanding is that the gd32f303 chips are supported by Klipper - one selects an stm32f103 chip during "make menuconfig". I'm not sure what code you are running.

-Kevin

They are supported and work fine. Just reading they temperature is not, which is fixed by this commit. And it also works fine.

Hawk84r avatar Mar 09 '25 05:03 Hawk84r

Thank you for your contribution to Klipper. Unfortunately, a reviewer has not assigned themselves to this GitHub Pull Request. All Pull Requests are reviewed before merging, and a reviewer will need to volunteer. Further information is available at: https://www.klipper3d.org/CONTRIBUTING.html

There are some steps that you can take now:

  1. Perform a self-review of your Pull Request by following the steps at: https://www.klipper3d.org/CONTRIBUTING.html#what-to-expect-in-a-review If you have completed a self-review, be sure to state the results of that self-review explicitly in the Pull Request comments. A reviewer is more likely to participate if the bulk of a review has already been completed.
  2. Consider opening a topic on the Klipper Discourse server to discuss this work. The Discourse server is a good place to discuss development ideas and to engage users interested in testing. Reviewers are more likely to prioritize Pull Requests with an active community of users.
  3. Consider helping out reviewers by reviewing other Klipper Pull Requests. Taking the time to perform a careful and detailed review of others work is appreciated. Regular contributors are more likely to prioritize the contributions of other regular contributors.

Unfortunately, if a reviewer does not assign themselves to this GitHub Pull Request then it will be automatically closed. If this happens, then it is a good idea to move further discussion to the Klipper Discourse server. Reviewers can reach out on that forum to let you know if they are interested and when they are available.

Best regards, ~ Your friendly GitIssueBot

PS: I'm just an automated script, not a human being.

github-actions[bot] avatar Mar 23 '25 12:03 github-actions[bot]

@happytechca, could you can share full configuration? Which pins did you select as serial? I can flash K1 toolhead but something seems to be wrong, it does not start, pellcorp firmware does work.

kemsky avatar Jun 30 '25 23:06 kemsky