I’m having an issue with using AccelStepper to drive my motor through a DRV8825 driver using an ESP32C6 Seeed board. Every two seconds the motor pauses for a very short period and then runs again. I suspect it could be due to servicing of the radios on the C6 board except that a) the radios aren’t enabled in my code and b) the C6 is supposed to have two cores such that that sort of servicing can be handled without interrupting the application flow. I’ve read a workaround for these types of pausing issues is to use one of the built-in modules in the SOC, such as the RTM or MCPWM, however AFAIK AccelStepper doesn't support that approach.
To make sure the problem doesn’t stem from the library, I tried a trivially simple loop to run the motor at constant speed forever:
This code still results in the every-two-seconds glitch (motor pauses momentarily and then restarts and runs for two seconds, etc.).
Does anyone have and ideas how I might resolve this issue? Thanks!
Yes, it looks like as intended, you have isolated the issue to hardware and not the library. I don’t have any advice on this but I like Daniel’s suggestion because if it is a crash then the output could be helpful. If so, perhaps you could post it here as a matter of interest.
The Panic Handler will print the full crash output (panic message + registers + backtrace) to the console. You can then extract PC and backtrace addresses, and using addr2line with ELF file, decode addresses to source code lines.