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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

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

3,271 次查看
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 项奖励
回复
5 回复数

3,266 次查看
kef2
Senior Contributor V

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.

2,754 次查看
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 项奖励
回复

3,186 次查看
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 项奖励
回复

3,179 次查看
kef2
Senior Contributor V

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 项奖励
回复

3,162 次查看
shivani__p
Contributor II

Okay, thanks for the inputs @kef2 .

Regards,

Shivani

0 项奖励
回复