Support for HDSC chips (HC32F460)

Assuming the MCU is the same and the other ICs are the same you could probably get away with making a config like this based on your board features: klipper/printer-anycubic-kobra-2022.cfg at hc32f460_work · SteveGotthardt/klipper · GitHub

Most the pain for these types of projects comes from adding support for new hardware. If the source is exactly the same then copying that and changing the X uart number to 0 and extruder to 3 might work.

I tried making a config and mapping the pins from the source code, but I couldn’t get anything to work. I went through the configuration checks on Klipper for the heaters, steppers, extruder, etc but they all get the unable to read error

All of them fail to read? IIRC even if there’s a bus conflict some of the motors should be able to read.

Yeah they all failed to read. Not sure what I’m doing wrong. And just the source for the slave addresses specifically is the same is what I meant and didn’t clarify.

Oh, so the actual firmware source code is not the same, just the addresses? You will have to check the following (at least):

  • The UART pins
  • What driver runs the motor

I don’t know if it has UART. It has software serial uncommented and #define BOARD_USART1_RX_PIN -1. Does that mean it doesn’t have UART? The steppers are now read and they do move using just the software serial pins and not using uart_pin. Drivers are TMC2208 for all steppers. The steppers move and the endstops work besides the X one.

The Kobra Neo is the exact same board as the Go just as an fyi to anyone

Bonjour
Qui a réussi a utiliser m300 avec le kobra max car impossible avoir du son en utilisant pin PB5 .qui a une idée pour avoir le son

If the steppers move and work except the X one you might have to do the resistor trick

The x stepper moves but the endstop won’t trigger using the pin from the source. Could that still be a resistor issue? Most of the pins don’t seem to work so I think there is definitely more to do. I can’t get the heaters or fans to work either

You should definitely try and map out the pins first before proceeding.

That is beyond my abilities and I wouldn’t even know where to start to learn. It feels like no one knowledgeable has this board. I tried to enable pin_debugging to see if that would help, but they don’t have all the files in the Marlin source code to get it to build. I would just like to get it figured out how difficult Klipper is going to be on this board because I have until January 31st to return it and get another printer with Klipper already configured if this one is going to be a pain

@Michel_1
from: klipper/sample-macros.cfg at master · Klipper3d/klipper · GitHub

did you try: with PB5

######################################################################
# Beeper
######################################################################

# M300 : Play tone. Beeper support, as commonly found on usual LCD
# displays (i.e. RepRapDiscount 2004 Smart Controller, RepRapDiscount
# 12864 Full Graphic). This defines a custom I/O pin and a custom
# GCODE macro.  Usage:
#   M300 [P<ms>] [S<Hz>]
#   P is the tone duration, S the tone frequency.
# The frequency won't be pitch perfect.

[output_pin BEEPER_pin]
pin: PB5
#   Beeper pin. This parameter must be provided.
#   ar37 is the default RAMPS/MKS pin.
pwm: True
#   A piezo beeper needs a PWM signal, a DC buzzer doesn't.
value: 0
#   Silent at power on, set to 1 if active low.
shutdown_value: 0
#   Disable at emergency shutdown (no PWM would be available anyway).
cycle_time: 0.001
#   Default PWM frequency : 0.001 = 1ms will give a tone of 1kHz
#   Although not pitch perfect.

[gcode_macro M300]
gcode:
    # Use a default 1kHz tone if S is omitted.
    {% set S = params.S|default(1000)|int %}
    # Use a 10ms duration is P is omitted.
    {% set P = params.P|default(100)|int %}
    SET_PIN PIN=BEEPER_pin VALUE=0.5 CYCLE_TIME={ 1.0/S if S > 0 else 1 }
    G4 P{P}
    SET_PIN PIN=BEEPER_pin VALUE=0
1 Like

Bonjour
Oui j’ai essayer avec pb5 rien ,je voit qu’on est plusieurs avec le meme problème

On est plusieurs effectivement, j’ai commandé une carte mère pour pouvoir analyser par ou passe le signal.

In the printer.config I swapped the Heatbed (PA0) with the beeper pin (PB5) and found that the beeper does not ‘heat’ and now the heatbed ‘beeps’. So, there may be a problem in assigning port B pins?

My guess is that the bootloader sets the function of the beeper pin to other than the default GPIO and I need to set the function back to GPIO. I am looking at that now.

update - that was the problem - the bootloader was setting gpio function to pwm on timer a.
now my gpio code sets the pin to gpio function explicitly.

new release code here as firmware.bin : Release per-merge-testing · SteveGotthardt/klipper · GitHub

2 Likes

@Michel_1
beeper is working. see here for klipper.bin: Release per-merge-testing · SteveGotthardt/klipper · GitHub

2 Likes

Merci beaucoup pour la modification installer et tester et encore merci

1 Like

Thanks a lot Steve ! It was making me crazy :slight_smile:

2 Likes

Printer arrived! It does indeed run the v1.0.4 motherboard. I haven’t looked at the board under the microscope yet. I’ll try and see if moving the E resistor is viable.

Just as some random notes: I’m not sure if this is a revision but to remove the under part of the case it has both the two hex screws but also plastic clips. So be sure to use a plastic shim to open it. Also for me at least the screws aren’t going back in so it’s just the clips holding it together at this point.

The fan is also really loud, which might be a defect. Not sure yet.

1 Like

As a quick update: I inspected the PCB and looked at the E0 pins. As far as I can tell E0 is configured for address 11 as both address lines are pulled to 3v3. Wouldn’t reconfiguring X to 11 conflict? Maybe I’ve messed up measuring here.