Klipper on a BTT SKR v1.4 Turbo with TMC2240 drivers

Hi All,

After a few friends recommending I get on the klipper wagon and another friend gifting me a BigTreeTech SKR v1.4 Turbo board I have jumped off the ledge in to the deep end.

I have a MBot 3D Cube that I’m using the frame and motors from which worked pretty well under it’s original setup.

I have pinned everything out and cross checked the reference material on this board and I have everything connected correctly from what I can see. I got it working with limit switches and DRV8825 drivers but they were very noisy so I replaced them with BigTreeTech TMC2240’s instead. I thought the config file was good too but I keep getting the error “Unable to write tmc spi ‘stepper_x’ register GCONF”. I have searched google but had no luck finding a resolution. Could someone assist me in getting this up and running?

Any help would be wonderful. Thank you in advance!

Printer Model: MBot 3D Cube
MCU / Printerboard: BigTreeTech SKR v1.4 Turbo
Motor Drivers: BigTreeTech TMC2240
Klipper Host: Ubuntu Desktop installed on laptop. Connected via USB.
Printer Config: printer.cfg (3.0 KB)

Hi @liveitnerd ,

Please attach the klippy.log

Hi @3dcoded ,

Sorry for missing the log file. Please see attached!

klippy(1).log (23.5 KB)

Hi @liveitnerd,
you log shows a rollover in line 387, meaning the klippy.log got too big and a second klippy.log (file) was started. You posted the second one, which doesn’t show the error. Please post the first one. If the log is too big, zip it.

Oh wow I’m doing great for my first post. I’m so sorry.
I have cleared the log, restarted the host, and tried to home the axis where I get the error. Attached is the fresh log file.
klippy(2).log (65.7 KB)

Thank you for your patience and assistance!

No stress :smile:

You get the error on all extruders (line 391 to 394)

TMC stepper_x failed to init: Unable to write tmc spi 'stepper_x' register DRV_CONF
TMC stepper_y failed to init: Unable to write tmc spi 'stepper_y' register DRV_CONF
TMC stepper_z failed to init: Unable to write tmc spi 'stepper_z' register GLOBALSCALER
TMC extruder failed to init: Unable to write tmc spi 'extruder' register DRV_CONF

Could it be those drivers don’t get supply voltage?

Chapter “II.SKR Motherboard Electricity:”
Please check the jumper setting. Make sure it is set to “2)When using 12v-24v power supply:”

Another thing is, under chapter “2. SKR Motherboard Parameters:” your TMC2240’s are not listed. But TMC5160 is listed, so it should work.

That header is used to select the 5V source on the board - either from the “DCIN” screw terminal or the USB Port.

The SRK V1.4 Turbo, like most smaller boards do not give the user the ability to select the stepper driver motor current source - if you look at the schematic, DCIN goes to VBB:

and then VBB runs to the motor driver socket without any method for the user to select another voltage:


After looking at the attached printer.cfg, can I as a question of @liveitnerd - why are you specifying the DIAG pins for each of the stepper drivers when:

  1. There is no socket to make a connection between the TMC2240 module’s DIAG pin and the board.
  2. The pins you are specifying are for the DIAG pins actually go to the endstop sensor connectors.

I guess you’re trying to work with sensorless homing but, due to the lack of the DIAG pin connections (which return the motor stall signal) they will never work.

You need to have physical endstop sensors when working with the BTT SKR v1.4 Turbo.


Once you remove the DIAG pin specification along with changing to a physical endstop, if things still don’t work, could you send a photograph on how you set your jumpers for the stepper driver modules?

Most likely you are missing a jumper here.

Thanks @hcet14 , I’ve checked out the jumper you noted and that is on VDD for source voltage. The other jumpers are all set to SPI under the drivers (so all left position) and the NPWR is set to +5v as I don’t have the 5vOT module.

From what I can see with the manual all of the other wiring is setup correctly.

1 Like

Thanks @mykepredko,

That’s a very detailed and great write up. The TMC2240’s I have do include a DIAG pin and looking at the other example driver configs they indicate that the SKR1.4 turbo can use the DIAG ping for sensorless homing as long as you don’t have end stop switches in place. I can cut those pins on the TMC2240’s and reinstate the end stop switches. I didn’t remove the switches from the printer in case i needed something like this. Here’s a link to the BTT TMC2240’s I’m using.

Here’s a photo of the printer mainboard and setup. The VIN is 24vDC as that is what the printer was originally setup as. There’s no fans populated on the board as I’ve got them running off a 12vDC supply as I changed the stock to Nocture for the noise. While there is a cable on the “TFT Display” port but it is not connected to anything.

Thanks again for all the help everyone is offering.

Hmmm… Looking at the pinout diagrams for the regular and “Turbo” they all show the two pin socket for the DIAG pin (with the only difference going from the basic to “Turbo” in the two diagrams is the addition of the word “Turbo” and changing the MCU from LPC1768 to LPC1769).

For the life of me, I can’t find the two pin sockets on the schematic:

https://github.com/bigtreetech/BIGTREETECH-SKR-V1.3/blob/master/BTT%20SKR%20V1.4/Hardware/BTT%20SKR%20V1.4-

I don’t get a good feeling about things when there are differences like this between the schematics and documentation.

Can I suggest that you don’t cut any pins until we have you communicating with the TMC2240s?

This isn’t what I was asking for - I was asking you to pull off one of the stepper driver modules and provide a photograph of the socket underneath so we can confirm that you have put the jumpers in correctly.

Along with the differences in the schematics and the pinout diagram, the “Instruction Manual” ain’t great in explaining things. In the disgram for SPI connections:

Please pull off one of your stepper driver modules and photograph how you’ve set up your jumpers.

2 Likes

Quite right, the difference between the schematic and the manual is annoying and concerning. I’ll look at reinstating the end stop switches as you’ve advised, after sorting communication with the TMC2240’s.

Here’s the image of under the motor drivers:-

While the E1 extruder channel isn’t being used I do have a driver for it if it’s meant to be populated for the SPI to work?

Your jumpers look fine.

I just ran through your pin definitions against the schematic and they looks fine. There’s still the question of how the DIAG pin and the AIN pins at the end of the driver module are wired on the PCB but they shouldn’t affect SPI communications.

Looking around, the only person I found with a working TMC2240 config also had the argument:

driver_TPFD: 0

in their [tmc2240..] statement.

I have no idea what driver_TPFD means but that’s the only thing I can think of right now for you to try.

Sorry, maybe something will come to me if I sleep on it.

Interesting thread. This post will probably not help!

I’m very unsure. Why shouldn’t sensorless homing working? Anyway, this should be the next step before liveitnerd got the SPI communication running.

Question @liveitnerd, what is the difference between a “BigTreeTech SKR v1.4 Turbo” and a “BigTreeTech SKR v1.4”?

I definitely agree.

Configuration reference - Klipper documentation says
#driver_TPFD: 4

I’m not happy with the printer.cfg from liveitnerd. We could compare the pinning of TMC5160 vs. TMC2240 step sticks? Because

All I read about TMC2240 regarding 3D printers is, they are tricky!

It looks like the only difference is that the turbo uses a 120MHz chip, instead of 100MHz

Klipper also supplies one config for both the v1.4 and the v1.4 Turbo, so I think that’s the only difference.

That was written after I looked at the schematic and didn’t see any sockets for the stepper driver module’s DIAG pin.

According to the BTT documentation, the regular uses the LPC1678 and the “Turbo” uses the LPC1679 - otherwise, they’re identical.

I suggested that because I found a working config that had driver_TPFD: 0.

I still can’t find a reference that explains what this argument does.

I did that last night when I was looking at the BTT TCM2240 stepper driver module schematics. I didn’t see anything that looked unusual - the only thing of note was pin6 of the module (CLK) but, according to the schematics, the pin on the board should be floating and the pull down on the stepper driver module will bring the pin to the correct state.

Any good references? I was always under the impression that they worked without any isses.

1 Like

Hi all,

Thank you for the continued assist on this. I really appreciate it.

I have tried adding the driver_TPFD: to each of the [tmc2240 sections with both the values of 0 and 4 separately though they didn’t change the situation.

If these turn out to be a problematic driver for this board I am open to recommendations on what I should purchase instead. I don’t want to waste money on replacing them if I don;t need to but appreciate I may have made a purchase that was ill-informed.

Thanks again to you all for your assistance. I really appreciate it.

Regards,
LiveItNerd

I’m very positive, we get your printer running with TMC2240.

Well, just a wild guess, SW SPI can be just too fast for SPI TMC Drivers.
That is it, it would be nice to probe it with an oscilloscope.
Looks like there is no HW SPI on these pins, at least on the Klipper side.

You may want to try the first patch from the: Software SPI: make it respect rate limits by nefelim4ag · Pull Request #6856 · Klipper3d/klipper · GitHub
After applying the patch, you can reflash your board, it should enforce SPI Rate limits.

All TMC SPI drivers support roughly the same SPI frequency, so there is no point in replacing them.
I was not successful in finding the actual limit, but it should be around 5.4 MHz.
IIRC, 5.2 MHz is working.

Klipper by default, expects TMC to run at SPI 4 MHz.
But SW SPI, currently, just runs as fast as it can.

Also, BTT TMC2240 should work, almost the same way as BTT TMC5160 does.
No magic tricks needed.

Hope that helps.


Btw, generally, if everything is connected correctly, it is easy to check by just run DUMP_TMC, there will be a lot of 0xff, if it is unable to read registers.


Any registers will do nothing there, because they should be written to take effect.
About TPFD, it looks like low-level tuning for SpreadCycle, and/or classic chopper modes.


1 Like

Worth a PR?

Worth a PR?

I’m not familiar with those MCUs, but it looks like there is no HW SPI for pins used for the TMC in this configuration.