UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

OPEN-AMP ECHO TEST ON MPSOC - R5 SIDE

Reply
Highlighted
Observer jrp
Observer
Posts: 22
Registered: ‎01-24-2018

OPEN-AMP ECHO TEST ON MPSOC - R5 SIDE

 

// from the senders code

struct _payload {
    unsigned long num;
    unsigned long size;
    unsigned char data[];
};

 

/*-----------------------------------------------------------------------------*
 *  RPMSG callbacks setup by remoteproc_resource_init()
 *-----------------------------------------------------------------------------*/
static void rpmsg_read_cb(struct rpmsg_channel *rp_chnl, void *data, int len,  void *priv, unsigned long src)
{
    (void)priv;
    (void)src;

    // On reception of a shutdown we signal the application to terminate
    if ((*(unsigned int *)data) == SHUTDOWN_MSG)
    {
        evt_chnl_deleted = 1;
        return;
    }

    struct _payload *r_payload = (struct _payload *)data;

    LPRINTF("rpmsg_read_msg() - PayLoad Number = %lu\n", r_payload->num);
    LPRINTF("rpmsg_read_msg() - PayLoad Size   = %lu\n", r_payload->size);
    LPRINTF("rpmsg_read_msg() - PayLoad Len    = %lu\n", len);


    // Send data back to master
    if (rpmsg_send(rp_chnl, data, len) < 0)
    {
        LPERROR("rpmsg_send failed\n");
    }
    LPRINTF("\n");
}

 

rpmsg_read_msg() - PayLoad Number = 1
rpmsg_read_msg() - PayLoad Size   = 0
rpmsg_read_msg() - PayLoad Len    = 18

 

Why is the payload size value not making it over to here?

 

Moderator
Posts: 72
Registered: ‎05-10-2017

Re: OPEN-AMP ECHO TEST ON MPSOC - R5 SIDE

Which tag version are you using? Can you post the github link here?

 

After the RPMSG channel is created and the application runs, it prints the payload number, and payload size. Are you seeing this when you run the application?

LPRINTF("sending payload number %lu of size %d\n",i_payload->num, (2 * sizeof(unsigned long)) + size);

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------