I’m seeing some weird behavior out of the RC, and was wondering if anyone has seen similar.
We are using Kevin Watson’s ifi_sensor workspace as a baseline, and have multiple modules plugged in on top of it, tied together in various ways. Pretty standard stuff.
When the robot is first turned on, there is a code error, and the red light blinks. Upon a reset, the code runs smoothly as expected; resetting the RC after initial boot does not cause this problem. The bug seems to be limited to full power cycles only.
Is there any extra initialization on a cold boot? I believe I may be tripping the watch dog, but can’t be entirely sure.
There’s a ton of extra initialization on a cold boot. At the very least, all the inline initialized variables are re-initialized during a cold boot, thus why people often have failed autonomous modes after a field error. There’s a fair bit of processor memory clearing and such like as well. If you’ve fiddled with that code then that might do it.
There’s a ton of extra initialization on a cold boot.
Could you be more specific? On a cold reboot (power up) and upon a reset, the processor vectors through 0x0000 - the reset vector - and then does:
_entry -> jumps to _startup
_startup -> sets up stack/frame pointers
calls clear ram memory routine to zero in all ram banks (except for F00-F5F)
**calls _do_cinit which initalizes all ram locations to user declared defaults**
calls main
main
:
.
}
It should be the same for a cold boot vs reset as it executes the same code?
If you zip up your code and e-mail it to me I’ll have a look. If I remember correctly, I disabled the watch-dog timer in the library code so this shouldn’t be a problem. I haven’t reverse engineered the master processor code (yet <grin>), so I don’t know if it’s enforcing some kind of initialization time limit. For grins you could try commenting out the memory clearing code in _startup and see if that makes a difference.