2021-08-02 05:20 AM
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.
2021-08-23 06:15 AM
Hi @Óscar Baselga ,
Is this point still open your side ?
Else maybe this previous post can provide you few hints :
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