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.

The problem of IPC application

Hi,TI employee

      I have asked this question days before but no answer,so I think maybe I specify the problem not so clearly.Our application need core0 to synchronize all the cores,and we use IPC to accomplish it.But we found that during the debugging,when core0 send IPC for 1 time,some cores got it for twice.

     code is following(we have removed code that is irrespective.):

    count =0;

     while(1)

{

    if(coreNum == 0)

     {     for(i=1,i<8;i++)     CSL_IPC_genGEMInterrupt(i,0);    count++}

   else

{

         do{   result = CSL_IPC_isGEMInterruptAckset(coreNum,0)   }   while(result==0);

         CSL_IPC_clearGEMInterruptSource(coreNum,0);   result=0;

         printf("core%d receive IPC,index:%d\n",coreNum,count);

         count ++;

}

}

and when core0 send ist IPC(we make sure it by breakpoint),core1output:

core1 receive IPC,index:0

core1 receive IPC,index:1

core2,3 is the same,but other cores just get IPC for 1 time.

 Then we insert a delay(2500 cycles) between sending IPC to one core and next core:

  for(i=1,i<8;i++)    

{   CSL_IPC_genGEMInterrupt(i,0);    delay; }

then  this error disappers.

  So we guess that the IPC sended to one core affect other core.You can understand that delay is not a good way to solve this,so we want to know what cause all of this and if we have better way to solve that. 

Thank you.

  • Hi YUCHAO WANG,

    There should be just one Interrupt by setting IPCG, Can you post the full project,

    Many Thanks,

    HR

  • Hello

           Our project is too big and there is a lot of other irrespective contents.The code I provide is a project we extracted from the primitive project. And what do you mean by "just one interrupt"?Can't core0 send another IPC interrupt immediately after it has sended one?

  • Hi Wang,

    What I mean is that you can get an interrupt every time you set IPCG bit, you describe that you get at the destination two interrupts after setting the IPCG, can you post a small project example with your issue so I can review your issue?

    Many Thanks,

    HR

  • Yuchao,

    What you observed is expected behavior.  In your code, the core0 keeps sending interrupts to the rest of the cores.  With the way the code is doing, it's possible some of the cores can receive more interrupts than others during a short period of time.

    If you want each core to receive one interrupt at a time, you need to add some kind of synchronization scheme.

    For example, core0 needs acknowledgement from the rest of the cores indicating each core receives an interrupt.  For eacmple core0 can wait for interrupt from each of the rest fo the cores after sending out interrupts.  Once it receives interrupts from the rest of the cores, it can send the next round of interrupts to the rest of the cores.

    After receive an interrupt from core0, each of the rest of the cores should send an interrupt to core0 as acknowledgement.

    Adding delay certainly is another way to make sure each core only receive one interrupt at a time.  But it may not be 100% certain nor is it efficient.

    Xiaohui

     

  • Xiaohui

           Thank you very much for your answer,I will try the way you tell me.But I still wonder that why core0 send interrupt to core2 make core1 receive more interrupts.Can you tell me more details about the cause of this kind of appearence?

           Looking forward to your reply.

           best regards.

          Yuchao.

  • Hi HRi

           As you can see,TI employee has answered this question,as he say if I set IPCG for core1 then do the same for core2 without waitting for core1 receiving the interrupt,then core1 may receive twice.

           I have tried to upload project file but I failed,because our network environment is not so well,it's too slow to access the International website.If you still think it's necessary to see the whole project I can show you the main file.reply me if you need it.

  • Hi Wang,

    There is no way to set the IPCG of core#1 and get interrupt in core#2, as you can see in the system event table there is only one IPC_LOCAL event for each core, It will be great if you can post the whole project to see not just the main but also the configuration,

    Thanks,

    HR