imx8qm-mek: Xen with Android

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

imx8qm-mek: Xen with Android

3,836 Views
lorenzo_sarchi
Contributor I

Good morning,

I need Android Auto as a 2nd OS with XEN, om imx8qm-mek, but I am not able to run it.

Below I make a list of the steps that I followed; probably someone is not correct or missing.

I have used Yocto Zeus 5.4.47 for creating the 1st domain, the correspondent should be Android Auto 11.0.0-1.1.0 (same kernel version).


Xen seems to be working ok with 2 Linux OS
In contrast, while trying Android as a 2nd OS, I cannot see nothing and I am not able to switch to user DomU console.

In this case, "xl list" shows anyway 2 domains: the first one and the user DomU.

Following the IMXVIRTUG_pdf guide, that make an example with prebuilt images (Android 9), I followed these steps for building my proper images:


.1. Burned the wic image in the sdcard; the wic image had been created wth Yocto Zeus 4.14.47.
(created adding : < DISTRO_FEATURES_append = " xen" > in conf/local.conf )

 

.2. Build Android images, starting from Android Auto 11.0.0-1.1.0, while selecting "mek_8q_car2-userdebug" in the launch menu.
As far as I understood, mek_8q_car2-userdebug should be the right choice for creating a 2nd OS to be used with Xen.


.3. Use UUU to burn images from the Android images into the board’s eMMC , with:
"sudo ./uuu_imx_android_flash.sh -f imx8qm -d xen" .

(by the way, Android auto 11 doesn't need to be patched with 0001-MLK-21443-dmaengine-fsl-edma-v3-clear-pending-irq-be.patch and 0001-MLK-21445-serial-fsl_lpuart-do-HW-reset-for-communic.patch, mentioned in the pdf document).


.4. Copy the spl-imx8qm-xen.bin file, created from Android building, into the SD card’s FAT partition (partition 1).

.5 Burn the u-boot-imx8qm-xen-dom0.imx in the non partitioned part of the sdcard, with the command:
"sudo dd if=u-boot-imx8qm-xen-dom0.imx of=/dev/mmcblk0 seek=32 bs=1k && sync".


.6. At this point, while booting the board from sdcard, I stop it soon, entering in U-Boot console and I execute:

. setenv domu-android-auto yes
. saveenv
. run xenmmcboot

 

.7 When finished, I try to craete the 2nd domain:
xl create /etc/xen/domu-imx8qm-mek-androidauto.cfg , with the configuration already present.


.8 At this point , running xl list, I see the 2 Domains.

 

Anyway, I cannot see nothing on the ldvs channel 0 (no signal) and if I try to switch to secondary domain console, I get stuck.

Executing: "xl console DomU " , then I get stuck.

So, what is wrong or missing in the above procedure?

Regards

0 Kudos
16 Replies

244 Views
Binh_Hoang
Contributor II

Hi lorenzo_sarchi

I've seen the issue open for a long time. Is the 2nd Android OS bootable yet? I had the same problem with Yocto Zeus 5.4.47

0 Kudos

3,756 Views
wang12zhe
Contributor III

Hi,

 I'm doing xen  on imx8qm too,and “lunch mek_8q_car2-userdebug”

when I try to run "sudo ./uuu_imx_android_flash.sh -f imx8qm -d xen" will show error as below:

This script is validated with uuu 1.3.124 version, it is recommended to align with this version.
dual bootloader is supported
dtbo is supported
dual slot is supported
generate lines to flash partition-table.img to the partition of gpt
generate lines to flash bootloader-imx8qm-xen.img to the partition of bootloader_a
generate lines to flash dtbo-imx8qm-xen.img to the partition of dtbo_a
generate lines to flash boot.img to the partition of boot_a
generate lines to flash system.img to the partition of system_a
generate lines to flash vendor.img to the partition of vendor_a
generate lines to flash product.img to the partition of product_a
generate lines to flash vbmeta-imx8qm-xen.img to the partition of vbmeta_a
generate lines to flash bootloader-imx8qm-xen.img to the partition of bootloader_b
generate lines to flash dtbo-imx8qm-xen.img to the partition of dtbo_b
generate lines to flash boot.img to the partition of boot_b
generate lines to flash system.img to the partition of system_b
generate lines to flash vendor.img to the partition of vendor_b
generate lines to flash product.img to the partition of product_b
generate lines to flash vbmeta-imx8qm-xen.img to the partition of vbmeta_b
uuu script generated, start to invoke uuu with the generated uuu script
uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.4.139-0-g1a8f760

Wait for Known USB Device Appear...
Error: fail open file: >/tmp/bootloader-imx8qm-xen.img

 

Can you give any suggestion? thanks very much

 

0 Kudos

3,771 Views
lorenzo_sarchi
Contributor I

Good morning nxf65025,

Thanks for your reply.

Unfortunately, following this way, it even fails in the "xl create domu-ammek-android.cfg".

There are some things that are not yet anyway clear to me.

1. You suggest me to follow i.MX_Linux_Users_Guide,Chapter 12 Virtualization. But this make an example of just 2 Linux OS , that are already working in my case; there is no mention of Android in this chapter/guide, so this is not the issue.

I followed instead the imxvirtug_ga.pdf  guide, in which there are some differences too, bu example setting "setenv domu-android-auto yes" in the u-boot console. Also, there is no mention at the module en.blackbak.ko (by the way, I didn't use , and the 2 Linux OS worked anyway).

So, I need to have Android as a 2nd OS.

2. Is it correct to build Android images with the choice mek_8q_car2-userdebug in the lunch menu?

I understood so, but I have not clearly found in some notes (probably there is specified somewhere, but I didn't find).

 

Could you pls clarify me the above doubts?

 

Thanks and Regards,

 

0 Kudos

3,707 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

@lorenzo_sarchi @wang12zhe 

 

Below command is very helpful , uuu will help us replace firmware.

flash u-boot-imx8qm-xen-dom0.imx to the partition of bootloader0 on SD card ,

write spl-imx8qm-xen.bin to FAT on SD card,

replace xen firmware on FAT,

flash .\imx-image-multimedia-imx8qmmek-20211223025126.rootfs.wic

./uuu_imx_android_flash.sh -f imx8qm -u xen -d xen -e -y imx-image-full-imx8qmmekxxx.rootfs.wic

 

0 Kudos

3,781 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

You should plug SD to your board and use below command,follow our i.MX_Linux_Users_Guide,Chapter 12 Virtualization .

sudo ./uuu_imx_android_flash.sh -f imx8qm -u xen -d xen -e -y imx-image-full-imx8qmmekxxx.rootfs.wic

And you need compare the uboot config files for standard and automotive. 

To eanble fast boot, android automotive image removed some uboot features. 

CONFIG_CMD_NET=n
CONFIG_CMD_NFS=n
CONFIG_CMD_BDI=n
CONFIG_CMD_CONSOLE=n
CONFIG_CMD_BOOTD=n
CONFIG_CMD_BOOTEFI=n
CONFIG_CMD_BOOTEFI_HELLO_COMPILE=n
CONFIG_CMD_ELF=n
CONFIG_CMD_GO=n
CONFIG_CMD_RUN=n
CONFIG_CMD_IMI=n
CONFIG_CMD_IMLS=n
CONFIG_CMD_XIMG=n
CONFIG_CMD_EXPORTENV=n
CONFIG_CMD_IMPORTENV=n
CONFIG_CMD_EDITENV=n
CONFIG_CMD_ENV_EXISTS=n
CONFIG_CMD_CRC32=n
CONFIG_CMD_DM=n
CONFIG_CMD_LOADB=n
CONFIG_CMD_LOADS=n
CONFIG_CMD_FLASH=n
CONFIG_CMD_GPT=n
CONFIG_CMD_FPGA=n
CONFIG_CMD_ECHO=n
CONFIG_CMD_ITEST=n
CONFIG_CMD_SOURCE=n
CONFIG_CMD_SETEXPR=n
CONFIG_CMD_MISC=n
CONFIG_CMD_UNZIP=n
CONFIG_CMD_LZMADEC=n
CONFIG_CMD_SAVEENV=n

CONFIG_DISPLAY_CPUINFO=n
CONFIG_DISPLAY_BOARDINFO=n
CONFIG_EFI_LOADER=n

0 Kudos

3,807 Views
lorenzo_sarchi
Contributor I

Hi nxf65025, 

you say that Android Auto 11.0.0_1.1.0 did not add XEN support in the prebuilt image.

But I have built it from AOSP, selecting mek_8q_car2-userdebug in the lunch menu, as mentioned in the pont '2' in the step list above.

I need to be able to create it and customize it, not using prebuilt images.

Do you mean that Android Auto 11.0.0_1.1.0 doesn't support XEN at all?

Or is it just the prebuilt image that doesn't support XEN ?

0 Kudos

3,730 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Can you check if you have set "androidboot.xen_boot=xen" in android os?

0 Kudos

3,712 Views
lorenzo_sarchi
Contributor I

Hi xf65025,

I dis use the default imx8qm-mek-domu.dtb, called by the the  <device_tree = "/run/media/mmcblk1p1/imx8qm-mek-domu.dtb"> in the cfg configuration file during the "xl create ....,cfg".

 

In this .dts, by default I have not seen this bootargs option (I have not seen anyway any other bootargs option).

Do I should add this?

Something like this below could be enough?

chosen {
bootargs = "androidboot.xen_boot=xen";
}

 

Do I need instead to add some other needed option?

Regards

 

0 Kudos

3,709 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

You can set in on uboot command line:

-> setenv androidboot.xen_boot=xen

->saveenv

Or you can add this command line to device/nxp/imx8q/mek_8q/BoardConfig.mk

BOARD_KERNEL_CMDLINE += androidboot.xen_boot=xen

 

0 Kudos

3,683 Views
lorenzo_sarchi
Contributor I

Hi Nxf65025,

I cannot set in the uboot command line, absolutely impossiblebecause I even cannot enter in the domU uboot console (as mentoned).

I have rebuilt Android wit hthe mentioned added kernel command line in the device/nxp/imx8q/mek_8q/BoardConfig.mk, but the result is the same: I cannot see the User domain.

 

Could you pls tell me wich Yocto version have you used (kernel version too) and which Android auto version have you used?

Regards

 

0 Kudos

3,576 Views
lorenzo_sarchi
Contributor I

Hi Nxf65025,

 

Could you pls tell me which Yocto/kernel version have you used, which Android auto version and every step?

Regards

0 Kudos

3,720 Views
wang12zhe
Contributor III

Where to set "androidboot.xen_boot=xen"? in which file?

I only see maybe need "androidboot.xen_boot=xen" in Kernel boot parameters from Android_User's_Guide.pdf , but i'm download image by sudo ./uuu_imx_android_flash.sh -f imx8qm -d xen

0 Kudos

3,708 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

You can set it on uboot command line

0 Kudos

3,704 Views
wang12zhe
Contributor III

I'm sorry but I'm confused now, I think I need add  more information,
I‘m doing compile android and download image by "sudo ./uuu_imx_android_flash.sh -f imx8qm -d xen"
during execl "sudo ./uuu_imx_android_flash.sh -f imx8qm -d xen", show Error: fail open file: >/tmp/bootloader-imx8qm-xen.img 

 

then I find:
owenn@kostalaen-HP-ProDesk-600-G3-MT:~/8TB/AndroidProject/Android10/android_build$ ls /tmp/bootloader-imx8qm-xen.img -l
lrwxrwxrwx 1 root root 111 12月 25 08:39 /tmp/bootloader-imx8qm-xen.img -> /home/owenn/8TB/AndroidProject/Android10/android_build/out/target/product/mek_8q/bootloader-imx8qm-xen.img
but I can't find bootloader-imx8qm-xen.img in out/target/product/mek_8q/ 
why no the bootloader-imx8qm-xen.img file in out/target/product/mek_8q/ 

0 Kudos

3,702 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Can you attach your android build log?

0 Kudos

3,815 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

@lorenzo_sarchi We checked with Android Team and Android Auto 11.0.0_1.1.0 did not add XEN support in the prebuilt image.

Please try Android Auto 10.0.0_2.4.0 instead.

0 Kudos