i.MX 8M Mini - Android 9 USB OTG doesn't support accessory mode

cancel
Showing results for 
Search instead for 
Did you mean: 

i.MX 8M Mini - Android 9 USB OTG doesn't support accessory mode

303 Views
Contributor I

Hello,

It looks like USB OTG accessory mode support has not been added by NXP in Android 9 (tested on kernel 4.14.78).

Two separate teams have been working on solving this with no luck.

Has NXP found a fix to this problem?  It looks like it could potentially be an SELinux permissions issue.

Any suggestions or a solution would be greatly appreciated.

Thanks,

Kevin

0 Kudos
5 Replies

10 Views
NXP Employee
NXP Employee

Hello,

It is a known problem. There are some solutions. One is making the kernel recognize your device mounting the device to an internal folder.

On the Android shell terminal as root do the following.

evk_8mm # mkdir /mnt/mount
evk_8mm # mount -t vfat /dev/block/mmcblk1p1 /mnt/mount

Other solutions could be applying the below modifications in the Android source code.

android_source/device/fsl

diff --git a/imx8m/evk_8mm/fstab.freescale b/imx8m/evk_8mm/fstab.freescale
index 72d412fd..89c5e84a 100644


--- a/imx8m/evk_8mm/fstab.freescale
+++ b/imx8m/evk_8mm/fstab.freescale
@@ -3,6 +3,7 @@


# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK


+/devices/platform/30b50000.mmc/mmc_host/* /mnt/media_rw/extsd vfat defaults voldmanaged=extsd:auto
/devices/platform/32e40000.usb/ci_hdrc.0/* auto auto defaults voldmanaged=usb:auto
/dev/block/by-name/system / ext4 ro,barrier=1 wait,slotselect
/dev/block/by-name/userdata /data ext4 nosuid,nodev,nodiratime,noatime,nomblk_io_submit,noauto_da_alloc,errors=panic wait,formattable,quota,fileencryption=software,reservedsize=128M


diff --git a/imx8m/evk_8mm/init.rc b/imx8m/evk_8mm/init.rc
index 8a5ee83f..f6dfe004 100644


--- a/imx8m/evk_8mm/init.rc
+++ b/imx8m/evk_8mm/init.rc
@@ -20,6 +20,8 @@ on init


# Support legacy paths
symlink /sdcard /mnt/sdcard
symlink /sdcard /storage/sdcard0
+ mkdir /mnt/media_rw/extsd 0755 system system
+ symlink /mnt/media_rw/extsd /storage/extsd
# setup the global environment


export CORE_REGISTER_FILE /vendor/etc/core_register
android_source/frameworks/base


diff --git a/core/res/res/xml/storage_list.xml b/core/res/res/xml/storage_list.xml
index ceebdccdafe..88d2dfe7cba 100644


--- a/core/res/res/xml/storage_list.xml
+++ b/core/res/res/xml/storage_list.xml
@@ -25,4 +25,8 @@


android:mountPoint="/storage/sdcard"
android:storageDescription="@string/storage_usb"
android:primary="true" />
+ <storage
+ android:mountPoint="/storage/extsd"
+ android:storageDescription="@string/storage_sd_card"
+ android:primary="true" />
</StorageList>

Note: The test was made mounting an external SDcard. Using other external devices may change the procedure, especially the device name that you are willing to mount.

Hope this information may be useful for you.

Best regards,

Diego.

0 Kudos

10 Views
Contributor I

Hey Diego,

Thanks for the response.

Our situation is connecting the i.MX 8M Mini to another processor.  The i.MX 8M Mini would be operating in accessory mode and the second processor in host mode.

We never receive a USB CONFIGURED uevent when connected like this (although we do receive this uevent when connected via ADB so it is some usb accessory mode problem).

Do you have any information on patches to fix USB accessory mode?

Thanks,

Kevin

0 Kudos

10 Views
NXP Employee
NXP Employee

Hello,

Our Android BSP could work in accessory mode. You can note it because a host computer can recognize the i.MX board as a USB device an not as a host device.

I do not know if you were referring to that.

Best regards,

Diego.

0 Kudos

10 Views
Contributor I

Hey Diego,

The board works properly in ADB mode - which is what you are referring to.

I would like to use the board in accessory mode - which is currently not working and is different from ADB.

Is there information on getting accessory mode to work?

Thanks,

Kevin

0 Kudos

10 Views
NXP Employee
NXP Employee

Hello,

I have been reviewing lately how the AOA works and this is more related to the developing of your application. Unfortunately, this is out of our scope of support. However, I found the following information hope it could help you.

FTF2014 - Android Accessory Protocol 

Best regards,

Diego.

0 Kudos