Running motor with only PWM pin

I have connected the motor to my single board computer using DRV8835 motor controller (not the kit, just a single unit controller version) and found out that I cannot use the official software to control the motor.

Therefore, I have used a regular GPIO libary to control it. Now the question is, why do I need to connect a GPIO pin together with PWM pin in order to control 1 motor? From my experiment, I could control the motor only using 1 PWM pin.

Is that okay to use it like that?

Hello.

It sounds like you are asking about connecting a single GPIO pin to one of the xPHASE pins for direction control. If you do not need to control the direction of rotation of your motor, you do not need to dedicate a GPIO pin to it.

-Jon

Thanks for your answer.
When I connect both PWM and GPIO, my motor starts to run at full speed and if I detach the GPIO pin from the motor driver it stops. Do you know why?

Based on the behavior you are getting, it sounds like your system might not be sharing a common ground. If it is not already, can you make sure that ground on your single board computer is connected to GND on your DRV8835 carrier? If both devices already share a common ground, can you post pictures that clearly show your connections and soldered joints?

-Jon

Basically, I have used other GPIO pins which are at LOW during the boot of the system.

Generally, all electronics in a system should share a reference to ground and these connections should be maintained throughout the operation of the devices (not just at start-up). In this case, the lack of a common ground seems likely to be directly responsible for the behavior you are getting.

-Jon