willywortel wrote on Monday, February 09, 2009:
Hi,
First of all, thanks again for all your support so far. I really liked it.
Tomorrow I’ve my first milestone, then I’ve to present my boss the software that I have already.
I managed to get the OS quite stable, but I had to remove some things for it :(. For example the RS232.
I am now already spending three days to find the unpredictable behavior of the OS when integrating the RS232, interrupt based. I`m a bit clueless, I did all the things I could find on the website and more.
Problem:
Random freezes of the OS when using the RS232 task.
Info:
PIC32 port with multi vector interrupts
Using MP-LAB IDE with Microchip compiler
Running total of 7 tasks:
- Display gatekeeper Task
- SPI Task
- RS232 Task( actually RS485 )
- KeypadTask
- Menu Task
- Task manager (the one that spawns all the tasks)
- Analog to digital
Note:
Different tasks can get each other data by using the defined functions like getAdc, setSpi, etc. Every get/setter is protected by a Mutex or Queue.
What did I try:
1:)
See if it is not a stack overflow by using the method 2. Unfortunately this macro doesn’t work for me. I don’t know if it is a processor specific thing. When I paste the prototype and function in the main, it will never gets executed. I tested this by stripping down a task stack to a known value where it should overflow. Nothing happened.
2:)
So I tried a piece of my own. I created a function like this:
if( uxTaskGetStackHighWaterMark( NULL ) < 100 )
{
// not enough stack
while(1)
And called it in every task. Since I’ve put a breakpoint in the while, I get noted if a task has less than 100 stack left (I know, this is much. But for the debug only).
No task gets here, so I assume that every task has enough stack. (May i assume this?)
3:)
With the MPLAB Real-Ice i checked many status registers when the OS freezes. Like some status from peripherals from SPI / RS232, but found nothing special. I see that the Timer1 is still incrementing. But no other task gets executed any more when a freeze happens.
What I did not yet tried is to use the trace utility. That is because I do not yet own a Logic Analyzer. I will order this somewhere this week, so i hope this will help to solve more.
Does anyone have any idea’s where I can look for now? I am really clueless =(.
This is my first OS and I really like it. I`m also introducing it on my work and there is a high change that they will use it in the feature. So I then hope to switch quickly to the commercial variant (for some real support )
Hope someone can give me some advice, thanks.