Config for GTM32_103_V1?

Does anyone have a working Klipper config for GTM32_103_V1 controller? The board has 7 TMC2208 drivers and is around $35 on ebay right now so I’m thinking of getting one.

Since it is a common STM chip and Marlin/pins_GTM32_103_V1.h at 2.1.x-geeetech-a30t · TheThomasD/Marlin · GitHub has a pin definition, the chances are good to setup a config for it.

Ok, I bought one. I started the config based on Marlin config, however I cannot seem to find PDN_UART settings.

Here’s what I got so far:

# This file contains common pin mappings for the GTM32_103_V1 board.  Untested.
# 
# INSTRUCTIONS FOR COMPILING
# To use this config, the firmware should be compiled for the STM32F103.
# When running "make menuconfig", enable "extra low-level configuration setup",
# select the 28KiB bootloader, serial USART3 PB11/PB10 to use LCD serial 
# to use direct UART connection with Raspberry or USART1 PA10/PA9 for USB communication.
# 
# See docs/Config_Reference.md for a description of parameters.

[include mainsail.cfg]

[stepper_x]
step_pin: PA11
dir_pin: !PA12
enable_pin: !PA8
microsteps: 32
rotation_distance: 40.4
endstop_pin: !PA15
position_endstop: 0
position_max: 300
homing_speed: 50

[stepper_y]
step_pin: PD15
dir_pin: !PD3
enable_pin: !PD14
microsteps: 32
rotation_distance: 40.4
endstop_pin: !PD4
position_endstop: 300
position_max: 300
homing_speed: 50

[stepper_z]
step_pin: PD6
dir_pin: !PD7
enable_pin: !PD5
microsteps: 32
rotation_distance: 8
endstop_pin: probe:z_virtual_endstop
#position_endstop: 0
position_max: 340
position_min: -10

[stepper_z1]
step_pin: PB5
dir_pin: !PB6
enable_pin: !PB4
microsteps: 32
rotation_distance: 8

[bltouch]
sensor_pin: PC1#
control_pin: PC2#
#y_offset: -40
z_offset: 2.225


[bed_mesh]
speed: 120
horizontal_move_z: 5
mesh_min: 50, 50
mesh_max: 250, 250
probe_count: 5, 5


[safe_z_home]
home_xy_position: 150, 180 # Change coordinates to the center of your print bed
speed: 50
z_hop: 10                 # Move up 10mm
z_hop_speed: 5

[extruder]
step_pin: PB9 #E0
dir_pin: !PE0 #E0
enable_pin: !PB8 #E0
microsteps: 32
gear_ratio: 50:17
rotation_distance: 12.275 
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PE9 # EXT0 port; likely to change
sensor_type: EPCOS 100K B57560G104F # Stock
sensor_pin: PC0 # EXT0 port
#min_temp: 0
#max_temp: 250
min_temp: -273.15
max_temp: 9999999999
min_extrude_temp: -273.15
control: pid
pid_Kp: 17.48
pid_Ki: 1.32
pid_Kd: 57.81

# PDN_UART specs are unknown

[tmc2208 stepper_x]
uart_pin: PD2 #SD CMD, just a guess
run_current: 1.0
stealthchop_threshold: 999999


[tmc2208 stepper_y]
uart_pin: PC12 #SD CLK, just a guess
run_current: 1.0
stealthchop_threshold: 999999


[tmc2208 stepper_z]
uart_pin: PC11 #SD DATA3, just a guess
run_current: 1.0
stealthchop_threshold: 999999


[tmc2208 extruder]
uart_pin: PC9 #SD DATA2, just a guess
run_current: 0.5
stealthchop_threshold: 999999


[tmc2208 stepper_z1]
uart_pin: PC10 #SD DATA1, just a guess
run_current: 1.0
stealthchop_threshold: 999999


#PC8 SD DATA0 for stepper #6 
#PC7 SD CD for stepper #7 


[heater_bed]
heater_pin: PE14 #CON2x3 where is it?
sensor_type: EPCOS 100K B57560G104F # Stock
sensor_pin: PC3
#min_temp: 0
#max_temp: 130
min_temp: -273.15
max_temp: 9999999999
min_extrude_temp: -273.15
control: pid
pid_Kp: 325.10
pid_Ki: 63.35
pid_Kd: 417.10

[heater_fan extruder]
pin: PA6 # EXT0 port

[fan]
pin: PB7 #EXT0 port

[mcu]
serial: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method: command
baud: 460800

[printer]
kinematics: corexy
max_velocity: 200
max_accel: 4500
max_z_velocity: 15
max_z_accel: 100

[bed_screws]
screw1: 35,35
screw2: 275,35
screw3: 275,275
screw4: 35,275



EDIT: Well, Geeetech have decided to hardcode stepper current and microstepping. Fortunatelly soldering UART wires will not be difficult as PD_UART on TMC2208 is routed out and SD CARD pins can be used.

Successfully flashed klipper.bin using stm32flash v0.7 (after setting boot0 to 1 with a jumper of course). stm32flash v0.4 ‘failed to init’ on Linux, Windows and Arduino…

stm32flash-0.7-binaries>stm32flash -u -w klipperNoBootloader.bin -g 0 COM3

stm32flash 0.7

http://stm32flash.sourceforge.net/

Using Parser : Raw BINARY
Size         : 26712
Interface serial_w32: 57600 8E1
Version      : 0x22
Option 1     : 0x00
Option 2     : 0x00
Device ID    : 0x0414 (STM32F10xxx High-density)
- RAM        : Up to 64KiB  (512b reserved by bootloader)
- Flash      : Up to 512KiB (size first sector: 2x2048)
- Option RAM : 16b
- System RAM : 2KiB
Write to memory
Erasing memory
Wrote address 0x08006858 (100.00%) Done.

Starting execution at address 0x08000000... done.
1 Like

To update on progress, after removing pull-down resistors connected to pin 14 (PDN_UART), I soldered a jumper wire between pad from removed resistor on pin 14 of each TMC2208 and SD CARD connector’s signal pin (7 in total). Testing of UART failed at first…until I realized that I have to power the board via board power connector, not USB which only powers the MCU only.

In summary, wiring SD CARD pins to PDN_UART of each TMC2208 allows software driver control including current and microstepping. SD CARD is not needed since flashing via USB works just fine.

I’ve got that board running with klipper since almost a year now (in my geeetech A30 with a Sprite Pro hotend) …works great!
Although without sd-card and display; and I just use the PWM for the TMCs.

Didn’t think of wiring up the UART.

So, have you finished your config?

I don’t have A30, just need a cheap 7 driver board for my project. Can you share your config?

Here is my printer.cfg (with some old pieces removed)
Be aware: it was OK for me, but surely far from perfect! And atm it’s quite messed up as I went for a larger nozzle and I’m still in tuning things…but as e reference it should be OKish.

[include mainsail.cfg]
[mcu]
serial: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0

# # klipper config

[stepper_x]
step_pin: PB9
dir_pin: !PE0
enable_pin: !PB8
microsteps: 16
rotation_distance: 39.928
endstop_pin: !PA15
position_endstop: 0
position_min: 0
position_max: 330
homing_speed: 40.0
second_homing_speed: 5.0

[stepper_y]
step_pin: PD15
dir_pin: PD3
enable_pin: !PD14
microsteps: 16
rotation_distance: 39.41
endstop_pin: !PD4
position_endstop: 0
position_min: 0
position_max: 320
homing_speed: 40.0
second_homing_speed: 5.0

# Z0
[stepper_z]
step_pin: PD6
dir_pin: PD7
enable_pin: !PD5
microsteps: 16
rotation_distance: 8
endstop_pin: PD10
#position_endstop: 0
position_max: 400
position_min: -6

# Z1
[stepper_z1]
step_pin: PB5
dir_pin: PB6
enable_pin: !PB4
microsteps: 16
rotation_distance: 8
endstop_pin: PB7


[extruder]
nozzle_diameter: 0.600
filament_diameter: 1.7500
heater_pin: PE9
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC0
min_temp: 0
max_temp: 300
pressure_advance: 0.015 #PLA+, 0.6mm Nozzle
pressure_advance_smooth_time: 0.04

step_pin: PA11
dir_pin: !PA12
enable_pin: !PA8

microsteps: 16
rotation_distance: 7.53

min_extrude_temp: 140 #debugging only!

# [extruder_stepper extstep_left] 
# step_pin: PE4
# dir_pin: PE5
# enable_pin: !PE3
# microsteps: 16
# rotation_distance: 7.8
# extruder: extruder
# pressure_advance: 0.8

# [extruder_stepper extstep_right]
# step_pin: PB9
# dir_pin: PE0
# enable_pin: !PB8
# microsteps: 16
# rotation_distance: 7.8
# extruder: extruder
# pressure_advance: 0.8

# [extruder_stepper extstep_res]
# step_pin: PC14
# dir_pin: PC15
# enable_pin: !PC13
# microsteps: 16
# rotation_distance: 7.8
# extruder: extruder
# pressure_advance: 0.8

[firmware_retraction]
retract_length: 0.4 #PLA 0.2 Test-Tower: 22mm @ 0,005
#   The length of filament (in mm) to retract when G10 is activated,
#   and to unretract when G11 is activated (but see
#   unretract_extra_length below). The default is 0 mm.
retract_speed: 45
#   The speed of retraction, in mm/s. The default is 20 mm/s.
unretract_extra_length: 0.02
#   The length (in mm) of *additional* filament to add when
#   unretracting.
unretract_speed: 45
#   The speed of unretraction, in mm/s. The default is 10 mm/s.


[filament_switch_sensor filament_sensor_left]
switch_pin: !PE2

[filament_switch_sensor filament_sensor_right]
switch_pin: !PE6

[fan]
pin: PA6
off_below: 0.25

[heater_bed]
heater_pin: PE14
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC3
#control: watermark
min_temp: 0
max_temp: 110


# [bltouch]
# sensor_pin: ^PB3
# control_pin: PA0
# stow_on_each_sample: false
# x_offset: -33
# y_offset: -46
# #z_offset: see below
# speed: 2.0
# samples: 1
# lift_speed: 7.0
# sample_retract_dist: 1.0

[bed_mesh]
speed: 150
horizontal_move_z: 1
mesh_min: 10, 10
mesh_max: 310, 310
algorithm: bicubic
bicubic_tension: 0.6
probe_count: 3, 3
mesh_pps: 2
fade_start: 1
fade_end: 5
fade_target: 0

[safe_z_home]
home_xy_position: 0, 0
#   A X, Y coordinate (e.g. 100, 100) where the Z homing should be
#   performed. This parameter must be provided.
#speed: 50.0
#   Speed at which the toolhead is moved to the safe Z home
#   coordinate. The default is 50 mm/s
z_hop: 10
#   Distance (in mm) to lift the Z axis prior to homing. This is
#   applied to any homing command, even if it doesn't home the Z axis.
#   If the Z axis is already homed and the current Z position is less
#   than z_hop, then this will lift the head to a height of z_hop. If
#   the Z axis is not already homed the head is lifted by z_hop.
#   The default is to not implement Z hop.
#z_hop_speed: 15.0
#   Speed (in mm/s) at which the Z axis is lifted prior to homing. The
#   default is 15 mm/s.
#move_to_previous: False
#   When set to True, the X and Y axes are reset to their previous
#   positions after Z axis homing. The default is False.

[idle_timeout]
#gcode:
#   A list of G-Code commands to execute on an idle timeout. See
#   docs/Command_Templates.md for G-Code format. The default is to run
#   "TURN_OFF_HEATERS" and "M84".
timeout: 3600
#   Idle time (in seconds) to wait before running the above G-Code
#   commands. The default is 600 seconds.

[printer]
kinematics: cartesian
max_velocity: 250
max_accel: 700
max_z_velocity: 30
max_z_accel: 40

#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [extruder]
#*# control = pid
#*# pid_kp = 22.963
#*# pid_ki = 1.546
#*# pid_kd = 85.249
#*#
#*# [heater_bed]
#*# control = pid
#*# pid_kp = 73.363
#*# pid_ki = 0.990
#*# pid_kd = 1359.057
#*#
#*# [stepper_z]
#*# position_endstop = 4.615
#*#
#*# [bed_mesh default]
#*# version = 1
#*# points =
#*# 	0.150000, 0.160000, 0.110000
#*# 	0.040000, 0.157500, 0.110000
#*# 	0.070000, 0.225000, 0.080000
#*# x_count = 3
#*# y_count = 3
#*# mesh_x_pps = 2
#*# mesh_y_pps = 2
#*# algo = bicubic
#*# tension = 0.2
#*# min_x = 9.99
#*# max_x = 310.0
#*# min_y = 10.0
#*# max_y = 310.0

Hi, I have this board and I’m trying to install klipper on it, however I can’t get it working, all I get in the logs is this:

Dec 12 21:29:37 mainsailos kernel: [11407.130889] usb 1-1.5: new full-speed USB device number 23 using dwc_otg                                                              
Dec 12 21:29:37 mainsailos kernel: [11407.234586] usb 1-1.5: New USB device found, idVendor=1a86, idProduct=7523, bcdDevice= 2.64                                            
Dec 12 21:29:37 mainsailos kernel: [11407.234638] usb 1-1.5: New USB device strings: Mfr=0, Product=2, SerialNumber=0                                                        
Dec 12 21:29:37 mainsailos kernel: [11407.234659] usb 1-1.5: Product: USB Serial                                                                                             
Dec 12 21:29:37 mainsailos kernel: [11407.236265] ch341 1-1.5:1.0: ch341-uart converter detected                                                                             
Dec 12 21:29:37 mainsailos kernel: [11407.243295] usb 1-1.5: ch341-uart converter now attached to ttyUSB0                                                                    
Dec 12 21:29:37 mainsailos mtp-probe: checking bus 1, device 23: "/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5"                                                     
Dec 12 21:29:37 mainsailos mtp-probe: bus: 1, device: 23 was not an MTP device                                                                                               
Dec 12 21:29:37 mainsailos mtp-probe: checking bus 1, device 23: "/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5"                                                     
Dec 12 21:29:37 mainsailos mtp-probe: bus: 1, device: 23 was not an MTP device                         

According to the troubleshooting page I disabled ModemManager, and brltty is not installed, but nothing changed.

The flash process fails with make flash:

pi@mainsailos:~/klipper$ make flash FLASH_DEVICE=/dev/ttyUSB0                                                                                                                  
Flashing out/klipper.bin to /dev/ttyUSB0                                                                                                                                   
Entering bootloader on /dev/ttyUSB0                                                                                                                                          
Device reconnect on /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.0/ttyUSB0                                                                                  
sudo dfu-util -p 1-1.5 -R -a 2 -D out/klipper.bin                                                                                                                                                                                                                                                                                                         
dfu-util 0.9                                                                                                                                                                                                                                                                                                                                              
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.                                                                                                           
Copyright 2010-2016 Tormod Volden and Stefan Schmidt                                                                                                                         
This program is Free Software and has ABSOLUTELY NO WARRANTY                                                                                                                 
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/                                                                                                                                                                                                                                                                                          
dfu-util: Invalid DFU suffix signature                                                                                                                                       
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!                                                                                                
dfu-util: No DFU capable USB device available                                                                                                                                                                                                                                                                                                             
Failed to flash to /dev/ttyUSB0: Error running dfu-util                                                                                                                                                                                                                                                                                                   
If the device is already in bootloader mode it can be flashed with the                                                                                                       
following command:                                                                                                                                                             
make flash FLASH_DEVICE=1eaf:0003                                                                                                                                            
OR                                                                                                                                                                           
make flash FLASH_DEVICE=1209:beba                                                                                                                                                                                                                                                                                                                       
If attempting to flash via 3.3V serial, then use:                                                                                                                              
make serialflash FLASH_DEVICE=/dev/ttyUSB0                                                                                                                                                                                                                                                                                                              
make: *** [src/stm32/Makefile:111: flash] Error 255   

I can flash the board with stm32flash and a delay:

2 pi@mainsailos:~/klipper$ /usr/local/bin/stm32flash  -i ',,,,,' -v -w out/klipper.bin -g 0 /dev/ttyUSB0
stm32flash 0.7                                                                                                                                                                                                                                                                                                                                            
http://stm32flash.sourceforge.net/                                                                                                                                                                                                                                                                                                                        
Using Parser : Raw BINARY                                                                                                                                                    
Size         : 24260                                                                                                                                                         
Interface serial_posix: 57600 8E1                                                                                                                                                                                                                                                                                                                         
GPIO sequence start                                                                                                                                                           
delay 100000 us                                                                                                                                                              
delay 100000 us                                                                                                                                                              
delay 100000 us                                                                                                                                                              
delay 100000 us                                                                                                                                                              
delay 100000 us                                                                                                                                                             
GPIO sequence end                                                                                                                                                                                                                                                                                                                                         
Version      : 0x22                                                                                                                                                          
Option 1     : 0x00                                                                                                                                                          
Option 2     : 0x00                                                                                                                                                          
Device ID    : 0x0414 (STM32F10xxx High-density)                                                                                                                             
- RAM        : Up to 64KiB  (512b reserved by bootloader)                                                                                                                    
- Flash      : Up to 512KiB (size first sector: 2x2048)                                                                                                                      
- Option RAM : 16b                                                                                                                                                           
- System RAM : 2KiB                                                                                                                                                          
Write to memory                                                                                                                                                              
Erasing memory                                                                                                                                                               
Wrote and verified address 0x08005ec4 (100.00%) Done.                                                                                                                                                                                                                                                                                                     
Starting execution at address 0x08000000... done.                                                                                                                             

but it still does not work… does someone have some hints?

Thanks
Andrea

I am in the same boat here, I flashed the binary on my GTM32_Mini_S board and it does not work. I am wondering if it should be flashed to a different address. Did you ever get it to work ?

@ZweiStein , @w00sh Could you please share your menuconfig settings ? when I flash mine on GTM32 Mini S, klipper does not respond. Any instruction would be appreciated.
Thanks

No, I didn’t manage to get it work… however I haven’t had much time to troubleshoot the issue.

Bye
Andrea