This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Statement does not time out: status = SEM_pend(&SEM0, 10);

Other Parts Discussed in Thread: CCSTUDIO

Using BIOS 5.41.04.18,  CCS 3.3.38.2,  Code Generation Tools: v6.1.16,  Target Processor OMAP2430 IVA core

I have a BIOS thread of priority 1 and I have a BIOS semaphore statically created. My taskis run upon start-up.  When it gets to the SEM_pend(&SEM0,10) statement, it never times out.

A workaround that I found that works is to create second task within the IDL running at priority 0 and a second semaphore.  This Idle task only signals this second semaphore.  Now if I put a second "SEM_pend(&SEM2, SYS_FOREVER) at the top of my priority 1 task, then the SEM_pend(&SEM0,10) will time out as expected.

Is there a better way, or a more proper way?

Thanks; 

  • Leon,

    Usually when timeouts don't work, it's because the user has not enabled the CLK manager, or the CLK module is not set up to drive the system clock.  Have you checked that?

    I couldn't really make sense of your description of what's going on.  And I didn't understand what you meant by "create second task within the IDL".

    One thing you might try is to run the semaphore example that comes with BIOS.  I don't believe it has a timeout value specified in the SEM_pend() call, but you could just put a timeout value in there to see if it works.

     

  • I tried the example in: C:\CCStudio_v3.3\bios_5_41_04_18\packages\ti\bios\examples\basic\mutex and I modified it with a wait as in my other program and it did not freeze at the SEM_pend(xxx,10) call.  I will look further into my program to see what the differences there between the two.    Thanks