Hi,
We are starting to use Rpmsg to communicate with a PRU. The Rpmsg messages have a size limit on 512 bytes. Would registering the file descriptor with poll() with flag POLLOUT be enough to guarantee that the entire Rpmsg interface all the way to the PRU is ready to receive? I.e. not require any ack messages from the PRU to tell the ARM that it is ready to receive more?
- Call poll() with POLLOUT for the PRU Rpmsg file descriptor in events.
- poll() returns with POLLOUT in revents for the file descriptor when it is ready to be written to.
- Call write() with one message of 512 bytes.
- Call poll() with POLLOUT for the file descriptor in events.
- poll() returns with POLLOUT in revents for the Rpmsg file descriptor when it is ready to be written to.
- Call write() with another message of less than 512 bytes.
It would simplify the code if we could use poll() instead of having to wait for an ack message from the PRU in the example above.
Another related question is what would happen if we were to do the sequence above with but try to write more than 512 bytes? Would the following work?
- Call poll() with POLLOUT for the PRU Rpmsg file descriptor in events.
- poll() returns with POLLOUT in revents for the file descriptor when it is ready to be written to.
- Call write() with one message of more than 512 bytes, for example 700 bytes.
- write() returns 512 and not a negative number to indicate it did transmit 512 bytes to the PRU.
- Call poll() with POLLOUT for the file descriptor in events.
- poll() returns with POLLOUT in revents for the Rpmsg file descriptor when it is ready to be written to.
- Call write() with the remainder of the data.
Best regards,
Jonathan