about that last sentence. When I rename the bin file from klipper.bin to firmware-1.bin nothing happens. Only when the file is called firmware.bin the flashing process will start. But unfortunatelly is exactly the name that I used to reflash the original firmware back.
To help a bit here, the standard bootloader offset for the GD32F303 is 28Kib, not 8, and according to the Marlin source it’s likely using USART 2 for USB, considering that it is referenced as “SERIAL_PORT 2” in Marlin’s configuration.h, as well as the PA9 pin being used for stepper drivers in the “pins_AC_TRI_F1_V1.h” file. (Also, The printer will only update if the file on the SD card is “firmware.bin” nothing extra)
I have a K2 Neo and just disassembled it to get to the motherboard, and the CH430 is definitely connected to PA2 RX, PA3 TX. And there is a 8Mhz and 12Mhz external clock source.
Got it working, I had to manually put addresses into linker script for some reason
bootloader 36KiB, usart2
Also added turning off lcd at startup to indicate when flashing is done
Second config after couple of prints, now with correct extruder rotation distance so should be a good starting point.
Now waiting for an accelerometer to calibrate input shaping correctly, even now quality looks better than in stock marlin, especially first layers.
Totally not sure about switch_offset correct value, 1.5 seems okay for me but to be sure check manually the nozzle clearance to bed after z offset calibration to prevent dragging nozzle across the bed