Some Porblems about RPMsg initialize

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Some Porblems about RPMsg initialize

870 Views
jingyangxie
Contributor V

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.

Labels (2)
0 Kudos
1 Reply

547 Views
igorpadykov
NXP Employee
NXP Employee

!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!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos