Sections
You are here: Home Forum Bugs, Known Issues, & Requests Tasks crashing other tasks?

Tasks crashing other tasks?

Up to Bugs, Known Issues, & Requests

Tasks crashing other tasks?

Posted by Hugobox at October 02. 2008

Hi!

I have this firmware based on Heavy that I added 3 tasks: 1 to read from the serial port, 1 to write to the serial port and the other to send OSC when the 1st task has read something new.
The problem is that while individual tasks are working great individually, when 2 or more tasks are running at the same time, some tasks RANDOMLY crashes: usually, the board will stop communicating via USB and Ethernet after a few seconds or minutes, so I assume that the tasks OSC-UDP, OSC-USB, LwIP or ETH_INT are crashing. When that happens, sometimes my tasks crash also, sometimes they keep running (at least my serial output task sometimes continue to output). So its a task crashing problem and not a whole board rebooting thing, since the board doesn't reboot.

When my 3 tasks are running succefully, I have a freememory of 4252

My Heap size is set to 22000.

Here's my tasks creation arguments:

TaskCreate( DMXout, "DMXout", 400, 0, 5 );

TaskCreate( DMXIn, "DMXIn", 600, 0, 6 );

TaskCreate( DMXAutosend, "DMXAutosend", 400, 0, 3);


Do you have an idea what can cause this behavior? Any hint would be highly appreciated.Thanks

Re: Tasks crashing other tasks?

Posted by Liam Staskawicz at October 02. 2008
It's probably all about how much stack you've allocated each of your tasks. If you still have 4252 bytes free, I would experiment with making each of your tasks a bit bigger.

Re: Tasks crashing other tasks?

Posted by Hugobox at October 02. 2008

I've increased the stack to 1000 bytes each, but the crashes still appeared. Then I reduced the priority of the tasks to 4 and it seems more stable now.

Re: Tasks crashing other tasks?

Posted by Liam Staskawicz at October 02. 2008
Ah, that would make sense too. I suppose if some of the communications tasks were being pre-empted too often they might not be very happy. Thanks for that tidbit...could be helpful for others troubleshooting as well.
Powered by Ploneboard
Document Actions