|
How do I know if I'm overloading the RC program?
I'm an experienced embedded programmer, but I'm still getting to know the IFI RC. I'm getting the feeling that I'm on the hairy edge of what the RC is capable of.
Despite my best efforts to partition the program into neat modular sections, I'm starting to see erratic behaviour that is hard to explain from simple bugs.
I get different behavior just from adding a simple (fully tested) function call. Printf's stop working for no apparent reason. I'm now able to crash the program simply by flicking a switch, and I can even put the RC into a fault mode that is only recoverable by powering it down (resetting it won't fix the problem).
So, I have some basic debugging questions:
1) What causes the Program State light to flash? Is it detecting that my code is not doing something in particular (like servicing the shared memory)?
2) Could I be exceeding my stack size (from nesting my calls to deep)? Is there an easy way to increase the stack allocation, or will it just use available memory until it runs into data? I see the size set to 0x0100 in the linker but I'm not sure how to change it.
3) I've limited my use of floats to only the essential functions, but I assume that I could be burning all my CPU time in PID loops etc. Will the program crash if I don't service all my code in the allotted 28ms click time?
4) I'm using 4 analog inputs and the Gyro and the Camera... Any way to tell if I'm getting too many interrupts or other critical elements?
Thanks for any advanced "generic" debugging help.
Phil.
__________________
Phil Malone
Garrett Engineering And Robotics Society (GEARS) founder.
http://www.GEARSinc.org
FRC1629 Mentor, FTC2818 Coach, FTC4240 Mentor, FLL NeXTGEN Mentor
|