Search for JEM. I tried to add that comment to the locations I changed.
Another change I made was in
TMC2130Stepper.cpp
Around line 35
{
// JEM
// SW_SPIClass *SW_SPI_Obj = new SW_SPIClass(pinMOSI, pinMISO, pinSCK);
// Serial.println(F("TMC2130Stepper::TMC2130Stepper -- TMC_SW_SPI = Not NULL, Using SPI."));
// if (SW_SPI_Obj == NULL)
// Serial.println("SW_SPI_Obj == NULL JEM.");
// TMC_SW_SPI = SW_SPI_Obj;
TMC_SW_SPI = NULL;
defaults();
If I remember, the variable SW_SPI_Obj was previously being set. I chose to leave it at null. When this was set, the code went to locations that worked on an arduino but would not on a teensey. I think the code made use of hardware features on the arduino which did not work on the teensey. Those would be in the SW_SPI_Obj class that now is bypassed to other logic that works correctly on the teensey. You can look at that to see.
When I last used this with my new board, all worked fine. I felt it was reliable with my new board and code fix.
I then switched to making sense of the 5160 advanced features like stall guard and controlling the motor in ways to not lose steps and get to a position. I was always interested in the 5160 features of telling it to move a motor to a specific posiiton and reading out its progress. My motors do not have encoders. If they did, the 5160 has some great features to make that even more reliable than the blind positioning operations I relied on.
Suffice to say, I do like the Teensey 4.1 and Bigtreetech 5160 chip combination.