RPMSG on a Toradex Apalis iMX8qm

Dear Toradex Community,

I am building an application on Apalis iMX8qm for M4 communication I2C to A core linux. I am testing the demo rpms_lite_pingpong_rtos_linux_remote_m41 to the communication link between two MCU platform. However, I cannot get the imx_rpmsg_pingpong device in /dev.

The following is the details of my testing platform

  • Hardware: Apalis iMX8 QuadMax 4GB Wi-Fi / Bluetooth IT
  • Carrier board: Ixora v1.2
  • Linux apalis-imx8-07278385 5.4.193-5.7.2+git.b60d3160fd04 (remote download from Toradex Embedded Linux Reference Multimedia Image by Easy Installer)

This is the source of my dtbo file:

/dts-v1/;
/plugin/;

/* Disable PWM0 and PMW1 to use M4 Core 1 UART */

/ {

	compatible = "toradex,apalis-imx8-v1.1-eval",
		     "toradex,apalis-imx8-eval",
		     "toradex,apalis-imx8",
		     "fsl,imx8qm";
};

&pwm0 {
    status = "disabled";
};

&pwm1 {
    status = "disabled";
};	
  
&lpuart2 {
    status = "disabled";
};

&rpmsg1{
	status = "okay";
};

I checked the booting message when the system bootup. Some problem is happening in memory map. The error message has been shown as follows:

[    3.206548] imx-rpmsg 90100000.rpmsg1: assigned reserved memory node vdevbuffer
[    3.213977] ------------[ cut here ]------------
[    3.218611] WARNING: CPU: 4 PID: 99 at arch/arm64/mm/ioremap.c:47 __ioremap_caller+0xbc/0xe0
[    3.227050] Modules linked in:
[    3.230110] CPU: 4 PID: 99 Comm: kworker/4:1 Not tainted 5.4.193-5.7.2+git.b60d3160fd04 #1
[    3.238379] Hardware name: Toradex Apalis iMX8QM V1.1 on Apalis Evaluation Board (DT)
[    3.246223] Workqueue: events deferred_probe_work_func
[    3.251369] pstate: 80000005 (Nzcv daif -PAN -UAO)
[    3.256160] pc : __ioremap_caller+0xbc/0xe0
[    3.260349] lr : __ioremap_caller+0x50/0xe0
[    3.264532] sp : ffff800011d5b740
[    3.267842] x29: ffff800011d5b740 x28: ffff0008785c1400 
[    3.273159] x27: 0000000000000000 x26: ffff000874304880 
[    3.278476] x25: 0000000000000000 x24: ffff0008741fe730 
[    3.283793] x23: 0068000000000707 x22: ffff800010bdd070 
[    3.289110] x21: 0000000000000000 x20: 0000000090100000 
[    3.294426] x19: 0000000000003000 x18: 0000000000000000 
[    3.299743] x17: 000000000e010cbc x16: 000000000e011cbc 
[    3.305060] x15: ffff0008781d59f0 x14: ffffffffffffffff 
[    3.310368] x13: ffff0008742ff91c x12: 0000000000000030 
[    3.315685] x11: 0101010101010101 x10: 7f7f7f7f7f7f7f7f 
[    3.321001] x9 : 0000000000000000 x8 : 0000000000200000 
[    3.326318] x7 : 0000000000000018 x6 : ffff800011949748 
[    3.331635] x5 : ffff800011949718 x4 : 0000000000000003 
[    3.336951] x3 : 0000000000000003 x2 : 0000000090200000 
[    3.342268] x1 : 0000000000000002 x0 : 0000000000000001 
[    3.347590] Call trace:
[    3.350039]  __ioremap_caller+0xbc/0xe0
[    3.353879]  __ioremap+0x14/0x20
[    3.357116]  imx_rpmsg_find_vqs+0xd8/0x2a8
[    3.361209]  rpmsg_probe+0xdc/0x370
[    3.364704]  virtio_dev_probe+0x19c/0x238
[    3.368715]  really_probe+0xd8/0x438
[    3.372285]  driver_probe_device+0xdc/0x130
[    3.376472]  __device_attach_driver+0x88/0x108
[    3.380920]  bus_for_each_drv+0x74/0xc8
[    3.384760]  __device_attach+0xec/0x170
[    3.388592]  device_initial_probe+0x10/0x18
[    3.392779]  bus_probe_device+0x90/0x98
[    3.396618]  device_add+0x3a4/0x688
[    3.400104]  register_virtio_device+0xb4/0x110
[    3.404551]  imx_rpmsg_probe+0x230/0x520
[    3.408479]  platform_drv_probe+0x50/0xa0
[    3.412491]  really_probe+0xd8/0x438
[    3.416061]  driver_probe_device+0xdc/0x130
[    3.420249]  __device_attach_driver+0x88/0x108
[    3.423544] usb 3-1: new high-speed USB device number 2 using ci_hdrc
[    3.424696]  bus_for_each_drv+0x74/0xc8
[    3.424704]  __device_attach+0xec/0x170
[    3.438823]  device_initial_probe+0x10/0x18
[    3.443001]  bus_probe_device+0x90/0x98
[    3.446832]  deferred_probe_work_func+0x80/0xd0
[    3.451360]  process_one_work+0x1b4/0x328
[    3.455372]  worker_thread+0x1f0/0x420
[    3.459116]  kthread+0x138/0x158
[    3.462341]  ret_from_fork+0x10/0x1c
[    3.465918] ---[ end trace 539575572e3d4fc2 ]---
[    3.470573] virtio_rpmsg_bus: probe of virtio0 failed with error -12

I found a similar problem was happened in iMX8MP platform and I have checked this link

but I cannot success in my iMX8qm board yet.

May I ask anyone can help if anyone success running rpmsg on iMX8qm platform and can teach me know to do it?

Thanks a lot.

Best regards,

Tak

Hi @tak,

For Apalis iMX8 Downstream kernel version 5.4, you need to use the following code in your overlay:

Also, you can find the compiled DTBO file in this comment:

The file will be available for 3 months.

This thread should help you set everything up. Please, let me know here if you have any questions about it.

Best Regards,
Hiago.

Dear Juli,

Thank you very much for your help. Here is my update. I found that the binary (Toradex Embedded Linux Reference Multimedia Image 5.7.2+build.21) which is downloaded from Easy Installer (cloud) calls imx8qm-apalis-v1.1-eval.dtb as the device tree blob. Then I tried to reverse it by dtc and I found a little bit strange thing. In the reserved-memory section, I found the reg called 0x90200000 instead of 0x90000000 for rpmsg@0x0x90000000 section. I guess it may be the problem of memory crash.

reserved-memory {
	#address-cells = <0x02>;
	#size-cells = <0x02>;
	ranges;
            :
            :
	rpmsg@0x90000000 {
		no-map;
		reg = <0x00 0x90200000 0x00 0x200000>;
		phandle = <0x247>;
	};
            :
            :

When I changed the reg to 0x90000000, the pingpong looks like to work.

	rpmsg@0x90000000 {
		no-map;
		reg = <0x00 0x90000000 0x00 0x200000>;
		phandle = <0x247>;
	};

I will also try your dtbo as well. Thanks a lot for your help.

By the way, may I ask one more question? When I use 6.2.0+build from the cloud, I found that if I add the disable code in overlay file as below. The linux prompted device tree flatten error and cannot be booted up. However, the same dtbo works find in 5.7.22+build. May I ask whether you have any idea about this?

&pwm0 {
status = “disabled”;
};

&pwm1 {
status = “disabled”;
};

Many thanks again for your help.

Best regards,

Tak

Hello @tak ,

For this question I would ask you to open another topic, so we have 1 topic → 1 question. Thanks :slight_smile:

P.S. If the original question in this topic is solved, please mark the suitable answer as solution.

Best regards,
Josep