cancel
Showing results for 
Search instead for 
Did you mean: 

X-CUBE-SPN3 Demo Hanging on Wait Function

esnow
Associate

I'm attempting to run the X-CUBE-SPN3 demo for a single motor on the NUCLEO-F030R8 with the X-NUCLEO-IHM03A1 stepper motor driver. Importing the project into STM32CubeIDE went fine. I updated some of the parameters within the powerstep01_Init_u struct to match the stepper motor I'm using (Nema 17 Stepper Motor - 17LS13-0404E-100H), mainly the torque values. 

When I build and run the project, the demo starts off fine, but then pauses for multiple minutes before continuing with the next motor command. When I took a look through the debugger, I found that the BSP_MotorControl_WaitWhileActive() function was hanging. Specifically, the nested function Powerstep01_IsDeviceBusy() defined in powerstep01.c always returns true. Has anyone had this experience and been able to fix it? I'm a bit lost on where to go from here.

1 ACCEPTED SOLUTION

Accepted Solutions
esnow
Associate

My issue turned out to be two-fold. I had a ground loop problem when I was powering my dev board through my laptop's docking station. When I switched to powering it through the external voltage pins, things got a bit better. 

The other issue was that apparently the X-NUCLEO-IHM03A1 I was using had been used by someone else at my company for a different purpose. The motor config resistors were not set up for a single motor, which was causing the MISO line of the SPI comms to fail. This resulted in commands being sent successfully, but no status information could make it back to the dev board. Once I swapped the resistors to the correct configuration, the demo worked fine.

View solution in original post

1 REPLY 1
esnow
Associate

My issue turned out to be two-fold. I had a ground loop problem when I was powering my dev board through my laptop's docking station. When I switched to powering it through the external voltage pins, things got a bit better. 

The other issue was that apparently the X-NUCLEO-IHM03A1 I was using had been used by someone else at my company for a different purpose. The motor config resistors were not set up for a single motor, which was causing the MISO line of the SPI comms to fail. This resulted in commands being sent successfully, but no status information could make it back to the dev board. Once I swapped the resistors to the correct configuration, the demo worked fine.