I´ve tried to change the code message_multicore found in C:\ti\ipc_1_24_03_32\packages\ti\sdo\ipc\examples\multicore\evm667x.
I ´ve changed the source core based in file "1031.05 KeyStone Intro to IPC".
i used 2 core (0 and 1)
in core 0 a create this struct
typedef struct DataMsg_int
{
MessageQ_MsgHeader header;
int *data_0;
} dataMsg_int;
dataMsg_int *DataMsg_int;
and use this code to connect to core 1 in my task func
System_printf("C core 1 \n\n");
do {
status = MessageQ_open("CORE0", &remoteQueueId);
if (status < 0)
{
Task_sleep(1);
}
} while (status < 0);
//*********************************************************************************************************
msg = MessageQ_alloc(HEAPID, sizeof(MessageQ_MsgHeader));
if (msg == NULL)
{
System_abort("MessageQ_alloc failed\n" );
}
//*********************************************************************************************************
status = MessageQ_put(remoteQueueId, msg);
if (status < 0)
{
System_abort("MessageQ_put had a failure/error\n");
DataMsg_int = (dataMsg_int*)MessageQ_alloc(HEAPID,sizeof(dataMsg_int));
DataMsg_int->data_0 = (int*) HeapBufMP_alloc(heapHandle, vezes*sizeof(int), 128);
if (DataMsg_int->data_0 == NULL)
System_abort("erro");
DataMsg_int->data_0 = &vetor[4]; // veto[4] = 40; so i want to read 40 in core 1
Cache_wbInv(DataMsg_int->data_0,sizeof(int),Cache_Type_ALL, 128);
status = MessageQ_put(remoteQueueId,(MessageQ_Msg)DataMsg_int);
if (status < 0)
{
System_abort("Falhou a transmissão da dados para core 1 \n");
}
MessageQ_close(&remoteQueueId);
while(1);
core 1
typedef struct DataMsg_read_int
{
MessageQ_MsgHeader header;
int *data_read_0;
} dataMsg_read_int;
dataMsg_read_int *DataMsg_read_int;
//****************************************************************************************************************
typedef struct DataMsg_int
{
MessageQ_MsgHeader header;
int *data_0;
} dataMsg_int;
dataMsg_int *DataMsg_int;
messageQ = MessageQ_create("CORE0", NULL);
if (messageQ == NULL)
{
System_abort("MessageQ_create failed\n" );
}
//*********************************************************************************************************
status = MessageQ_get(messageQ, &msg, MessageQ_FOREVER);
if (status < 0)
{
System_abort("This should not happen since timeout is forever\n");
}
MessageQ_free(msg);
DataMsg_int = (dataMsg_int*)MessageQ_alloc(HEAPID,sizeof(dataMsg_int));
MessageQ_get(messageQ, (MessageQ_Msg*)&DataMsg_read_int, MessageQ_FOREVER);
Cache_inv(DataMsg_read_int->data_read_0,sizeof(int),Cache_Type_ALL, 128);
here my problem
the address to my data_0 and data_read_o are the same but de value in core 0 is 40 and core 1 to may data_read_0 = 0.
any suggestion? any mistake that I made?
Nivaldo