TMC2209 UART issues on rp2040

I’m trying to make my own toolboard, it use rp2040 as main mcu, and tmc2209 as extruder driver.
After completing the hardware part of the work, I got “Unable to read tmc uart ‘extruder’ register IFCNT”. At first, I thought it is a hardware issue, so I bought Raspbeery Pico board and TMC2209 module for comparative testing, and this problem still exists.

Afterwards, I attempted to capture UART communication using an oscilloscope and logic analyzer, and the data shows everything works fine, so I speculated that this could be a software issue.

I found a command “DUMP_TMC”, I use it to test UART communication, UART communication is not completely unavailable, but extremely unstable. With good luck, it can read all registers, but in most cases it can only read one or two.

log file contains more details.

PS: English is not my native language, please ignore any grammar issues, and I would be very pleased if you point out my issue.

klippy.log (246.4 KB)

I can’t help you, sorry.
Looking at your klippy.log. From line 45 till 1834 are macros listed. You might consider reducing the amount of macros. Do you know how those macros interact with each other?
You could do yourself a favor and start with the KISS principle (KISS principle - Wikipedia). For Klipper users Failed to Load Crowsnest Extension - #4 by Sineos

Good luck, hcet14

@hcet14 :

The config is just 1400 lines long, how can that be?

@wuyotuech :

This sounds like EMI issues. Is the PSU running fine? Is there enough voltage for the logic and enough current for the stepper? Is there proper grounding?

You’re right, but still a bunch.