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.

6657的IPC通信与中断挂接的问题



我做的IPC通信是以那个常见的6678 core0->core7顺序循环例程为基础改写的。

例程的通信方向是单向的,如core0到core1,我要实现的是双向的,即还有core1到core0。

现在是两个core都与中断挂接,除了函数中CSL_intcOpen(&IntcObj,   eventID,   &vectID,  NULL);的参数eventID(host中断号)相同,都是IPC_LOCAL之外,其他
地方的参数设置都不一样,如系统中断号、通道号、vectID。

现在的问题是只能单向,无法双向,实验现象是只看到一个core在发,另外一个cor在收。问题出在哪里?

  • 补充说明:

    我想要的功能是每个core可以在任意时间向对方发起IPC通信,而不是像例程中的在ISR程序中完成IPC接力通信。

  • 您好,

    所谓只能单向,是说同一时刻智能core0向core1发,或者core1向core0发,而不能同时发么?还有你上面说的通道号是个啥东东?由于IPC中断事件是直接路由到INTC,所以没有什么通道号的概念,只需要将IPC_LOCAL与vectID映射即可。

    在出问题的时候通过查看寄存器IPCGR及IPCAR看看是否被置位,并且注意在响应完中断后需要写相应的IPCAR清除中断。详请阅读IPC手册。

  • 我想实现的功能如下所示:

    问题出在程序无法进入标红的那行程序。

    ……

    void main(void)

    {

    ……

        /* Get the core number. */

        coreNum = CSL_chipReadReg (CSL_CHIP_DNUM);

        if(coreNum == 0)

        {

           gpioInit();

           EDMAInit();

        }

        IntcInit();

        if(coreNum == 0)

        {

            CSL_edma3HwChannelControl(hChannel_DDR3_read, CSL_EDMA3_CMD_CHANNEL_SET, NULL);

        }

        else

        {

        }

     

        int kkk;

        for(kkk = 0; kkk < 100; kkk++)

        {

     

           if(coreNum == 0)

           {

               IssueIPCInterrupt(1,64);

               ……

           }

           else

           {

               if(ipcgr_value == 64)

                  IssueIPCInterrupt(0,128);

                  ……

           }

        }

    }

  • ipcgr_value是在ISR程序中修改的,刚开始的时候是64,从ISR返回后又变为0,导致无法执行IssueIPCInterrupt(0,128);

    有时候还会连续两次进入ISR程序,ipcgr_value第一次是64,第二次是0。想不明白怎么会两次进入?第一次的时候IPCAR已经清零了啊。

  • 您好,

    有可能是中断产生太快了导致一直进入中断。可以通过测试确认:首先测试每个核只发一次中断,看对端中断服务函数是否能响应;然后再测试多次,但是相邻两次中断增加相应的延迟。

  • 谢谢你的解答。

    还有一个问题是core1接收到core0的IPC后,会两次进入ISR,正常情况是一次,core0就是正常的,现象可以看下面打印出来的信息。

    [C66xx_1] Set interrupt to Core 0
    [C66xx_1] Interrupt Info 0x80
    [C66xx_0] Set interrupt to Core 1
    [C66xx_0] Interrupt Info 0x40
    [C66xx_1] Receive interrupt from Core 0 with info 0x40 interruptNumber= 0
    [C66xx_1] Receive interrupt from Core 0 with info 0x0 interruptNumber= 1
    [C66xx_0] Set interrupt to Core 1
    [C66xx_0] Interrupt Info 0x40
    [C66xx_1] Receive interrupt from Core 0 with info 0x40 interruptNumber= 2
    [C66xx_1] Receive interrupt from Core 0 with info 0x0 interruptNumber= 3
    [C66xx_1] Set interrupt to Core 0
    [C66xx_1] Interrupt Info 0x80
    [C66xx_0] Receive interrupt from Core 1 with info 0x80 interruptNumber= 0
    [C66xx_0] Set interrupt to Core 1
    [C66xx_0] Interrupt Info 0x40
    [C66xx_1] Receive interrupt from Core 0 with info 0x40 interruptNumber= 4
    [C66xx_1] Receive interrupt from Core 0 with info 0x0 interruptNumber= 5
    [C66xx_0] Set interrupt to Core 1
    [C66xx_0] Interrupt Info 0x40
    [C66xx_1] Set interrupt tReceive interrupt from Core 0 with info 0x40 interruptNumber= 6
    [C66xx_1] Receive interrupt from Core 0 with info 0x0 interruptNumber= 7
    [C66xx_1] o Core 0
    [C66xx_1] Interrupt Info 0x80
    [C66xx_0] Receive interrupt from Core 1 with info 0x80 interruptNumber= 1
    [C66xx_0] Set interrupt to Core 1
    [C66xx_0] Interrupt Info 0x40
    [C66xx_1] Receive interrupt from Core 0 with info 0x40 interruptNumber= 8
    [C66xx_1] Receive interrupt from Core 0 with info 0x0 interruptNumber= 9
    [C66xx_1] Set interrupt to Core 0
    [C66xx_1] Interrupt Info 0x80
    [C66xx_0] Receive interrupt from Core 1 with info 0x80 interruptNumber= 2
    [C66xx_0] Set interrupt to Core 1
    [C66xx_0] Interrupt Info 0x40
    [C66xx_1] Receive interrupt from Core 0 with info 0x40 interruptNumber= 10
    [C66xx_1] Receive interrupt from Core 0 with info 0x0 interruptNumber= 11

     

  • 请问core1收到两个中断的问题解决了么?

    有没有可能是中断没有及时清掉导致的,对照手册确认一下中断响应时序是否合理。

  • 前阵子忙其他事情去了

    core1收到两个中断的问题还没有解决,在做一些测试试图找出原因。

    在中端中查看了IPCAR1,赋值之前是16,赋值之后是0,已经清掉了啊。

     

    还有一个新问题,也不是新问题,之前就有的,只是没提出来。

    问题是在main.c文件中定义了一个全局变量,在IPC.C文件的中断服务函数IPC_ISR()中修改其值,调试时看到其修改过了,但离开IPC_ISR()后其值又恢复为原值,很纳闷?

  • 你好

    我的核1 IPC接收 现在只能进一次核0 发的中断 找不到问题啊???

    核0周期产生中断 核1响应 在中断服务也清IPC寄存器了 难道还要清核的中断 

    IPC的中断是直接挂接在中断6上

    gpCGEM_regs->INTMUX1 =CSL_GEM_IPC_LOCAL<<CSL_CGEM_INTMUX1_INTSEL6_SHIFT);

    看例程中断服务中不需要清中断啊???


    ipc的手册哪里有???