I am using an ESP32-Devkit V1 as an embedded motor controller. It is hooked up to a DRV8835 Polulu Dual Motor driver to which I have connected two DC motors.
Everything seems to be working fine when I upload and execute the program without debugging.
However when I upload and debug via JLink the motor control pins are kept high, which in my case spins the motors at full speed. This happens during the connection phase. Once the program is executing and hits the first breakpoint at the setup() function the motors stop spinning. When I disconnect the debugger the motors also spin at full speed for a split second.
What could be causing this and is there a workaround to stop this from happening?