i.MX8MP : RPMSG increase Vring Buffer Size to run M7 binary

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.MX8MP : RPMSG increase Vring Buffer Size to run M7 binary

2,505 Views
shivani__p
Contributor II

Hello,

We are running M7 custom binary in which we have integrated rpmsg multi-end point driver from this link. When we run the binary at address 0x80000000 from uboot using below command then,

  • fatload mmc 2:1 ${loadaddr} M7_firmware.bin;cp.b ${loadaddr} 0x80000000 ${filesize}; bootaux 0x80000000; boot

After some time we are facing the the below error.

[ 182.602982] imx-rproc imx8mp-cm7: imx_rproc_kick: failed (1, err:-62)
[ 182.662979] imx-rproc imx8mp-cm7: imx_rproc_kick: failed (1, err:-62)
[ 197.855286] rpmsg_multiept virtio0.iotgw-rpmsg-openamp-channel.-1.1: timeout waiting for a tx buffer

As it seems to rx/tx buffer size issue we have tried to increase the size of vring0 & vring1 from 0x8000 to 0x80000 in device tree as shown:

rpmsg_1.png

rpmsg_2.png

After increasing these buffer sizes, we are not able to see the multi-end point created on linux kernel in /dev/ as shown below.

rpmsg_3.png

Can you please help with the errors we are facing as mentioned above?

 

Thanks,

Shivani Patel

0 Kudos
5 Replies

2,500 Views
kef2
Senior Contributor IV

Vring size is hardcoded in imx-rpmsg driver, RTOS settings have to follow these settings, else comms won't work.

Instead of looking for more buffers, first try sending in one transfer as mach as you can fit in default max single transfer size, which is 496 bytes. Sending just few bytes at a time drains available buffers very quickly.

1,988 Views
aditya_yantra
Contributor II

Hi @kef2 

I am having the same issue with RPMSG on Toradex make Verdin iMX8M-Plus.

While running the Cortex-M7 binary, I am getting this error: imx-rproc imx8mp-cm7: imx_rproc_kick: failed (1, err:-62)
Timing of this error is very random, so I am unable to debug this error.

I don't know the cause of this error.

Can you please explain the reason of this error in detail and share the solution?

Thanks,

Aditya

0 Kudos

2,420 Views
shivani__p
Contributor II

Hi @kef2 ,

Thanks for your response.

We have tried with 1 MB vring buffer size as below.

ss1.png

1 MB buffer size is working. But when we tried to increase to 2MB or 4MB then rpmsg driver which is "drivers/rpmsg/virtio_rpmsg_bus.c" is not able to allocate memory. See the below image.

ss2.png

 

Regards,

Shivani

0 Kudos

2,413 Views
kef2
Senior Contributor IV

As I wrote previously

  • Vring size is hardcoded in imx-rpmsg driver

Your mods in DT don't increase buffer size any how.

See imx_rpmsg.c\rpmsg\drivers - linux-imx - i.MX Linux kernel (codeaurora.org) or older driver versions, it's just 512 buffers of 512 bytes, which is 0x8000 bytes for host to remote direction, and 0x8000 bytes for remote to host direction. See 

			rpdev->ivdev[i]->vring[0] = start;
			rpdev->ivdev[i]->vring[1] = start + 0x8000;

If you mod driver, you need to mod CM side FW as well. 

 

 

0 Kudos

2,396 Views
shivani__p
Contributor II

Okay, thanks for the inputs @kef2 .

Regards,

Shivani

0 Kudos