Page 1 of 1

Task Lockup

PostPosted: Wed Apr 13, 2011 10:56 am
by Bouwser
Hello,
I am using Salvo 4.2.2 with the dsPIC33FJ64MC804, with the C30 compiler v3.23 and MPLAB 8.60.

I have a particular task that sits waiting for a message. When it gets the message it runs and then waits until another message arrives. The message is sent from another function about once every 30 ms. Most of the time everything works as intended, however, occassionally (once every 6 hours) when signalling the message, the OSSignalMsg() function returns OSERR_EVENT_FULL. Once, this happens it always returns OSERR_EVENT_FULL. In addition, the OS_WaitMsg() never wakes up. So I get in a locked up state, such that I can't signal the message because the OS says its full, but the OS never wakes up the task waiting for the message. This persists until the device is reset.

I feel like I'm blind in terms of understanding why the OS doesn't schedule the OS_WaitMsg() to wake up and I'm blind as to why the OSSignalMsg() is returning OSERR_EVENT_FULL. Any help on where to start debugging this would be greatly appreciated.

thanks,
Brent

Re: Task Lockup

PostPosted: Thu Apr 14, 2011 11:09 am
by aek
This situation has come up a few times lately, and in all the cases, the problem was traced back to an errant user pointer that was clobbering a Salvo global object (located in salvomem.c).

This doesn't mean that this is what is affecting you, but it is the likely cause.

1. Post your Salvo hooks, salvocfg.h, and ISRs.

2. Does the problem happen with optimizations (globally) enabled and disabled?

3. If you "move" the salvomem.o module to a different place in memory (e.g., by editing the linker script / .gld file of the project or by "padding" data on either side of salvomem.o's objects), does the error still occur?

What you're seeing is not Salvo messing up in realtime ... it's that something has clobbered a Salvo object, and hence the behavior is weird / wrong. The source of the clobbering could be external (IMO, likely), or it could be internal to Salvo.