Hello @vix,
I reviewed this ticket and the documentation / code, and it seems the 256 byte message limit on the linux side is arbitrary.
However, I’m coming to the realization that the imx-rpmsg-tty driver was developed by NXP with one goal: have the easy-to-use string echo demo running. It’s nice to be able to open a tty device and write strings directly from user space for demo purposes, but we need to consider that the tty subsystem adds a lot of overhead.
We also need to consider that this driver was never upstreamed, and it looks like there are no efforts to do so. We could change the buffer size on our fork, but now we diverged from NXP on the downstream. Furthermore, we have to carry this patch along in the future, and we actively work towards reducing the number of patches we have applied on the downstream to reduce our maintenance burden. Even if there are no bad side effects today, we cannot guarantee this in the future. NXP is free to change their downstream however they want, and if they do, some of these changes could break the functionality in subtle ways.
Consider a simple made-up example:
We change the buffer size on our fork and test everything. All good. Now NXP changes the implementation of the imx-rpmsg-tty
driver, and they decide to make a copy of the data using the number 256 as a size, instead of using the #define. They test the changes on their side and everything works without issues. The code comes to us, and maybe we do some quick test using the demo functionality in user space (with strings smaller than 256 bytes) and we also see no problem. You get the new version and now your application is broken, but for everyone else it’s working. This is a recipe for a lot of wasted time trying to debug the issue.
I know this example seems silly, but it could happen exactly like I described, and there could be other similarly “inoffensive” changes that could go unnoticed and break stuff. Of course, these can happen even if we don’t have the patch on our fork, but by having it we have one more chance of bad stuff happening.
With all that said, have you considered using a more standard (and upstream) driver like rpmsg-char
on your application? From what I saw, with rpmsg-char
you wouldn’t have any limitation on the buffer size (apart from the rpmsg-bus
limitation of 512 bytes) and you also wouldn’t have the tty overhead. You could send messages in binary form between the two cores, or you could also choose to send text strings if you like.
Please let me know what you think, and I’m also open to discussing the issue more.
Rafael