The servo can move using m280, and I wrote custom code to sweep the servo, but marlin resets after about 2sec. I tried running it without the servo as well, in case the servo is just really cheap, but it still causes a restart?
Watch dog enabled?
Post custom code, hard to say anything if nothing to check (memory leak, pointers etc).
Enough power for board and servo?
Watch dog enabled?
Any time you loop for a long time.... You need to call idle(); or the Watch Dog Timer will reset the board.
Thank you!!! adding idle() did the trick
@jerryerry, suggest you close this ticket :)