static void PingPongTask (void* param)
{
int result;
struct remote_device *rdev = NULL;
struct rpmsg_channel *app_chnl = NULL;
THE_MESSAGE msg = {0};
int len;
/* Print the initial banner */
PRINTF("\r\nRPMSG PingPong FreeRTOS RTOS API Demo...\r\n");
PRINTF("RPMSG Init as Remote\r\n");
result = rpmsg_rtos_init(0 /*REMOTE_CPU_ID*/, &rdev, RPMSG_MASTER, &app_chnl);
assert(0 == result);
PRINTF("Name service handshake is done, M4 has setup a rpmsg channel [%d ---> %d]\r\n", app_chnl->src, app_chnl->dst);
while (true)
{
/* receive/send data to channel default ept */
result = rpmsg_rtos_recv(app_chnl->rp_ept, &msg, &len, sizeof(THE_MESSAGE), NULL, 0xFFFFFFFF);
assert(0 == result);
PRINTF("Get Data From Master Side : %d\r\n", msg.DATA);
msg.DATA++;
result = rpmsg_rtos_send(app_chnl->rp_ept, &msg, sizeof(THE_MESSAGE), app_chnl->dst);
assert(0 == result);
}
/* If destruction required */
/*
PRINTF("\r\nMessage pingpong finished\r\n");
rpmsg_rtos_deinit(rdev);
*/
}
as above ,When I run the pingpong example,the app_chnl->src is 0,and the app_chnl->dst is 1024,why is it ,I don't understand.
!Hi jingyang
RPMsg Master (Cortex-A9 Linux OS) and Remote (Cortex-M4 FreeRTOS
OS) perform a name service handshake to create the communication channel. The M4 channel address is
1, and the A9 channel address is 1024. Please refer to attached document for Demo details.
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------