Hi. I connected it like the picture, but the motor doesn't work. It doesn't even vibrate and it doesn't work at all.
I used Nema17(17HS8401) and tmc2208. I used a 12V 3A adapter for the motor and connected to the computer with a usb port for the Arduino board.
The stepping rate is very high, might be to high. Make the step pulse high some 50 microseconds long and the delay to the next pulse 50 ms. When the motor rotates, trim the 50 ms down.
They are intentionally crossed here so that the neighbouring wires are each connected to a coil at the other end of the cable. At the motor this is not the case with these type of connectors.
...and doesn't require interchanging for either a Pololu B1B2A1A2 labeled driver:
or a Pololu 2B2A1A1B labeled driver.
or
I meant that one should check that your actual motor coil wiring matches your driver's actual connections. It's sometimes hard to tell by assumptions about the labeling, coloring, or ordering.
Is this a 4- or a 6-wire stepper? All steppers I came across so far with these 6-pin connectors and no centre tap of the coils ( 4 wire steppers ) are wired with crossover pattern. And that fits to this page of the used 17HS8401 motor. But of course there may be others too.
In any case it's always a good idea to check the wiring with a meter. And @ryohi_hyo already told us that he did so.
So I don't think that is the problem. And this type of wiring error usually leads to not changing the direction at all. @ryohi_hyo wrote it is changing randomly - which is a bit odd. Maybe there's a loose connection somewhere...
There's 6 pins on the motor, but the wiring harness that came with it has only 4 wires, looking much like the pic in top post. On my stepper, the three pins on the left have a center tap with 1.1 ohms between them, 2.2ohms total, and the right three wires are the same. As on this Minbea 17PM-K data page
I might hard-wire the DIR pin to GND or + and see if that keeps it uni-directional.