Other Parts Discussed in Thread: C2000WARE
Hello,
I am trying to set up communications between CPU1 and CPU2 with the IPC. For that, I set up a test variable called Message1 in CPU1 and Message2 in CPU2, which is incremented at a 50kHz rate.
Message1++; IpcRegs.IPCSENDCOM = Message1; IpcRegs.IPCSET.bit.IPC1 = 1;
The above code is inside an ePWM ISR in CPU1 that executes at 50kHz. There is an equivalent piece of code in another ISR in CPU2 that executes at a similar rate. But the CPU2's IPC code sends the data to IPCSENDDATA instead of IPCSENDCOM.
Message2++; IpcRegs.IPCSENDDATA = Message2; IpcRegs.IPCSET.bit.IPC0 = 1;
In the IPC0 ISR, I have wrote the following (for the CPU1 portion):
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1; IpcRegs.IPCACK.bit.IPC0 = 1; TestIpc1 = IpcRegs.IPCRECVDATA;
TestIPC1 is a storage variable for the data that was sent over from CPU2 to CPU1. I also wrote this code in CPU2 for IPC1 ISR
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1; IpcRegs.IPCACK.bit.IPC1 = 1; TestIpc2 = IpcRegs.IPCRECVCOM;
The good thing is that the communication from CPU2 to CPU1 works and I can see that TestIpc1 receiving the value of Message2 that was sent over. However, CPU1 to CPU2 doesn't seem to work as TestIpc2 is not changing at all, even though Message1 increments properly.
I wanted to check if IpcRegs.IPCRECVCOM was not changing so I checked it, and surprisingly it was changing. I think this means that the communication itself from CPU1 to CPU2 was working properly.
I also checked if CPU2 was ever arriving to the IPC ISR, and it does arrive to the ISR and it executes everything. But I could notice that the value of IpcRegs.IPCRECVCOM was not getting passed to TestIpc2 even when I clearly stepped through that line.
Long story short, I cannot get CPU2 to pass value from IpcRegs.IPCRECVCOM to another variable (or IPCRECVDATA or IPCRECVADDR for that matter). Do you recognize this bug?
Thank you,