Why is the driver_address always 0? #112
-
|
Recently, I am trying to use one Pi5 to control 4 TMC2209 to drive 4 motors. Thanks to demo_script_06_multiple_drivers.py, everything seems possible and not difficult. However, I notice that the driver_address is always 0 in the demo: |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 6 replies
-
|
Yes, the drivers should have different addresses. That is a copy-paste-error. Can you please share the complete log and the call stack of the error, so i can see where this error occurs. |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for your reply. Sure! I connected two TMC2209 with my Pi5 and tried to control two motors separately. For the first one, MS1=GND and MS2=GND. For the second one, MS1=GND and MS2=3.3V.
And the call stack is:
When I changed both of the driver_address=0, the demo could run successfully:
|
Beta Was this translation helpful? Give feedback.
-
|
Would have been nice to have the log with line breaks 😂. well the first issue is: 2025-05-12 20:27:03,111 - TMC2209 0 - INFO - Init finished
2025-05-12 20:27:03,111 - TMC2209 1 - INFO - SERIAL ERROR: Port is already open. the code tries to open the serial port a second time. I should fix that. But it seems that this is not the real problem. 2025-05-12 20:27:03,111 - TMC2209 0 - INFO - Init finished
...
2025-05-12 20:27:03,294 - TMC2209 1 - ERROR - UART Communication Error: 0 data bytes | 4 total bytesthe initialization was finished for the driver with the addr 0, but the Pi does not receive an answer from the driver with the addr 1. the error You should:
|
Beta Was this translation helpful? Give feedback.
-
|
Thank you sooo much for your detailed explanation! |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for your kindly guidance.
or
The second is the log of "demo_script_06_multiple_drivers.py", where I changed was:
The third is the code of minimal setup without vactual you showed yesterday, and the log is:
|
Beta Was this translation helpful? Give feedback.
-
|
I double checked that login shell over serial is deactivated. |
Beta Was this translation helpful? Give feedback.
-
|
I followed you suggestion and cut off the VIO pin. Good news, "debug_script_01_uart_connection.py" works everytime now! :)
The log was:
What's more, to make sure there were nothing wrong in the PCB board, I exchange the positions of two TMC2209 drivers. The result shows that though the physical pin changed, addr = 0 still worked and addr =1 not. :( |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.

I finally found the bug!!!! I was so stupid LOL. That's because according to the TMC2209 manual, first is MS2 and then MS1.
With the addr 1, the addr pins should be (MS1_ADDR1, MS2_ADDR0) rather than (MS1_ADDR0, MS2_ADDR1).
Thank you soooo much for your patient answera and help over the past few weeks!