Per rnixon's suggestion, you could change the Pend to NOT pend forever. Check for the timeout return code and put out a char or blink a LED, that way you know the task is getting CPU cycles, and that the code is actually sitting on the PEND.
Another potential error is not using the same variable for the Post and the Pend. Since you're using a global, this means you have properly defined it in only one place and then properly declared it (using extern) in places where its being used. Redfining should result in a linker error but if you give it file scope or have it in a namespace it's easy to have two variables of the same name. Typically I create my semaphores as public static members of the class that is in charge of the interrrupt.
So if I have a class called Timer2 in the .h it will have
Code: Select all
public:
static OS_SEM m_pendingTimer2;
static OS_SEM& GetSemaphore(){ m_pendingTimer2;}
Code: Select all
OSSemPost(&Timer2:m_pendingTimer2;)
Code: Select all
OS_SEM& timer2_semaphore = Timer2::GetSemaphore();
Code: Select all
OSSemPend(&timer2_semaphore, WAIT_FOREVER);
If you're still stuck I would suggest creating a new device executable project and just paste in the code relevant to this issue. If you can't get that working then you could upload the project to something like BitBucket (or even just attach it to this topic) and someone might be able to see what you're doing wrong.