I am using PK51, which comes with RTX51 tiny. I am trying to use the os_wait command from a function. This is code I'm using.
while (something) { CallFunction(some,thing,here); .. <continue processing> .. }
CallFunction(some,thing,here) _task_ some_task { .. os_wait(K_SIG | K_TMO, 1,0); .. }
Have you ensured that the WD is "fed" during the OS wait? If not, it will obviously "bite" you - that's its job!
Andy: How can I reset the WDT if I'm using os_wait? Thank you!
"How can I reset the WDT if I'm using os_wait?" I have no idea - I don't use RTX51! You're the one that's using RTX51 so, hopefully, you have determined that it is suitable to your application - and that would include determining that it can handle your WDT!
With two inputs, I'm not sure who the op is here but Bob's code frag does not make RTX sense. Please post some real code so we can help. You appear to be trying to call a TASK not a function. You should create a task and call a function. Your os_wait call, as written, should return ready within one system tick. What's the tick value? Do you have other tasks running? An os_wait suspends just the one task so what task is feeding the watchdog? There are a lot of ways to use a watchdog in an RTOS but you must make sure each task is running to completion. I assume that you have that in mind when you use the OR term of K_SIG and K_TMO. Also, review the conf_tny.a51 file to see if you have enabled the IDLE mode. I suggest that it be disabled during initial coding. In any of your code do you attempt to disable interrupts? Some better code fragments might enable us to understand your problem. One other point. When you have multiple test functions in an OS call, always test and handle which test terminated the os_wait. Example val = os_wait(K_SIG | K_TMO,1,0); A manifest constant of the event is returned. Bradford