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.

TMS320F28379D: Dual Core IPC Communications

Part Number: TMS320F28379D
Other Parts Discussed in Thread: CONTROLSUITE

Hello,

I am trying to send some data/commands from CPU Core1 to CPU Core2. I am not planning to use IPC Drivers & IPC Drivers Utilities provided by TI. But I am not able to make it work. Here is some description of the scheme that I want to use.

1.) Create variables in CPU2TOCPU1RAM.

2.) Copy address of those respective variables to  IpcRegs.IPCSENDADDR.

3.) Set the flag. IpcRegs.IPCSET.bit.IPC11 = 1;

4.) On CPU Core2, once FLAG11 is detected as SET, receive the address by reading IpcRegs.IPCRECVADDR.

5.) Read the value of the variables by reading the value at the address received.

But this scheme is somehow not working. Here are the code snippets from the project for both CPU 1 and CPU 2.

CPU 1 - Send Address of variables to be shared with CPU 2.


 

//
// Defines
//
#define CPU01_TO_CPU02_PASSMSG  0x0003FFF4     // CPU01 TO CPU02 MSG RAM. Offsets for passing addresses
#define CPU02_TO_CPU01_PASSMSG  0x0003FBF4     // CPU02 TO CPU01 MSG RAM. Offsets for passing addresses

unsigned long TempNumber[3];
unsigned long Commands[3];
long double   GenericParameters[3];

#pragma DATA_SECTION(TempNumber,"CPU1TOCPU2RAM");
#pragma DATA_SECTION(Commands,"CPU1TOCPU2RAM");
#pragma DATA_SECTION(GenericParameters,"CPU1TOCPU2RAM");

void DCL_Ipc_SendPrimaryAddress (void)
{
     unsigned long *PMsgRam;
     unsigned long EventFlag;

     EventFlag = IPC_FLAG11;

     TempNumber[0] = 6969;
     TempNumber[1] = 5555;
     TempNumber[2] = 1111;

     PMsgRam = (void *)CPU01_TO_CPU02_PASSMSG;
     PMsgRam[0] = (GBL_Types_UInt32)&TempNumber;
     PMsgRam[1] = (GBL_Types_UInt32)&Commands;
     PMsgRam[2] = (GBL_Types_UInt32)&GenericParameters;

     IpcRegs.IPCSENDADDR = PMsgRam[0];

     IpcRegs.IPCSET.bit.IPC11 = 1;      // Set IPC11 to inform CPU1 to read address.
}

CPU 2 - Receive Address of variables to be read from CPU 1.


unsigned long *Address;
unsigned long *ReceiveAddress;

if (IpcRegs.IPCSTS.IPC11 == 1)
{
    *ReceiveAddress = IpcRegs.IPCRECVADDR;
    IpcRegs.IPCACK.IPC11 = 1;
    Address = *ReceiveAddress;
}

printf ("Value at Address 0: %ld", Address[0]);
printf ("Value at Address 1: %ld", Address[1]);
printf ("Value at Address 2: %ld", Address[2]);

Please share some thoughts highlighting what could be wrong and what shall be modified to fix the issue. The logic of setting and acknowledging flag works just fine but not the address passing logic.

Also, one last question is about sharing address of a double variable. Is it possible? Can I just send an address of double variable and type cast it to double on the receiving CPU? Will that work?

I really appreciate your time and effort.

Thanks,

Archit