I tried to transplant an example described in sprab20 from EVM 6474 to EVM 6472 and I also made some modifications.C code as follow:
#include <std.h>
#include <log.h>
#include <c6x.h>
#include "ipccfg.h"
#include "c64.h"
#include "cslr_intgen.h"
#include <stdio.h>
CSL_IntgenRegs *ipcRegsPtr = (CSL_IntgenRegs*)(0x02880800);
void sendIPCmessage(unsigned long msg);
main()
{
LOG_printf(&trace, "starting main on core %d\n",DNUM);
C64_enableIER(1<<4);
}
unsigned long received_message;
unsigned long message = 268435454;
void IPCisr(void)
{
SEM_post(&SEM0);
received_message = (ipcRegsPtr->IPCGR1 >> 4) & 0xFFFFFFF;
ipcRegsPtr->IPCAR1 = 0xFFFFFFFF;
}
void sendIPCmessagePRD(){
switch(DNUM){
case 0:
LOG_printf(&trace, "sending IPC on core %d",DNUM);
sendIPCmessage(message);
break;
case 1:
LOG_printf(&trace, "receiving IPC from core %d",0);
break;
};
message++;
}
void sendIPCmessage(unsigned long msg)
{
ipcRegsPtr->IPCGR1 = (msg & 0xFFFFFFF) << 4;
ipcRegsPtr->IPCGR1 |=1;
}
void receiveIPCTask0()
{
while(1){
SEM_pend(&SEM0,SYS_FOREVER);
LOG_printf(&trace,"got message %d from core 0", received_message);
};
}
And I use the DSP/BIOS,the configuration as follow:
HWI_INT4 is the object that corresponds to the inter-core interrupt, with the interrupt selection number 84.the corresponding software function is IPCisr,;
PRDipcsend is a periodic function that is responsible for sending messages.The corresponding software function is sendIPCmessagePRD;
TSK0 is processing messages from cores 0. The corresponding software function is receiveIPCTask0 which run forever and pend on SEM0.
But when I run this same program in core0 and core1 simultaneously on EVM6472 via CCS4.0 ,it seems that the program on core1 can't get into the function IPCisr,and what I got from the Log window of Core1 are always "receiving IPC from core 0",which means I can't get the message "got message %d from core 0".
Is there something wrong with this program?Someone please help me.Hoping for the reply.