# Support for HDSC chips (HC32F460)

**URL:** <https://klipper.discourse.group/t/support-for-hdsc-chips-hc32f460/2860>\
**Category:** Features\
**Created:** [May 11, 2022, 2:19am UTC](https://klipper.discourse.group/t/support-for-hdsc-chips-hc32f460/2860 "2022-05-11T02:19:29Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmperou](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@jmperou](https://klipper.discourse.group/u/jmperou)\
**Post date:** [May 11, 2022, 2:19am UTC](https://klipper.discourse.group/t/support-for-hdsc-chips-hc32f460/2860/1 "2022-05-11T02:19:29Z")

</div>

Wondering if support for this chipset can be built? The Anycubic Kobra and Kobra Max both use these chipsets but they seem to be unsupported as of this time. Thanks.

---

<div class="post-metadata">

**Author:** ![koconnor](https://avatars.discourse-cdn.com/v4/letter/k/aca169/32.png) [@koconnor](https://klipper.discourse.group/u/koconnor)\
**Post date:** [May 16, 2022, 2:39am UTC](https://klipper.discourse.group/t/support-for-hdsc-chips-hc32f460/2860/2 "2022-05-16T02:39:50Z")

</div>

There was some work done a couple of months ago at [Add mcu HC32f460 common to Voxelab Aquila, X2 and 1.03 mainboard by SteveGotthardt · Pull Request #5208 · Klipper3d/klipper · GitHub](https://github.com/Klipper3d/klipper/pull/5208) . I don’t know what the current state is.

-Kevin

---

<div class="post-metadata">

**Author:** ![MandicReally](https://avatars.discourse-cdn.com/v4/letter/m/7ea924/32.png) [@MandicReally](https://klipper.discourse.group/u/MandicReally)\
**Post date:** [June 10, 2022, 1:21pm UTC](https://klipper.discourse.group/t/support-for-hdsc-chips-hc32f460/2860/3 "2022-06-10T13:21:40Z")

</div>

Any Updates on this? I’ve got some projects for the Anycubic Kobra Max that the stock Firmware is holding me back on. I’ve been in contact with AnyCubic and they say they will release their branch of Marlin for it “in 2-3 months”. So I’m not holding my breath.

---

<div class="post-metadata">

**Author:** ![bsas](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/bsas/32/2462_2.png) [@bsas](https://klipper.discourse.group/u/bsas)\
**Post date:** [October 24, 2022, 8:18am UTC](https://klipper.discourse.group/t/support-for-hdsc-chips-hc32f460/2860/4 "2022-10-24T08:18:14Z")

</div>

Anycubic released the Marlin source code for all the Kobra line. So, please Klipper devs, implement support for the HC32F460 because the Marlin version on those printers is super old and very buggy…

> **[GitHub - ANYCUBIC-3D/Kobra](https://github.com/ANYCUBIC-3D/Kobra)**
>
> Contribute to ANYCUBIC-3D/Kobra development by creating an account on GitHub.

> **[GitHub - ANYCUBIC-3D/HDSC\_SupportPackage](https://github.com/ANYCUBIC-3D/HDSC_SupportPackage)**
>
> Contribute to ANYCUBIC-3D/HDSC\_SupportPackage development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![SteveGotthardt](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/stevegotthardt/32/2565_2.png) [@SteveGotthardt](https://klipper.discourse.group/u/SteveGotthardt)\
**Post date:** [October 24, 2022, 8:12pm UTC](https://klipper.discourse.group/t/support-for-hdsc-chips-hc32f460/2860/5 "2022-10-24T20:12:53Z")

</div>

I have support for HC32F460 working (since Jan 2022) for the Voxelab aquillas that use it:

> **[GitHub - SteveGotthardt/klipper: Klipper on the Voxelab Aquila H32](https://github.com/SteveGotthardt/klipper)**
>
> Klipper on the Voxelab Aquila H32. Contribute to SteveGotthardt/klipper development by creating an account on GitHub.

further dev info: [Voxelab Aquila HC32 Klipper · GitHub](https://gist.github.com/SteveGotthardt/2ed249f197f5928eaf5c3d3877d55503)

I could do more if I had the mainboards for the other vendors - anyone have a leftover (some have given up and replaced them)

I have not pursued another PR since the Voxelab interest seems low, but now if Ender (Pro 2) and other more mainstream manufacturers are using HC32F460, I can start the process.

S

---

<div class="post-metadata">

**Author:** ![bsas](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/bsas/32/2462_2.png) [@bsas](https://klipper.discourse.group/u/bsas)\
**Post date:** [October 24, 2022, 8:25pm UTC](https://klipper.discourse.group/t/support-for-hdsc-chips-hc32f460/2860/6 "2022-10-24T20:25:02Z")

</div>

So, why the main Klipper just doesn’t merge your changes? ☹

---

<div class="post-metadata">

**Author:** ![SteveGotthardt](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/stevegotthardt/32/2565_2.png) [@SteveGotthardt](https://klipper.discourse.group/u/SteveGotthardt)\
**Post date:** [October 24, 2022, 8:29pm UTC](https://klipper.discourse.group/t/support-for-hdsc-chips-hc32f460/2860/7 "2022-10-24T20:29:35Z")

</div>

My original PR had a lot of library baggage and the interest (at that time) was low.  
I have since lightened the library and a few Aquilla users (original and C2) have tested it.

---

<div class="post-metadata">

**Author:** ![bsas](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/bsas/32/2462_2.png) [@bsas](https://klipper.discourse.group/u/bsas)\
**Post date:** [October 24, 2022, 8:30pm UTC](https://klipper.discourse.group/t/support-for-hdsc-chips-hc32f460/2860/8 "2022-10-24T20:30:15Z")

</div>

Which branch is the one that you recommend me to try?

---

<div class="post-metadata">

**Author:** ![SteveGotthardt](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/stevegotthardt/32/2565_2.png) [@SteveGotthardt](https://klipper.discourse.group/u/SteveGotthardt)\
**Post date:** [October 24, 2022, 8:30pm UTC](https://klipper.discourse.group/t/support-for-hdsc-chips-hc32f460/2860/9 "2022-10-24T20:30:46Z")

</div>

> **[GitHub - SteveGotthardt/klipper at hc32f460\_work](https://github.com/SteveGotthardt/klipper/tree/hc32f460_work)**
>
> hc32f460\_work

---

<div class="post-metadata">

**Author:** ![bsas](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/bsas/32/2462_2.png) [@bsas](https://klipper.discourse.group/u/bsas)\
**Post date:** [October 24, 2022, 8:47pm UTC](https://klipper.discourse.group/t/support-for-hdsc-chips-hc32f460/2860/10 "2022-10-24T20:47:05Z")

</div>

Cool! I made a quick pull request I am testing that merges the latest Klipper code into it.

---

<div class="post-metadata">

**Author:** ![bsas](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/bsas/32/2462_2.png) [@bsas](https://klipper.discourse.group/u/bsas)\
**Post date:** [October 24, 2022, 9:53pm UTC](https://klipper.discourse.group/t/support-for-hdsc-chips-hc32f460/2860/11 "2022-10-24T21:53:19Z")

</div>

Hmmm, unfortunately no dice. The firmware compiles and flashes fine, and the “dev” shows up:

```auto
ls /dev/serial/by-id/
usb-1a86_USB_Serial-if00-port0

```

But the connection cannot sustain:

```auto
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/pi/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/pi/klipper/klippy/serialhdl.py", line 259, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/pi/klipper/klippy/serialhdl.py", line 317, in get_response
    cmd_queue)
  File "/home/pi/klipper/klippy/serialhdl.py", line 251, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/pi/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed

```

I tried all combinations: 32KiB and 48KiB booltloaders, forced the baud rate to 115200 (I know that this is the rate on Marlin for the Kobra board).

Here is the Marlin pinout for this board: [Kobra/pins\_AC\_TRI\_F1\_V1.h at master · ANYCUBIC-3D/Kobra · GitHub](https://github.com/ANYCUBIC-3D/Kobra/blob/master/source/Marlin/src/pins/stm32f1/pins_AC_TRI_F1_V1.h)

Thanks!

---

<div class="post-metadata">

**Author:** ![SteveGotthardt](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/stevegotthardt/32/2565_2.png) [@SteveGotthardt](https://klipper.discourse.group/u/SteveGotthardt)\
**Post date:** [October 25, 2022, 2:22am UTC](https://klipper.discourse.group/t/support-for-hdsc-chips-hc32f460/2860/12 "2022-10-25T02:22:43Z")

</div>

I ordered a mainboard for the anycubic kobra - It will arrive later this week. After getting that board working I’ll put in for another PR for klipper.

---

<div class="post-metadata">

**Author:** ![bsas](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/bsas/32/2462_2.png) [@bsas](https://klipper.discourse.group/u/bsas)\
**Post date:** [October 25, 2022, 2:35am UTC](https://klipper.discourse.group/t/support-for-hdsc-chips-hc32f460/2860/13 "2022-10-25T02:35:54Z")

</div>

Thank you so much, you didn’t need to. I could totally test myself if you instructed me 😃

---

<div class="post-metadata">

**Author:** ![bebu](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/bebu/32/2582_2.png) [@bebu](https://klipper.discourse.group/u/bebu)\
**Post date:** [October 26, 2022, 12:43pm UTC](https://klipper.discourse.group/t/support-for-hdsc-chips-hc32f460/2860/14 "2022-10-26T12:43:28Z")

</div>

I already did some of the work, but i abandoned it for a while. There are major issues with TMC drivers. The bootloader is 32kb and they use uart2,

---

<div class="post-metadata">

**Author:** ![bebu](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/bebu/32/2582_2.png) [@bebu](https://klipper.discourse.group/u/bebu)\
**Post date:** [October 26, 2022, 2:57pm UTC](https://klipper.discourse.group/t/support-for-hdsc-chips-hc32f460/2860/15 "2022-10-26T14:57:23Z")

</div>

you need to use a diffrent uart. You can find it here:

> <https://github.com/ANYCUBIC-3D/Kobra/blob/master/source/Marlin/Configuration.h#L137>

e.g.

> <https://github.com/bebu/klipper/commit/fdb3bbb12debc439b903f945a9a8ce0ebb88e938>

---

<div class="post-metadata">

**Author:** ![bsas](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/bsas/32/2462_2.png) [@bsas](https://klipper.discourse.group/u/bsas)\
**Post date:** [October 26, 2022, 4:44pm UTC](https://klipper.discourse.group/t/support-for-hdsc-chips-hc32f460/2860/16 "2022-10-26T16:44:27Z")

</div>

Hey @bebu , why did you reduce the CLOCK\_FREQ to 1/10 of the original value? Is that necessary?

---

<div class="post-metadata">

**Author:** ![bebu](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/bebu/32/2582_2.png) [@bebu](https://klipper.discourse.group/u/bebu)\
**Post date:** [October 26, 2022, 4:58pm UTC](https://klipper.discourse.group/t/support-for-hdsc-chips-hc32f460/2860/17 "2022-10-26T16:58:29Z")

</div>

It was a typo, my next commit reverted it.  
The marlin sets it to 12Mhz and i tried that value because of broken TMC communication, but it didn’t change anything. I also set corresponding values in system init.

I can’t imagine it’s a bitbang problem though, uart is terribly slow, and i even tried to set baud to 4800 for TMC.

---

<div class="post-metadata">

**Author:** ![SteveGotthardt](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/stevegotthardt/32/2565_2.png) [@SteveGotthardt](https://klipper.discourse.group/u/SteveGotthardt)\
**Post date:** [October 26, 2022, 5:13pm UTC](https://klipper.discourse.group/t/support-for-hdsc-chips-hc32f460/2860/18 "2022-10-26T17:13:47Z")

</div>

Thanks for the work and offer to help! Since I will only have a board and no Kobra I can test thermistors, motors, heaters (light bulbs), etc. I will need help to complete the config file.

---

<div class="post-metadata">

**Author:** ![bebu](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/bebu/32/2582_2.png) [@bebu](https://klipper.discourse.group/u/bebu)\
**Post date:** [October 26, 2022, 5:53pm UTC](https://klipper.discourse.group/t/support-for-hdsc-chips-hc32f460/2860/19 "2022-10-26T17:53:13Z")

</div>

I have a complete working file. When I patch the TMC python file I get x and y stallguard working. The inductive z Probe is working fine, as is bed and extruder heater. I tested everything beside the beeper.  
I am on holidays till next week, maybe I can send you the config tomorrow.

---

<div class="post-metadata">

**Author:** ![bebu](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/bebu/32/2582_2.png) [@bebu](https://klipper.discourse.group/u/bebu)\
**Post date:** [October 26, 2022, 7:35pm UTC](https://klipper.discourse.group/t/support-for-hdsc-chips-hc32f460/2860/20 "2022-10-26T19:35:57Z")

</div>

Here it is, i found some time 🙂

> <https://gist.github.com/bebu/fdda3d11e977133ea43afb398bf753b4>

[Next page](https://klipper.discourse.group/t/support-for-hdsc-chips-hc32f460/2860.md?page=2)
