AnsweredAssumed Answered

MPC5775k Core 2 (z7 core2) can not get semaphore

Question asked by zhang san on Apr 21, 2016
Latest reply on Apr 28, 2016 by zhang san



Base on the example "",  I create a project for all three cores. When I test the semaphore, I find core 2(z7 core2) can not lock the semaphore, as the following:


#define UNLOCK 0

#define CORE2_LOCK 3

#define GATE_0  0


/*when the Gate is not lock*/
while(status != CORE2_LOCK)
  /*Lock the gate*/
  status = Lock_Gate(GATE_0);     //always in this loop, can not go through! Already make sure other cores/tasks will not take any semaphores.

/*Execute critical section*/
px1->myint = 20;

while(status == CORE2_LOCK)
  /*Unlock the gate*/
  status = Unlock_Gate(GATE_0);
/*End of the critical section*/


The value of GetCoreID() is 2, as expected. And core0 and core1 can get and release semaphore as expected. thanks!