Hello,
Please check this reference design https://www.ti.com/tool/TIDA-01370 ( Closed Loop Stepper Motor Reference Design With Encoder for Stall-Detection ) to see if it can help.
BTW, the e2e forum can support specific questions about the motor driver device…