Marlin: [BUG] TMC2209 UART connection error

Created on 20 Aug 2019  Â·  86Comments  Â·  Source: MarlinFirmware/Marlin

Description

TMC UART seems to be broken with 2.0.X bugfix build pulled today from Marlin official repository, at least on BIGTREE_SKR_MINI env. The build compiles all right, but there is now "TMC CONNECTION ERROR" displayed on info screen once this FW image is flashed onto the board.
Adittionally, M122 issues "Bad response" for all TMC drivers:
Driver registers:
X 0x00:00:00:00 Bad response!
Y 0x00:00:00:00 Bad response!
Z 0x00:00:00:00 Bad response!
E 0x00:00:00:00 Bad response!
Testing X connection... Error: All LOW
Testing Y connection... Error: All LOW
Testing Z connection... Error: All LOW
Testing E connection... Error: All LOW

Same configuration, is working with image build some two weeks ago.

Steps to Reproduce

Download current build, replace platformio.ini, configuration.h and configuration_adv.h with those attached. Build and flash image on Bigtreetech Mini DIP board, with 4x TMC2209 in UART mode.

Expected behavior:
No rerror message on screen, normal response from M122

Actual behavior:
as above

Additional Information

platformio.zip
Configuration.zip

STM32 Potential ? Trinamic

Most helpful comment

Works

Yep. My bad... Forgot about jumpers under drivers 🤣 (2209 seems also fine)

All 86 comments

I am facing the same errors, tried with TMC2208 and TMC2209 on SKR1.1
On the Scope i can see data beeing sent to the drivers, but LCD says connection error.

Installed Klipper on the same Board, 2 x TMC2209 + 1X TMC2208 on a single wire working without problems. So it is a bug in Marlin.

afaik SKR Mini baords and btt boards with stm32 mcus need BTT version of TMCStepper.
what exactly it changed I don't know but I know it works on my SKR Mini e3 DIP when the normal one does not... https://github.com/bigtreetech/TMCStepper/
also to compile with that lib you need to ass -DHAVE_SW_SERIAL to build flags.

Hmmm... I’m having a similar problem on RAMPS/Re-ARM but since this is the first time I’ve used TMC drivers I don’t know if it’s a bug or something I’m doing wrong.
I’m using a single pin for both RX and TX which should work...

My problem seemed to involve using 1-wire. It didn't work for me at all - I had to use a Y lead and two separate pins on the board for the connection to succeed.

+1

If I replace TMCSteppers with the one from BigTreeTech, I get an error and the build fails:

collect2: error: ld returned 1 exit status
*** [.pio/build/BIGTREE SKR MINI/firmware.elf] Error 1

+1

If I replace TMCSteppers with the one from BigTreeTech, I get an error and the build fails:

collect2: error: ld returned 1 exit status
*** [.pio/build/BIGTREE SKR MINI/firmware.elf] Error 1

did you also add -DHAVE_SW_SERIAL to build flags? this seems to be a must if you have bigtreetechs tmcstepper lib

No with the flag it worked, thank you :)

The TMCStepper library from BTT implements the software serial library methods. This is required to comunicate with the TMC uart drivers I their boards.
The HAL STM32F1 in Marlin firmware implements dummy methods for this library.

  • Using original Marlin firmware without replacing the TMCSTEPPER library will result in connection error due to the dummy software serial methods
  • Using BTT TMCStepper library in original Marlin firmware results in build errors due to redefining Software Serial library methods

Adding -DHAVE_SW_SERIAL to build flags as stated earlier in this issue ignores the Dummy software serial library from Marlin so the build works and the TMC Connection error goes away.

Should Marlin implement the real software serial library for STM32F1 ?

PS: my test case is running SKR E3 DIP with tmc2208s

I followed the same steps.
Get the same errors

SKR1.3 + 2209

Same error on SKR 1.3 lcd says tmc connection error
If i do a M122 It reads the 2208 drivers but get X 0x00:00:00:00 Bad response!
Testing X connection... Error: All LOW

only have 1 2208 driver in my test bench

and cant jog my X axis from lcd.

Latest build of today fresh DL

What is the solution?

I don't know
There are the same issues raised on teemuatlut's GitHub

As well as on the Discord channel

@lightface79 Board needs to be powered externally not from USB

SKR1.3 + 2209
Same problem 0x00:00:00:00 Bad response!

SKR1.3 + 2209
Same problem 0x00:00:00:00 Bad response!
with 24V external power supply.

@samnangor Please provide configs.
I tested the SKR 1.3 + 2209 last night with the Marlin Bug Fix from that time

Here is my config
Thanks for your help.
Marlin.zip

ZIP is invalid

Configuration.zip
Here is a compress file

Configuration_ADV.h is needed too

Configuration.zip
This one include
Configuration.h
Configuration_adv.h

define SERIAL_PORT 0

Should be -1

Thanks Grogyan,
How about SERIAL_PORT 2?

Compile with
SERIAL_PORT_0 -1
Run Pronterface command M122
Driver registers:
X 0x00:00:00:00 Bad response!
Y 0x00:00:00:00 Bad response!

Watterot or BTT 2209?

On Fri, 30 Aug 2019, 12:14 samnangor, notifications@github.com wrote:

Compile with
SERIAL_PORT_0 -1
Run Pronterface command M122
Driver registers:
X 0x00:00:00:00 Bad response!
Y 0x00:00:00:00 Bad response!

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/MarlinFirmware/Marlin/issues/15012?email_source=notifications&email_token=ABSQWGWR75CFF3J5ZTTPTJLQHBQ63A5CNFSM4IN5B6H2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5QFE4A#issuecomment-526406256,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABSQWGXK3H2SZXV3LYCNHHLQHBQ63ANCNFSM4IN5B6HQ
.

This is what it prints on the PCB
ACCA 1929
FYSETC Silent 2209
V2.1

Make sure the PDN UART jumper is soldered

On Fri, 30 Aug 2019, 12:26 samnangor, notifications@github.com wrote:

This is what it prints on the PCB
ACCA 1929
FYSETC Silent 2209
V2.1

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/MarlinFirmware/Marlin/issues/15012?email_source=notifications&email_token=ABSQWGXJ42SRIK43RBSITQTQHBSMDA5CNFSM4IN5B6H2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5QFU4I#issuecomment-526408305,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABSQWGQFGGNLYJHEKVN7ZHTQHBSMDANCNFSM4IN5B6HQ
.

I am still looking for PDN UART jumper location on my TMC2209 PCB
Thanks again Grogyan.

Found it, I have to short between Tx and Rx

I've just received my SKR 1.3 board and 4 GEEETECH TMC2208 and I'm also getting "Bad response" on all 4.
I have soldered the jumper pad for the UART on the drivers, set all the jumpers correctly on the SKR and the drivers do work as I can manually move them via the LCD.
How to fix this?

Erik9519
I solved my problem om ny stepper errors.
Need to power the board externaly from 12 or 24v so no USB powereing the board. Set the dip to ext power.

Second thing That was wrong was i had 3 pads on my 2208 and u should Only have the middle pad and one or the other left or right pads solderd together with the middle one. I had mine solderd go the wrong pad. So the uart was in the wrong pin to the skr1.3

So when i changed the pads the uart was working perfect.

Then came the second issue.
Since my drivers worked like yours in standalone mode.

When the uart mode worked i could not move my steppers..

Found out that i needed to disabel software_enable

Then everything worked like a charm

@lightface79
After some extensive debugging over the Marlin Discord we came to the conclusion that to solve my problem I had to solder together the unmarked pin on my drivers with the PDN pin on top of soldering the uart pad (my drivers have only 2 pads not 3 for the UART).
Once I did that they worked just fine in UART mode.

These were the drivers: GEEETECH TMC2208
https://www.amazon.de/GEEETECH-TMC2208-Stepstick-Heatsink-Screwdriver/dp/B07MZTCSZY

@salacpavel still having problems?

Not the same problem though 
I  cannot make my extruder fan come on automatically It should come on when extruder temperature goes above 50 I have tried to raise the temperature to 80 and it still won't run.  It will turn on and off manually when I send Gcode command.
Attached is the file
Thanks

So I updated to the latest commit today and get this issue with the bigtreetech TMCStepper library:

In file included from Marlin\src\module/stepper/indirection.h:44:0,
                 from Marlin\src\module/stepper.h:47,
                 from Marlin\src\Marlin.cpp:37:
Marlin\src\module/stepper/trinamic.h:31:4: error: #error "Update TMCStepper library to 0.5.0 or newer."
   #error "Update TMCStepper library to 0.5.0 or newer."
    ^~~~~
Compiling .pio\build\STM32F103R_bigtree\src\src\feature\bedlevel\abl\abl.cpp.o
In file included from Marlin\src\feature\../module/stepper/indirection.h:44:0,
                 from Marlin\src\feature\../module/stepper.h:47,
                 from Marlin\src\feature\babystep.cpp:30:
Marlin\src\feature\../module/stepper/trinamic.h:31:4: error: #error "Update TMCStepper library to 0.5.0 or newer."
   #error "Update TMCStepper library to 0.5.0 or newer."
    ^~~~~
Compiling .pio\build\STM32F103R_bigtree\src\src\feature\bedlevel\bedlevel.cpp.o
Compiling .pio\build\STM32F103R_bigtree\src\src\feature\bedlevel\mbl\mesh_bed_leveling.cpp.o
Compiling .pio\build\STM32F103R_bigtree\src\src\feature\bedlevel\ubl\ubl.cpp.o
Compiling .pio\build\STM32F103R_bigtree\src\src\feature\bedlevel\ubl\ubl_G29.cpp.o
*** [.pio\build\STM32F103R_bigtree\src\src\Marlin.cpp.o] Error 1
*** [.pio\build\STM32F103R_bigtree\src\src\feature\babystep.cpp.o] Error 1

Does anyone got a clue about that?

Not the same problem though  I  cannot make my extruder fan come on automatically It should come on when extruder temperature goes above 50 I have tried to raise the temperature to 80 and it still won't run.  It will turn on and off manually when I send Gcode command. Attached is the file Thanks

you can not attach files from email, you have to use github website

So I updated to the latest commit today and get this issue with the bigtreetech TMCStepper library:

In file included from Marlin\src\module/stepper/indirection.h:44:0,
                 from Marlin\src\module/stepper.h:47,
                 from Marlin\src\Marlin.cpp:37:
Marlin\src\module/stepper/trinamic.h:31:4: error: #error "Update TMCStepper library to 0.5.0 or newer."
   #error "Update TMCStepper library to 0.5.0 or newer."
    ^~~~~
Compiling .pio\build\STM32F103R_bigtree\src\src\feature\bedlevel\abl\abl.cpp.o
In file included from Marlin\src\feature\../module/stepper/indirection.h:44:0,
                 from Marlin\src\feature\../module/stepper.h:47,
                 from Marlin\src\feature\babystep.cpp:30:
Marlin\src\feature\../module/stepper/trinamic.h:31:4: error: #error "Update TMCStepper library to 0.5.0 or newer."
   #error "Update TMCStepper library to 0.5.0 or newer."
    ^~~~~
Compiling .pio\build\STM32F103R_bigtree\src\src\feature\bedlevel\bedlevel.cpp.o
Compiling .pio\build\STM32F103R_bigtree\src\src\feature\bedlevel\mbl\mesh_bed_leveling.cpp.o
Compiling .pio\build\STM32F103R_bigtree\src\src\feature\bedlevel\ubl\ubl.cpp.o
Compiling .pio\build\STM32F103R_bigtree\src\src\feature\bedlevel\ubl\ubl_G29.cpp.o
*** [.pio\build\STM32F103R_bigtree\src\src\Marlin.cpp.o] Error 1
*** [.pio\build\STM32F103R_bigtree\src\src\feature\babystep.cpp.o] Error 1

Does anyone got a clue about that?

look for this in your error: Update TMCStepper library to 0.5.0 or newer

it might give you a clue :-D

@boelle But are the issues with the original TMCStepper library fixed?

i have no clue, that is why i ask

personally i use DRV8825 and TMC2100 and those dont require drivers at all

I changed the library back to the original library and uploaded the firmware to my ender 3 and the TMC connection error is still present.

So now the issue is:

and you did update to version 0.5.0 ?

I used the original library annotation and from the .pio/libdeps/TMCStepper folder I can see, that pio installed version 0.5.0:
Screenshot_2019 09 25_21h09m30s_003_

very strange that says to update to 0.5.0 :-/

@thinkyhead Any idea about this error?

@TheZoker There is 2 TMCStepper folders in your screenshot. Maybe removed the one without a suffix, or the entire libdeps folder and let it download fresh again?

Just tried that (removing the whole folder and let it download all the libs again) but same, TMC connection error:
20190925_221023

This seems to be the explanation of the TMC connection issue:
https://github.com/MarlinFirmware/Marlin/issues/15012#issuecomment-525572365

It was possible to work around this by using the bigtreetech TMCStepper library, but yeah, that one does not compile anymore...

Oh sorry, I didn't realize you were talking about a runtime error, I thought it was the compile error people were getting. Good to know because I have a SKR 1.3 that I was getting ready to put in my 2209 steppers. I have the firmware compiled, just haven't gotten around to updating yet. I guess I'll wait :)

Marlin has an unimplemented SoftwareSerial library that lets you compile, but doesn't let anything work. It seems it would be much better for it to break the build than fail at runtime.

Try adding the FYSETC SoftwareSerialM library to your STM32F103R_bigtree to see if it works. I got mine working yesterday using that. Here is the entire block you can copy/paste to see if it works.

#
# BigTree SKR Mini V1.1 / SKR mini E3 / SKR E3 DIP (STM32F103RCT6 ARM Cortex-M3)
#
[env:STM32F103R_bigtree]
platform          = ststm32
framework         = arduino
board             = genericSTM32F103RC
platform_packages = tool-stm32duino
extra_scripts     = buildroot/share/PlatformIO/scripts/STM32F1_SKR_MINI.py
build_flags       = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
  ${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 -DHAVE_SW_SERIAL
build_unflags     = -std=gnu++11
lib_deps          = ${common.lib_deps}
  SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip
lib_ignore        = Adafruit NeoPixel, SPI
src_filter        = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
monitor_speed     = 115200
upload_protocol   = stlink
debug_tool        = stlink

The actual changes in my last post were the lib_deps line, and adding -DHAVE_SW_SERIAL to the build_flags.

@sjasonsmith I tried that, but got the same TMC connection error again :/

Try solder the Tx and Rx pin (on the TMC2209 board) together.
Mine is working fine. Just did my first print.

I have it working with an SKR E3 Mini (Built-in 2209 drivers) and an SKR E3 DIP (2208 Drivers).

I do not know if The E3 DIP board needs anything special to work with 2209 drivers. My DIP config compiles fine with the drivers changed to TMC2209, but I don't have the hardware to test it. Perhaps jumpers on the board can change the slave addresses and require modifying the _SLAVE_ADDRESS settings in configuration_adv.h.

I can't speak for SKR Mini 1.1 (non-E3) boards at all. It looks like the pins file does not define any serial pins, so much more work would be needed to configure it properly.

I won't have access to my machines for the rest of this week, so I'll post my working configs for these right now, in case that helps anybody.

SKR_E3_DIP.zip (2208 UART drivers. Never tested in an actual printer, might have other config issues)
SKR_E3_Mini.zip (Built-in 2209 Drivers. From an Ender 5 with BLTouch, but not fully tested)

Any news on this issue?
Why is the SoftwareSerial library not added in Marlin?

I think need to add an extra build_flags to compile -DTMC_SERIAL_SWITCH
It helped me for E3 DIP and 2208 UART.
(https://github.com/teemuatlut/TMCStepper/blob/b5b3658d34f93e0cc646dbaa54f90b809267206f/src/TMCStepper.h#L26)

Not actual anymore :)

I'm compiling with SKR 1.3 + 2208 with commit e6055dc. Using TMCStepper library 0.5.1 (I haven't changed any pio configuration options and not using bigtree tmcstepper fork. I haven't printed yet, but it moves all the axis and homes fine.

but it moves all the axis and homes fine.

Please try M122, because drivers will work even without uart...

It'll be later tonight before I can try that.

but it moves all the axis and homes fine.

Please try M122, because drivers will work even without uart...

Works
NOTE: This is TMC2208 UART on SKR 1.3. Posted in reference to LastDragon-ru's build issue. Not really related to the OP.

Send: M122
Recv:       X   Y   Z   E
Recv: Enabled       true    true    true    false
Recv: Set current   1200    1200    1200    980
Recv: RMS current   1160    1160    1160    939
Recv: MAX current   1636    1636    1636    1324
Recv: Run current   20/31   20/31   20/31   16/31
Recv: Hold current  10/31   10/31   10/31   8/31
Recv: CS actual 10/31   10/31   10/31   8/31
Recv: PWM scale 24  25  24  10
Recv: vsense        0=.325  0=.325  0=.325  0=.325
Recv: stealthChop   true    true    true    false
Recv: msteps        16  16  16  16
Recv: tstep     max max max max
Recv: pwm
Recv: threshold 49  49  82  31
Recv: [mm/s]        100 100 3   30
Recv: OT prewarn    false   false   false   false
Recv: OT prewarn has
Recv: been triggered    false   false   false   false
Recv: off time  4   4   4   4
Recv: blank time    24  24  24  24
Recv: hysteresis
Recv: -end      2   2   2   2
Recv: -start        1   1   1   1
Recv: Stallguard thrs
Recv: DRVSTATUS X   Y   Z   E
Recv: stst      *   *   *   *
Recv: olb
Recv: ola
Recv: s2gb
Recv: s2ga
Recv: otpw
Recv: ot
Recv: 157C
Recv: 150C
Recv: 143C
Recv: 120C
Recv: s2vsa
Recv: s2vsb
Recv: Driver registers:
Recv:       X   0xC0:0A:00:00
Recv:       Y   0xC0:0A:00:00
Recv:       Z   0xC0:0A:00:00
Recv:       E   0x80:08:00:00
Recv: 
Recv: 
Recv: Testing X connection... OK
Recv: Testing Y connection... OK
Recv: Testing Z connection... OK
Recv: Testing E connection... OK
Recv: ok P63 B31

Works

Yep. My bad... Forgot about jumpers under drivers 🤣 (2209 seems also fine)

@salacpavel @LastDragon-ru so this one is fixed?

@boelle, skr 1.3 + 2209/2208 = all fine :)

i will assume the issue is not present anymore and close

if issue is still there we can reopen

how is this fixed? I having same problem, All LOW TMC connection error.

Hi, I've an SKR MINI v1.1 (not E3) with TMC2209 and I'm looking for more detailed infos. I've everything up to date, using standard libs coming with marlin. I've tried defining serialtx and rx pin on pins..-.h then connecting jumpers between that pin and the PDN_UART pin on stepper and I was getting TMC CONNECTION ERROR.
Can I use every pin available on the board (obviously not the filtered ones)? Have I to add the -DHAVE_SW_SERIAL flag?

Sorry but I can see no fix.
BTT SKR 1.3 board with BTT TMC2209 V1.2 drivers - still get the

X 0x00:00:00:00 Bad response!
Y 0x00:00:00:00 Bad response!
Z 0x00:00:00:00 Bad response!
E 0x00:00:00:00 Bad response!
Testing X connection... Error: All LOW
Testing Y connection... Error: All LOW
Testing Z connection... Error: All LOW
Testing E connection... Error: All LOW

Quite new to Marlin 2.0 and 32bit boards, so I followed the YT videos but I couldnt find a solution to my problem, please help

Thought I'd bump this, having the same issue and don't see a clear fix in this thread.
TMC2209 SKR 1.3 Marlin 2.0

@RavaszEmber & @LeChuck7, I suggest you use one of the available support forums to seek help solving your problem. You are using a very common hardware combination so it seems most likely this is a configuration problem and not a Marlin issue. Make sure you are using Marlin 2.0.1, then seek help on Facebook, Discord, RepRap, etc.

I wouldn't expect any action on this closed issue. Even if the result of support attempts is that there is a Marlin bug, I think it should be a new issue rather than attached to the tail of an old closed issue.

@RavaszEmber & @Lechuck7, I suggest you use one of the available support forums to seek help solving your problem. You are using a very common hardware combination so it seems most likely this is a configuration problem and not a Marlin issue. Make sure you are using Marlin 2.0.1, then seek help on Facebook, Discord, RepRap, etc.

I wouldn't expect any action on this closed issue. Even if the result of support attempts is that there is a Marlin bug, I think it should be a new issue rather than attached to the tail of an old closed issue.

Thanks, kinda new to the Marlin github so didn't know where to look for help.
Found the solution if anyone's wondering, I was running the board on usb power when it needed the external power supply.

Thanks, kinda new to the Marlin github so didn't know where to look for help.

The README.md at the root of the Git Repo has links for several support resources. They are also displayed when you try to create a new issue. Glad you figured out the problem. I know I've done exactly the same thing.

Hi I have some question about mks_robin_nano board. I have managed to connect and successfully set up four TMC2209 on this board using bigtreetech TMCStepper library and -DHAVE_SW_SERIAL flag. But this library is outdated... I don't get why SoftwareSerial or similar methods can't be implemented while it's working when using a different library with it.

Will this be resolved somehow in the future, so we can use latest TMC library? Or am I missing something and I should use hardware serial on this board?

@pertzmax, I suggest you try using the SoftwareSerialM library, as is done for the STM32F103RC_bigtree environment.

I did not do this for MKS boards because I did not have any of them to test with, and I wasn't sure if it would work properly. There is a possibility of timer conflicts on boards, and I didn't know what to select for any MKS boards.

The SoftwareSerialM timer number is defined by adding an -DSS_TIMER=4 item to build flags, as seen in the STM32F103RC_bigtree. If the BTT TMCStepper was working for you than you can probably use the same value (4) as the BTT boards.

If you confirm that SoftwareSerialM works proeprly with your boards, you should open a pull request to add that configuration for your environment, so others can benefit from it.

@sjasonsmith Thank You for tips, I will test Your solution and report soon!

EDIT: That was easy - It worked like a charm! I will share it soon :)

Best regards from Poland,
Artur Petrzak

can anyone walk a layman through the process of adding this -dss timer=4 line? I am also getting the tmc connection error, and I cannot figure things out

@slf495 What board are you using?

sorry skr v.1.3

SKR 1.3 should not need that - that setting is specific for STM32 processors and does not apply to the LPC1768 on the SKR 1.3.

Come on to the Marlin Discord and we'll try to help you get it working.

i'm there in general

I have the same error with the integrated drivers 2209 in the SKR mini E3 V1.2 Board. I do not dig into programming, so it is difficult for me to understand when you talk about some libraries, etc. Just tell me what need to write to make it work. If you know.
With the original firmware, the motors worked, moved, but after installing the latest Marlin, this error appeared. So I suspect that the Board is connected correctly. Unfortunately I don't have the original firmware =((

I fixed it. Most likely, the problem was in the wrong name of the Board(although I'm not sure, I didn't return it). I wrote the name like this - #define MOTHERBOARD BOARD_BTT_SKR_MINI_E3_V1_2

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Bobsta6 picture Bobsta6  Â·  3Comments

ahsnuet09 picture ahsnuet09  Â·  3Comments

modem7 picture modem7  Â·  3Comments

ShadowOfTheDamn picture ShadowOfTheDamn  Â·  3Comments

Matts-Hub picture Matts-Hub  Â·  3Comments