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.

Semaphore bug : SEM_pend( ) error in 6437 EVM

Other Parts Discussed in Thread: CCSTUDIO

Dear Sir,

I use a semaphore to sync 2 tasks on 6437 EVM.

Please refer to the following for my code:

 

In task1: (Higher task priority:5)

SEM_Handle semYBufRdy;

semYBufRdy =  SEM_create(0, NULL);

SEM_pend(semYBufRdy , SYS_FOREVER);

 

In task2:(Lower task priority:1)

extern SEM_Handle semYBufRdy;

 if ( SEM_count(semYBufRdy) == 0 )
 {
   EDMA3_Copy( (signed char *)y_buffer, (signed char *)net_y_bufferA, FRAMESIZE );
   SEM_post(semYBufRdy);// Signal Y buf ready
 }

 

Task1 will be stuck in "SEM_pend(semYBufRdy , SYS_FOREVER)" after running my program for 1 or 2 minutes.

Then I check the count of the semaphore, the count is "1"!!

Why does my program get stuck in SEM_pend() while the semaphore count is "1"??

Please help me out. Thank you!!

Best Regards,

Eric Fang

 

 

 

  • There may be a few things not readily apparant that may affect the operation of your example.  As a test, I would suggest trying to use of the existing DSP/BIOS examples that implement semaphores as a test and validation that your setup is working.

    One of particular interest would be the C:\CCStudio_v3.3\bios_5_31_02\packages\ti\bios\examples\advanced\semaphore\evmDM6437.

    This should illustrate a similar concept to your example and should be configured correctly.  If you are able to successfully get this example to work, then a comparison to your own example can be made.