imx8mq: Android11 load M4 crashed

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

imx8mq: Android11 load M4 crashed

3,692 Views
edward_fu
Contributor III

Hi experts,

I am using imx8mq board to develop rpmsg in my project. I am running Android 11.0.0_2.0.0. I flashed the M4 image along with Android images with "uuu_imx_android_flash.sh" script. And in uboot I set bootcmd as below:

  • setenv bootcmd "bootmcu && boota mmc0"

At first, M4 run normally as expected, But after few seconds, M4 program crashed and Android run normally.

What's the problem maybe?

Thanks

Edward

 

0 Kudos
23 Replies

2,796 Views
penny_lin
Contributor III

Hi Sirs:

   I follow this community to enable RPMSG function on Android 11_2.2.0 BSP,

but there are booting issue, the dispaly is not enter Adroid UI, it only show "Android animation" logo on  the HDMI

. Do you have the same issue ?  If yes, Could you let me know how to solved it? Thank a lot.

0 Kudos

2,784 Views
edward_fu
Contributor III

Hi penny,

No, I haven't this problem. I propose you double checking the dts again if any hardware resource has conflict.

0 Kudos

2,727 Views
penny_lin
Contributor III

Thank your help. the issue solved.

0 Kudos

2,709 Views
edward_fu
Contributor III

Great job.

Have you used rpmsg communication between A53 and M4?

0 Kudos

2,712 Views
penny_lin
Contributor III

Yes, remove m4_reserved node , the issue solved. ^^

 --- a/arch/arm64/boot/dts/freescale/imx8mq-evk-rpmsg.dts
+++ b/arch/arm64/boot/dts/freescale/imx8mq-evk-rpmsg.dts
@@ -11,28 +11,19 @@
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;

- m4_reserved: m4@0x80000000 {
- no-map;
- reg = <0 0x80000000 0 0x1000000>;
- };
+ //m4_reserved: m4@0x80000000 {
+ // no-map;
+ // reg = <0 0x80000000 0 0x1000000>;
+ //};

0 Kudos

2,723 Views
edward_fu
Contributor III

You are welcome. Is it a dts issue caused the problem?

0 Kudos

3,444 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Can you share your logs?

0 Kudos

3,431 Views
edward_fu
Contributor III

Thanks, it solved by using UART4 not UART2.

But till one problem happened, I run the rpmsg_lite_str_echo_rtos demo. Rpmsg channel has been created in Android(/dev/ttyRPMSG30 exists), and A53 sent "hello world!" to M4 successfully, but M4 cannot receive anything.

Log in Android:


[ 0.000000] OF: reserved mem: initialized node rpmsg_dma@0xb8400000, compatible id shared-dma-pool
[ 0.313304] imx rpmsg driver is registered.
[ 2.441396] imx_rpmsg_probe
[ 2.444346] imx-rpmsg b8000000.rpmsg: assigned reserved memory node rpmsg_dma@0xb8400000
[ 2.452982] virtio_rpmsg_bus virtio0: rpmsg host is online
[ 2.453012] virtio_rpmsg_bus virtio0: creating channel rpmsg-virtual-tty-channel-1 addr 0x1e
[ 6.406768] rpmsg_tty_probe
[ 6.409589] imx_rpmsg_tty virtio0.rpmsg-virtual-tty-channel-1.-1.30: new channel: 0x400 -> 0x1e!
[ 6.418781] Install rpmsg tty driver!
[ 6.422542] rpmsg_send hello world! success.

And log in M4:

RPMSG String Echo FreeRTOS RTOS API Demo...

Nameservice sent, ready for incoming messages...

I'd like to know why M4 cannot receive A53 message even rpmsg channel created between A53 and M4?

3,422 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

I tested on Linux before, there is no issue. I will test on Android asap!

0 Kudos

3,416 Views
edward_fu
Contributor III

Thanks.

I also tested it on linux and it worked well. But it doesnot work on Android. 

0 Kudos

3,409 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

I have tested our mcu demo image on Android.M core can accept audio from DirectAudioPlayer.

####################  LOW POWER AUDIO TASK ####################

    Build Time: Jul 30 2021--08:48:03
********************************
 Wait the Linux kernel boot up to create the link between M core and A core.

********************************
The rpmsg channel between M core and A core created!
********************************


Task A is working now.

No audio playback, M core enters STOP mode!

Playback is running, M core enters RUN mode!

 

0 Kudos

3,337 Views
edward_fu
Contributor III

Do you have any updates?

Why do you always respond me a little not finish the question?

0 Kudos

3,319 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Can you share your changes in Android source code? The Android11_2.0.0 demo images can't support M4 

0 Kudos

3,314 Views
edward_fu
Contributor III

Firstly, I modified serveral files as below:

1. add below contents in imx8m/evk_8mq/SharedBoardConfig.mk

BOARD_VENDOR_KERNEL_MODULES += \
    $(KERNEL_OUT)/drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_i2c.ko \
    $(KERNEL_OUT)/drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_i2c.ko

2. add below contents in imx8m/evk_8mq/BoardConfig.mk

TARGET_BOARD_DTS_CONFIG += imx8mq-rpmsg:imx8mq-evk-rpmsg.dtbq

3. modify arch/arm64/boot/dts/freescale/imx8mq-evk-rpmsg.dtsvdev-nums = <1>;
reg = <0x0 0xb8000000 0x0 0x10000>;
- memory-region = <&vdevbuffer>;
- status = "disabled";
+ memory-region = <&rpmsg_dma_reserved>;
+ status = "okay";

Secondly, compiple the image and flash to your board use below command in ubuntu

./uuu_imx_android_flash.sh -f imx8mq -e -m

remember to name the dtbo-imx8mq-rpmsg.img to dtbo-imx8mq-rpmsg.img

and the m4 bin named as imx8mq_mcu_demo.img when flash image to your board

Thirdly, enter uboot and modify bootcmd as:

setenv bootcmd "bootmcu && boota mmc0"

 

0 Kudos

3,296 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Can you share your imx8mq-evk-rpmsg.dts?

I found that my dts file is different from your dts

0 Kudos

3,403 Views
edward_fu
Contributor III

Thanks for your quick reply.

I'd like to know which board did you use. And could you share you dts and which android version or linux kernel version did you use?

Could you test the rpmsg_lite_str_echo_rtos demo?

0 Kudos

3,286 Views
edward_fu
Contributor III

Sure, it is like below which I reference https://www.spinics.net/lists/arm-kernel/msg739501.html :

// SPDX-License-Identifier: (GPL-2.0 OR MIT)
/*
* Copyright 2019 NXP
*/

/dts-v1/;

#include "imx8mq-evk.dts"

/ {
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;

m4_reserved: m4@0x80000000 {
no-map;
reg = <0 0x80000000 0 0x1000000>;
};

rpmsg_reserved: rpmsg@0xb8000000 {
no-map;
reg = <0 0xb8000000 0 0x400000>;
};

rpmsg_dma_reserved:rpmsg_dma@0xb8400000 {
compatible = "shared-dma-pool";
no-map;
reg = <0 0xb8400000 0 0x100000>;
};
};
};

/*
* Regarding to the HW conflications, the following module should be disabled
* when M4 is running on evk board.
* gpt1, i2c2, pwm4, tmu, uart2
*/

&i2c2 {
status = "disabled";
};

&pwm4 {
status = "disabled";
};

&rpmsg{
/*
* 64K for one rpmsg instance:
* --0xb8000000~0xb800ffff: pingpong
*/
vdev-nums = <1>;
reg = <0x0 0xb8000000 0x0 0x10000>;
memory-region = <&rpmsg_dma_reserved>;
status = "okay";
};

&tmu {
status = "disabled";
};

&uart2 {
status = "disabled";
};

0 Kudos

3,250 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

The rpmsg dts file in 5.10.x is not using node &rpmsg, you can try to remove it.As we have reserved the M4 memory.The official imx8mq-evk-rpmsg.dts have supported M4 demo program.

reserved-memory {
		#address-cells = <2>;
		#size-cells = <2>;
		ranges;

		m4_reserved: m4@0x80000000 {
			no-map;
			reg = <0 0x80000000 0 0x1000000>;
		};

		vdev0vring0: vdev0vring0@b8000000 {
			reg = <0 0xb8000000 0 0x8000>;
			no-map;
		};

		vdev0vring1: vdev0vring1@b8008000 {
			reg = <0 0xb8008000 0 0x8000>;
			no-map;
		};

		rsc_table: rsc_table@b80ff000 {
			reg = <0 0xb80ff000 0 0x1000>;
			no-map;
		};

		vdevbuffer: vdevbuffer@b8400000 {
			compatible = "shared-dma-pool";
			reg = <0 0xb8400000 0 0x100000>;
			no-map;
		};
	};

	imx8mq-cm4 {
		compatible = "fsl,imx8mq-cm4";
		rsc-da = <0xb8000000>;
		clocks = <&clk IMX8MQ_CLK_M4_DIV>;
		mbox-names = "tx", "rx", "rxdb";
		mboxes = <&mu 0 1
			  &mu 1 1
			  &mu 3 1>;
		memory-region = <&vdevbuffer>, <&vdev0vring0>, <&vdev0vring1>, <&rsc_table>;
		syscon = <&src>;
	};

 

0 Kudos

3,232 Views
edward_fu
Contributor III

I tried as you said. But it did not work. /dev/ttyRPMSG* did not apper, how to communicate with M4. Could you run the demo in your side? Thanks.

0 Kudos

3,242 Views
edward_fu
Contributor III

Thanks.

Have you tried it and does it work in Android?

0 Kudos