Hi,
Currently, I have the AM243x EVM (TMDS243GPEVM). I was performing some investigations and wanted to confirm a few things about IPC RP Message and if I understood it correctly.
1. Based on the documentation, I see that we can use IPC RP Message to send a message or receive a message with a specific timeout. If the timeout exceeds, the message is discarded. I am currently wondering if the following scenario is possible with IPC-
I need to send messages from two different IPC endpoints on R5 to one endpoint on M4. It cannot be a blocking call for the send messages, i.e., the timeout has to be "SystemP_NO_WAIT".
The time I send the messages from R5 may not necessarily correspond to the time "RPMessage_recv" is called on M4. Thus, is there a way to use IPC to send a message and keep that message queued up, so that M4 can read the message later on?
2. I was trying to use the RPMessage_RecvCallback functionality to trigger a callback automatically on M4 when R5 sends a message to it. However, the callback function does not get triggered. Can you please help me identify what am I doing wrong?
Here is a snippet of the code on Core R5:uint16_t gTaskOneEndPt = 11u;
RPMessage_Object gTaskOneMsgObject;
void ipc_rpmsg_task_one(void)
{
uint16_t msgSizeOne;
uint32_t buff_size = 300;
RPMessage_CreateParams createParams;
int32_t status;
RPMessage_CreateParams_init(&createParams);
createParams.localEndPt = gTaskOneEndPt;
status = RPMessage_construct(&gTaskOneMsgObject, &createParams);
DebugP_assert(status==SystemP_SUCCESS);
ClockP_usleep(500*1000);
DebugP_log("Message exchange started by Task 1!!!\r\n");
char msgBufOne[buff_size];
memset(msgBufOne, 'a', buff_size - 1);
msgBufOne[buff_size-1] = 0;
msgSizeOne = strlen(msgBufOne) + 1;
status = RPMessage_send(
msgBufOne, msgSizeOne,
CSL_CORE_ID_M4FSS0_0, gRecvOneEndPt,
RPMessage_getLocalEndPt(&gTaskOneMsgObject),
SystemP_WAIT_FOREVER);
DebugP_assert(status==SystemP_SUCCESS);
DebugP_log("Message sent by Task 1\r\n");
RPMessage_destruct(&gTaskOneMsgObject);
DebugP_log("All tests have passed for Task 1!!\r\n");
ClockP_sleep(5);
}
Here is a snippet of the code on Core M4:uint16_t gRecvOneEndPt = 13u;
static RPMessage_Object gRecvMsgObjectOne;
RPMessage_RecvCallback ipc_recv_callback(void)
{
DebugP_log("Callback reached\r\n");
}
void ipc_rpmsg_echo_remote_core_start()
{
int32_t status;
RPMessage_CreateParams createParams;
RPMessage_CreateParams_init(&createParams);
createParams.localEndPt = gRecvOneEndPt;
createParams.recvCallback = &ipc_recv_callback;
status = RPMessage_construct(&gRecvMsgObjectOne, &createParams);
DebugP_assert(status==SystemP_SUCCESS);
DebugP_log("M4 waiting for messages ...\r\n");
while (1)
{
DebugP_log("Waiting for a message\n");
ClockP_sleep(5);
break;
}
}
Any help is really appreciated.
Thank you,
Himel