Skip to main content
OBaselga
Associate II
August 2, 2021
Question

RPMsg modify buffer size not working

  • August 2, 2021
  • 1 reply
  • 1008 views

Hi everyone,

I'm working with OpenAMP on CM4 and I would like to increase the buffer size of RPMsg messages. When sending with VIRT_UART_Transmit() from CM4 to CA7, gives me an error when the message exceeds 496 bytes due to the RPMSG_BUFFER_SIZE value in rpmsg_virtio.h, which is set to 512 bytes.

Aiming to reach 1024 bytes in size, when I set that value, RPMsg keeps giving the same error. Why?

This is my simple code:

void t0Task(void *argument)
{
 
 int i;
 
 int count = 0x0, simulated_channels = 64;
 
 const int SIZE_DATA = 7;
 
 unsigned char msg[SIZE_DATA * simulated_channels], msg2[SIZE_DATA];
 
 while (1)
 {
	 strcpy(msg,"");
	 for (i = 0; i < simulated_channels; i++) {
		 sprintf(msg2, "%06X ", count);
		 strcat(msg, msg2);
		 count = (count + 1) % 0xFFFFFF;
	 }
 
	 if(VIRT_UART_Transmit(&virtUART0, (uint8_t*)msg, strlen(msg)) == VIRT_UART_ERROR) {
		 VIRT_UART_Transmit(&virtUART0, "Error size\n", 20);
	 }
	 osDelay(1);
 }
}

Note that messages of less than 496 bytes are sent successfully.

Regards.

This topic has been closed for replies.

1 reply

Olivier GALLIEN
ST Technical Moderator
August 23, 2021

Hi @Óscar Baselga​ ,

Is this point still open your side ?

Else maybe this previous post can provide you few hints :

https://community.st.com/s/question/0D53W00000qwjyiSAA/increased-1024-rpmsg-buffer-size-will-fail-on-mailbox-vdev-declaration

First, you have to pay attention when you increase RPMSG_BUFFER_SIZE to not exceed the reserved memory budget, either by reducing buffer number or extend the reserved memory.

Let me know where you stand.

Olivier

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.