2025-01-03 07:28 AM
Good morning.
I have an X-NUCLEO-IHM03A1 stacked onto a NUCLEO-WB55RG. During a power down I immediately query the Powerstep01 (BSP_MotorControl_GetPosition) and write this value to flash. At reboot via the debugger I verify this position. I then write to the Powerstep01 this position using BSP_MotorControl_SetHome. Via BLE I get a notification that agrees with this postion. I then place a breakpoint just before the command BSP_MotorControl_GoTo(0, pos) and verify my BLE write value which is stored in pos variable. This new value is only a few counts from the last verified BSP_MotorControl_SetHome position. When I allow it to step over this breakpoint the motor takes off and just runs forever as if trying to go to 0 and I have to completely power down and start over.
Question. What is the powerstep01 command that I can call after a power cycle and load a legitimate value so that it thinks it is at that value and doesn't try and spin the motor to 0?
As an example I set the powerstep01 value to 0xFFFFAFAA and verify this in debugger and BLE. I then powercycle and upon repower verify that this value is in flash and that this value gets loaded BSP_MotorControl_SetHome(0,pos). I then via BLE send 0xFFFFB054 and verify this at breakpoint just prior to BSP_MotorControl_GoTo(0, pos) command call. But stepping over this the motor just runs and doesn't stop. If I do not power cycle everything works just fine. It is an issue with calling the correct command after a power cycle to force the powerstep01 to understand where it is???
Sincerely
Steve