Unable to Parse UART Address !0 on Duet 3

Basic Information:

Printer Model: Custom
MCU / Printerboard: Duet 3 Mini 5+
Host / SBC: Raspberry Pi 4 8GB
klippy.log

Fill out above information and in all cases attach your klippy.log file (use zip to compress it, if too big). Pasting your printer.cfg is not needed
Be sure to check our “Knowledge Base” Category first. Most relevant items, e.g. error messages, are covered there

Describe your issue:

I’ve been having an issue with the uart_address field while configuring the [tmc2209 stepper_x].

I’ve started with the generic-duet-3-mini.cfg, and have been making the necessary configuration tweaks. However, I’ve been unable to connect to any tmc2209 drivers that have a uart address other than 0, 1, 2, or 3.

According to the commented instructions, drivers 4 through 6 should be addressed as !0, !1, and !2.

However, Klipper appears to be unable to parse this properly. I tried -1 and 4, but they didn’t work either.

It looks like I am not the first one with this problem, but annoyingly, the discussion ended with a statement that they had solved it over Discord, and no solution was provided in the thread.

The dual-z and dual-y motor drivers (0, 1, 2, 3) seem to be doing absolutely fine, and I have reliably been able to tweak the current. The x-axis moves, but its stepper is literally too hot to touch after about a minute.

(And yes, stepper_x is driver 4. Long story.)

Any help would be greatly appreciated.

klippy.log (3.7 MB)

New users are apparently only allowed one link per post, so I wasn’t able to include the generic-duet3-mini.cfg. Here it is now.

Apologies for the absurdly long log file. I’ve tried a bunch of different things since I last booted it up. The relevant config stuff should be near the bottom.

Hello @bagsley3 !

[tmc2209 extruder]
uart_pin = PA1
tx_pin = PA0
uart_address = !0    # <=================
select_pins = PD0
run_current = 1
sense_resistor = 0.056

The UART address has to be a number, usually 0,1,2, or 3.

You can’t negate a number with the ! in front of it.

You have the ! in front of the uart_addressas EddyMI3D pointed out, instead it needs to be inverting the select_pins. The comments in the generic config state that, but they way they are written is a bit misleading. Here is an excerpt from my Voron 2.4 that’s running on a Mini 5+ fully loaded with 7 drivers, (modified) PT100 daughter card, etc.

[stepper_y]
## DRIVER4
step_pin: PC16
dir_pin: PD21
enable_pin: !PC28

[tmc2209 stepper_y]
uart_pin: PA1
tx_pin: PA0
select_pins: !PD0
uart_address: 0
interpolate: False      # for improved positional accuracy
run_current: 0.89       # 64% of LDO-42STH40-2004MAH(VRN) rated 2A peak current
sense_resistor: 0.056
2 Likes

That worked perfectly, thank you!

And, “misleading,” is a light way to put it. That documentation is WRONG wrong, since the examples all show the ! before the uart_address.

What documentation?

The commented instructions in generic-duet3-mini.cfg on line 15.

“# Uart addresses - 0:0 1:1 2:2 3:3 4:!0 5:!1 6:!2 | “!” is for inverted select pin”

I guess technically speaking, if you already know that you need to invert the select_pins parameter, you can figure out what they’re trying to say, but without that prior knowledge, I can’t think of any other way to interpret it than the way that I did at first.

I was coming at this with no UART experience whatsoever, and I imagine most people using this config template aren’t either.

...
# Uart addresses - 0:0 1:1 2:2 3:3 4:!0 5:!1 6:!2 | "!" is for inverted select pin
                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...