digistump / OakCore

Arduino/Platformio Core for Oak including Particle library
GNU Lesser General Public License v2.1
55 stars 28 forks source link

Oak crashes while controlling stepper motor. #66

Closed joeycortez42 closed 8 years ago

joeycortez42 commented 8 years ago

I have a 28BYJ-48 stepper motor with a ULN2003 Driver connected to my Oak. The code runs fine on an Arduino Uno, but when I transferred it over to the Oak it crashes after just a second of rotation. I am using the AccelStepper library to help control the movement, but I found other people having success with AccelStepper and a ESP8266 type board.

Here is the serial output of the crash:

Soft WDT reset

ctx: cont 
sp: 3fff4230 end: 3fff4510 offset: 01b0

>>>stack>>>
3fff43e0:  00000000 40c38800 000000c0 402080d2  
3fff43f0:  3fff4420 3ffe95f8 3fff44e0 4020841d  
3fff4400:  3fffdc20 3fff32dc 3fff32e4 4020870a  
3fff4410:  3fffdc20 3fff32dc 3fff32e4 4020889a  
3fff4420:  3fff722c 3fff34d5 3fff32e4 40207edb  
3fff4430:  3fff72b0 0000001f 3fff34d5 3fff34dc  
3fff4440:  3fffdc20 00000000 3fff34d5 40207fe0  
3fff4450:  3fff6c08 00000000 3fff7138 0000001f  
3fff4460:  00000014 40000050 3fff7168 0000003f  
3fff4470:  00000038 3fff3400 3fff6c90 0000000f  
3fff4480:  00000000 3fff6cb0 0000000f 00000000  
3fff4490:  3fff7108 0000001f 00000011 00000000  
3fff44a0:  00000000 000000c8 ffffffff 4020f400  
3fff44b0:  3fff71e8 0000000f 0000000e 3fff7228  
3fff44c0:  0000000f 00000004 3fff7208 0000000f  
3fff44d0:  00000006 3fff70e8 0000000f 0000000e  
3fff44e0:  3fff71b8 0000001f 0000001b 40207dce  
3fff44f0:  3fffdc20 00000000 3fff34d5 4020ad8e  
3fff4500:  00000000 00000000 3fff34f0 40100114  
<<<stack<<<

 ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x40100000, len 3632, room 16 
tail 0
chksum 0xc0
load 0x3ffe8000, len 352, room 8 
tail 8
chksum 0x82
csum 0x82

OakBoot v1 - W,BU,0

Any ideas on what could be causing it?

digistump commented 8 years ago

For some reason it is causing your Oak to enter a endless loop or similar lock-up - which is why it is triggering a Soft WDT reset. I think accelstepper might not light getting interrupted during delays for the network functions to take place - it is known to be a library that is picky about things like that. You may need to modify the library to use internal_delay() instead of delay().

Closing because this is not a library that is part of this core - but feel free to follow-up here if you have additional findings/questions.