Nano 33 ble reboot Wien mx1508

Hi i use the nano 33 ble to control 2 dc motors via the mx1508 dc driver module.
If i have an usb connected no problem
But when I power the motors and nano 33 ble from 4 AA Duracell batteries the system reboots intermediate. It is always when the pwm output goto 0.

Are there anything I Can do ?

Can you post a schematic of your circuit and your code?
First guess is that your battery power supply isn’t configured correctly or isn’t enough to drive the motors. We can’t know for sure unless you tell us what type of motors and how everything is connected. Even a hand drawn schematic is fine.