How to change the size of RPMSG buffer using Windows CE?

Hello,

We are using iMX7D running WEC7, and we have connected an ADC through SPI. The ADC driver implementation was done on M4, using FreeRTOS, its max rate is 105ksamples/s and it is working properly.

We have successfuly tested RPMSG protocol (Rpmsg_Demo / Pingpong_freertos) but when we wanted to make modifications to read our ADC generated data, we found 512bytes buffer limitation in RPMSG protocol.
Buffer size must be increased because of the datarate, to avoid wince overhead in a lot of small readings. But we don’t know how to modify it at WEC7 side. We have found this: FreeRTOS on the Cortex-M4 of a Colibri iMX7 | Toradex Developer Center but it is for Linux.

  • How could we modify RPMSG buffer to 8192 bytes in WEC7?

Thanks in advance!

Dear @apanelli

The buffer size is hard coded in the WinCe RpMsg library.

I modified the constant from 512 to 8192 and rebuilt the library for you (see download link below). But I didn’t have a setup to test the modification.
This modification affects the RpMsg library for Colibri iMX7 only.

I assume you are aware that you need to change the M4 code also to adjust the buffer size.

Any feedback whether the modification was sufficient to use the increased buffer size is very welcome. If it is sufficient, we can think of making this parameter configurable in our library.

Regards, Andy

Hi Andy,

Thanks for your help. I have done several tests and it seems to work correctly as spected.
To make it work I’ve only changed:

middleware/multicore/open-amp/rpmsg/rpmsg_core.h

#define RPMSG_BUFFER_SIZE                       8192	//512 -> Original value

After verifying the new buffer size, I could do more tests using it with real ADC measures, and I realized that I will need a bigger buffer, 16K or 32K maybe, but don’t know the type of memory used on RPMSG neither other limitations.
What do you think? Is it possible to use 32KB buffer size? (and maybe a little more?)
It would be great if the buffer size could be defined as parameter in the library.
Thanks again!

Best regards,
Alejandro