I am trying to use a Raspberry Pi 4 with a Nima 17 stepper motor using the DRV8825 driver. The motor has 200 steps per revolution, and I am using the following code:
from time import sleep
import RPi.GPIO as GPIO
DIR = 19 # Direction GPIO Pin
STEP = 26 # Step GPIO Pin
CW = 1 # Clockwise Rotation
CCW = 0 # Counterclockwise Rotation
SPR = 200 # Steps per Revolution (360 / 7.5)
GPIO.setmode(GPIO.BCM)
GPIO.setup(DIR, GPIO.OUT)
GPIO.setup(STEP, GPIO.OUT)
GPIO.output(DIR, CW)
step_count = SPR
delay = 0.005
for x in range(step_count):
GPIO.output(STEP, GPIO.HIGH)
sleep(delay)
print('rot')
GPIO.output(STEP, GPIO.LOW)
print('stop')
sleep(delay)
sleep(.5)
GPIO.output(DIR, CCW)
for x in range(step_count):
GPIO.output(STEP, GPIO.HIGH)
print('rot-')
sleep(delay)
GPIO.output(STEP, GPIO.LOW)
print('stop-')
sleep(delay)
GPIO.cleanup()
However, the motor keeps vibrating in both directions and won't work at all. I verified the direction is correct, and I am following the schematic shown below:

I am not currently connecting the m0, m1, m2 pins.