I have had this same problem. The way it would happen with me was that the
computer would freeze entirely three times out of 10 times that I ran my
code. Either that, or it would restart Xwindows, or Enlightenment would crash
with some Aieeeee! error messages, etc. etc. I would even restart the machine
and the code would not run even after restarting the machine or even turning
it off. Other times it would run fine for a few days in a row, and other times
it would fail every single try. This happened irrespective of whether or not we
restarted/turned off-then on the machine. The first times that this happened,
I was even certain that I had damaged the 8254 in my computer in some way.
I was able to fix it by doing the following.
TEMPORARY FIX:
I would run the "Frank Zappa" module about 10 times and then I would run my
code again. This would fix the problem until the next time that it decided to
freeze up again (henceforth termed "the freeze from hell"). Thus, here at the
lab we started to call this solution the "Frank Zappa" solution, or "Frank
thaws freeze from hell" -- and now every time something else goes wrong in the
lab (even if it is no longer associated with my code), we say "just pull a
Frankie", in terms of simply making a kludgy solution.
LONG TERM FIX:
The above technique came to be somewhat annoying, especially since we are
running a real time controller on a magnetic bearing and often we needed to
stop and restart the magnetic bearing controller whenever we made changes to
the hardware.
I was intrigued by the fact that the Frank Zappa module never crashed, yet my
code did. Therefore, I studied both my code and the Frank Zappa module as
much as I could and found that the main difference was that the Frank Zappa
module called rt_task_init() and rt_task_delete() from the init_module and
cleanup_module routines, respectively. My code would call these functions
once upon startup of my controller, and once upon termination of my
controller, thus I would ask the system to allocate the resources every time I
started running my controller and would disassociate them upon termination of
my controller. My guess was that I was requesting all of these resources from
the system, and then, before the system had finished giving them to me, I
would run rt_make_periodic (this is what actually seemed to freeze my code).
So, what I did was to move my rt_task_init() and rt_task_delete() calls to my
init_module and cleanup_module routines. Now, I exclusively call
rt_task_make_periodic and rt_task_suspend each time I begin running my code or
terminating my code, respectively.
This seemed to fix the problem. It has not happened ever since in the two
machines that we are currently using. And other than this slight problem, we
have found the beta11 to be an incredibly solid platform for our real time
controllers, even at the controller execution rate of 6,000 Hz.
I hope this helps.
-Edgar
--- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
----
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/