Running a DC Motor with Arduino

Hello Hivemind I need some assistance.

So I have a motor that I pulled from a low voltage cordless drill. The label on the side of the drill says that it is a LESHI MOTOR 540PV-63596 6.4V 150417/D. I am trying to run said motor using an arduino. The hardware I am trying to use is an Arduino Uno, a BTS7960 Motor driver or a L298N Motor driver. The power supply is a wall adapter rated with an output of 5v DC at 2000mA. I have confirmed that just plugging the motor into the adaptor allows it to run at full speed. I am trying to PWM control this motor but so far neither the BTS7960 or L298N works. At best the BTS7960 causes the shaft to twitch but it does not do a full revolution.
The following code is used for the BTS7960

int r_en = 2;
int l_en = 3;

//Use PWM pins
int r_pwm = 5;
int l_pwm = 6;


void setup()
{
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
}

void loop()
{
  //To enable forward and backward
  digitalWrite(r_en, HIGH);
  digitalWrite(l_en, HIGH);

  //RPM in forward and backward
  analogWrite(r_pwm, 255);
  analogWrite(l_pwm, 0);
}

And for the L298N


int IN1 = 2;
int IN2 = 3;
int pwm = 6;


void setup()
{
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(6, OUTPUT);
}

void loop()
{
  //To enable forward and backward
  digitalWrite(IN1, HIGH);
  digitalWrite(IN2, LOW);
  analogWrite(pwm, 255);
}

Any assistance would be appreciated as I have ran out of ideas and am on the verge of scrapping this project.

The drill motor may draw as much as 20 Amperes at startup, which will immediately shut down motor drivers that cannot handle that current. For example, the L298 is limited to 2A peak, 1A continuous.

I'm surprised that the wall adapter works, but imagine that the motor starts slowly. The motor power supply should also be rated for something like 20 A. A 12V motorcycle or car battery should work.

To estimate the start/stall current, measure the motor winding resistance using your multimeter. Turn the motor shaft very slowly and take the lowest reading you get.

Divide that value in Ohms into the power supply voltage to get the startup current.

The BTS7960 requires a minimum supply of 5.5V
The L298N will drop the 5V to low to make the motor turn

So I should change my power supply? The purpose for this is to run it off wall power. Any idea what specifications I should look for with the wall adapter?