nxp-mcuxpresso / rpmsg-lite

RPMsg implementation for small MCUs
BSD 3-Clause "New" or "Revised" License
235 stars 74 forks source link

[QUESTION] Does rpmsg_lite_send require carriage returns? #47

Closed luces280 closed 9 months ago

luces280 commented 9 months ago

In using rpmsg_lite_send(), I noticed that if I did not include a carriage return ("/r/n") at the end of my Tx data that it would not work. Does this sound accurate with the implementation? If so why must it require a carriage return?

MichalPrincNXP commented 9 months ago

Hi @luces280 , rpmsg_lite_send() does not required carriage return at the end of the TX data. What is required to pass it the pointer to the data (as char*) and the amount of bytes to be transferred (size in bytes). Once you face the issue as you describe this seems to be like incorrect use of the the rpmsg_lite_send() function.

Example of usage:

typedef struct the_message
{
    uint32_t DATA;
} THE_MESSAGE, *THE_MESSAGE_PTR;
static THE_MESSAGE volatile msg = {0};
...
(void)rpmsg_lite_send(my_rpmsg, my_ept, REMOTE_EPT_ADDR, (char *)&msg, sizeof(THE_MESSAGE), RL_DONT_BLOCK);

Hope it helps. Regards Michal

luces280 commented 9 months ago

Hi yes thank you for the clarification.

For reference, I had this bit of code which did NOT result in a successfully sent message: image

And this bit did: image

However, just knowing that it isn't a requirement of rpmsge_lite_send is helpful and will help me narrow down the issue. I'm guessing the issue is on the Linux side of my application. Thank you!