bizarre restart bug: calling arduino ninjas.
hey all,
so, i've been working on code arduino little on month now. last 2 weeks have been spent fighting real bastard of bug. i have years of experience programming, i'm not n00b, first major microcontroller project. i've read tons of stuff on arduino, atmega168's, etc. i'm @ wits end , hoping genius forums can help.
first, program i'm writing arduino firmware reprap machine. i'm trying squeeze program 3-axis stepper controller, temp sensing, , other random stuff. the arduino brains , controls array of boards actual work. the reprap project has host program written in java sends , receives commands on serial connection. i'm implementing protocol on arduino. easy, right?
the approach took write libraries, , use these handle code. there copy of recent code, located here: http://www.osotite.com/dump/reprap-arduino-firmware-2008-02-17.zip
okay, lets down problem. basically happening there few circumstances trigger program reset. i have debug code in setup() function prints out 'begin'. i'll run host software bit until bug triggered, @ point setup() function seems run again! the 'begin' string printed out, , program execution continue normal (well, except reset!)
like said, i've spent weeks on bug, i've narrowed down couple of specific cases. the simplest on i'll trigger 'homereset' on y axis, 'seek' point. that cause take few steps, reset. the bizarre thing happens y axis!! both x , z axes can home seek no problem. also, when y axis not @ home, can seek around no problem.
i've tried can think of try , track down bug.
i dont think brown-out reset, because arduino doesnt hit bootloader... goes straight beginning. not that, have random movement tester works 100% fine boards... no resets. (also, bug happens stepper boards unconnected!)
i dont think timer issue because happens when run @ 1 rpm, , stepper interrupt runs fine @ high speeds (300+ rpm)
the thing can think of right 1) bug in software, possibly because i'm doing wrong microcontroller doesnt like.
would please on code, both libraries , sketch called 'single_arduino_snap'? i'm in bind here because not firmware not drive boards, doesnt work else out there trying run reprap machine off arduino.
if find bug, promise i'll send special printed machine.
so, i've been working on code arduino little on month now. last 2 weeks have been spent fighting real bastard of bug. i have years of experience programming, i'm not n00b, first major microcontroller project. i've read tons of stuff on arduino, atmega168's, etc. i'm @ wits end , hoping genius forums can help.
first, program i'm writing arduino firmware reprap machine. i'm trying squeeze program 3-axis stepper controller, temp sensing, , other random stuff. the arduino brains , controls array of boards actual work. the reprap project has host program written in java sends , receives commands on serial connection. i'm implementing protocol on arduino. easy, right?
the approach took write libraries, , use these handle code. there copy of recent code, located here: http://www.osotite.com/dump/reprap-arduino-firmware-2008-02-17.zip
okay, lets down problem. basically happening there few circumstances trigger program reset. i have debug code in setup() function prints out 'begin'. i'll run host software bit until bug triggered, @ point setup() function seems run again! the 'begin' string printed out, , program execution continue normal (well, except reset!)
like said, i've spent weeks on bug, i've narrowed down couple of specific cases. the simplest on i'll trigger 'homereset' on y axis, 'seek' point. that cause take few steps, reset. the bizarre thing happens y axis!! both x , z axes can home seek no problem. also, when y axis not @ home, can seek around no problem.
i've tried can think of try , track down bug.
i dont think brown-out reset, because arduino doesnt hit bootloader... goes straight beginning. not that, have random movement tester works 100% fine boards... no resets. (also, bug happens stepper boards unconnected!)
i dont think timer issue because happens when run @ 1 rpm, , stepper interrupt runs fine @ high speeds (300+ rpm)
the thing can think of right 1) bug in software, possibly because i'm doing wrong microcontroller doesnt like.
would please on code, both libraries , sketch called 'single_arduino_snap'? i'm in bind here because not firmware not drive boards, doesnt work else out there trying run reprap machine off arduino.
if find bug, promise i'll send special printed machine.
my guess you're running out of ram, , causing stack (including return addresses) overwritten (possibly 0's), , when function returns, it's jumping start of program (address 0). or running out of ram causing other strange failure mode creates behavior you're seeing. can temporarily comment out variables / lookup tables / strings in code? or use smaller data types anything?
Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > bizarre restart bug: calling arduino ninjas.
arduino
Comments
Post a Comment