Stepper Library not working properly in Protenta H7 breakout board

I have tried stepper motor controling using [SpeedyStepper](https://github.com/Stan-Reifel/SpeedyStepper) with Protenta H7 breakout board, but it's not working properly. can some one help me.

The issue's are so wired. if I connect to BOB to power supply (5V out) with-out the power (230V in) the example work's work's ( with the USB power ). If I just use USB the code doesn't work.

only method of working : USB + Power Supply (Without Power)

Help me out. Thank's !

Are the all GND's connected together? (Protenta board, motor, power supply etc?

Yes all connected together !

The only thing that comes to mind is that powerful capacitors are usually installed at the output of power supplies. At the moment the motor starts, it consumes a lot, then capacitors can help the USB to supply a high current.

Motor is powered with a separate power supply ( Using Clear path Nema 17 Motor )

And what does it mean that the scheme does not work? Arduino freezes or restarts?

Some time's motor work's, but some time's not. even the stepper libraries also not working !

sorry but your answer is not very informative

Solved the issue, The case was with the Clear Path wiring, I just looked at the PLC wiring only. after go through all resources figure-out the issue.

Wrong Wiring for the arduino H7:
1520178813211

Correct Wiring :

(Resource - How to Wire an Arduino to a ClearPath Servo Motor - YouTube )

I used the BOB board and the code :

// Bounce.pde
// -*- mode: C++ -*-
//
// Make a single stepper bounce from one limit to another
//
// Copyright (C) 2012 Mike McCauley
// $Id: Random.pde,v 1.1 2011/01/05 01:51:01 mikem Exp mikem $

#include <AccelStepper.h>
#include <Arduino_PortentaBreakout.h>

const int Enable = PWM0; // ClearPath ~enable input; +enable = BLU wire; -enable = ORN wire
const int InputA = PWM1; // ClearPath Input A; +InputA = WHT wire; -InputA is BRN wire
const int InputB = PWM2; // ClearPath Input B; +InputB = BLK wire; -InputB = YEL wire
const int HLFB = PWM3; // ClearPath HLFB Output; +HLFB = GRN wire; -HLFB = RED wire

//AccelStepper stepper; // Defaults to AccelStepper::FULL4WIRE (4 pins) on 2, 3, 4, 5

AccelStepper stepper(1, InputA, InputB); // Defaults to AccelStepper::FULL4WIRE (4 pins) on 2, 3, 4, 5

void setup()
{
  Serial.begin(9600);
  pinMode(Enable, OUTPUT);
  digitalWrite(Enable, HIGH);
  // Change these to suit your stepper if you want
  stepper.setMaxSpeed(800);
  stepper.setAcceleration(200000);
  stepper.moveTo(800);
}

void loop()
{
  // If at the end of travel go to the other end
  if (stepper.distanceToGo() == 0)
    stepper.moveTo(-stepper.currentPosition());
  Serial.println(stepper.currentPosition());
  stepper.run();
}

Now I'm looking forward to connect the motor to Machine controller , Tried the same code with the correct pin Configuration, but cannot figure-it out yet !

Thanks !