Android 6.0.1 Can not mount the usb disk

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

Android 6.0.1 Can not mount the usb disk

9,806 Views
charleshuang
Senior Contributor II

Hi NXP

Our platform is imx6q.  OS version is android 6.0.1.

Question 1   When we want to auto mount  the usb, where is the usb file nount path?

                     In android 5.1 or 5.0. auto mount the usb disk is success.

                     If we want to check the file in usb disk, we can find the /mnt/media_rw/udisk in android 5.0/5.1. 

                     Follow the fstab_sd.freescale :

/devices/soc0/soc.0/2100000.aips-bus/2184000.usb/ci_hdrc.0  /mnt/media_rw/udisk vfat defaults voldmanaged=udisk:auto

                    But android 6.0.1 is different, we can not auto mount the disk and can not find the file.

Question 2  How to do modify the fstab_sd.freescale?

                   Step 1   We plug in usb disk.

                   Step 2    Then we check Settings --> Storage &USB  in Android 6.0.1, we can not find the usb .

Thanks

Clayder Huang

Labels (1)
6 Replies

3,219 Views
nguyenmr
Contributor III

Hi,

i've mounted successfully USB stick to both USB host and OTG on Kernel 4.1.15, android 6.0.1.

if you use usb host (0 or 1 or both ) you can use: 

/devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0*  //for host 0

/devices/soc0/soc/2100000.aips-bus/2184200.usb/ci_hdrc.1*  //for host 1

if you use usb OTG, no need to add anything.

BR/Nguyen

3,219 Views
dennyzhou
Contributor II

Hi,

  I have met this problem. And I just fix it now. The root cause is mentioned here.

[Android 6.0.1] How to setting or modify parameter for mount USB in host USB port?

https://community.nxp.com/thread/429690

 [Also raised by Huang]

  Jim.LIN, NXP's guy, gave the correct answer.

"The root cause if that if you need host1, you need change fstab.freescale to host1 then android vold can know this.

 

Change /devices/soc0/soc.0/2100000.aips-bus/2184000.usb/ci_hdrc.0* to

/devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1*

"

  In our project, we use sabresd-imx6dq as base. Then we add an Usb-HUB in USB1. Firstly, we cound not use FIle Explore to access any U-disk. Now we changed the fstab. It has been fixed.

  The data'0x2184200' has been defined for USB1 in the 'imx6qdl.dtsi(?)' file of Kernel4.1.5. The original configuration of fstab may just used for OTG/USB0 on demo board, as USB1 are not used on sabresd-imx6dq board? We just need to update it according to our HW change in projects.

Thank you

BR//Bing.

dennystc@nuaa.edu.cn

3,219 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi Huang,

Was the provided information useful?

According with AE team, any USB device has to be "adopted" in order to appear as a storage device on MM.

Additional tests were performed in order to see if they have any deviation from defaults.  It seems by default (in MM) Android sets USB to Charge only mode. It was found that on our prebuilt binaries set it to MTP mode.

But then it seems that USB OTG support is not supported by the device tree. So don't expect the OTG port to be enumerated until the DT is changed.

You can enable developer options and enable USB features by following below steps

1. Settings -> About phone (or tablet) -> Touch 5 times on Build Number to enable Developer options

2. Settings -> Developer Options -> Select USB Configuration -> [Pick one]

Then in a debug session do "sm set-force-adoptable true"

At this point you need an application that can set permissions. the packaged explorer does not have the ability to adopt or change permissions.

So, the recommendation is getting familiar with the 'sm' command in Android as it seems to provide several function for storage devices.

Hope this will be useful for you.
Best regards!
/Carlos
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

3,219 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi Huang,

I have tested the Android 6.0.1 Demo image on an i.MX6Q SABRE-SD board, and it is auto-mounting the USB disks; their content could be visualized on the file explorer.

If what you want to access to the mounting path over the serial terminal (as you mentioned, on /mnt/media_rw), I tested on this way and I got permission error. The Demo images are not rooted, so, if you need root access on the serial terminal, it is required to build the image with the option “userdebug”, as indicated on section 3.4 “Building Android images” of the “Android User's Guide” document (attached).

Hope this will be useful for you.
Best regards!
/Carlos
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

3,219 Views
charleshuang
Senior Contributor II

Hi Carlos

I try again the Android 6.0.1 Demo image on an SABRE-SD demo board.  It's auto mount the usb disk.

20160620_135928.jpg

The USB drive information will be show in  Andorid 6.0.1 (Setting/ Storage&USB/) .

Then, I try to test our platform.

It's can not show SanDisk USB drive information in Android 6.0.1 (Setting/ Storage&USB/).

I check log message.

(1) log message : After system boot up, the usb disk plug in platform.

------------------------------------------------------------------------------------

root@rsb_4411_a1:/ #

root@rsb_4411_a1:/ # usb 1-1.2: new high-speed USB device number 7 using ci_hdrc

usb 1-1.2: New USB device found, idVendor=0781, idProduct=5151

usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3

usb 1-1.2: Product: Cruzer Micro

usb 1-1.2: Manufacturer: SanDisk Corporation

usb 1-1.2: SerialNumber: 200443236102d5634547

usb-storage 1-1.2:1.0: USB Mass Storage device detected

scsi2 : usb-storage 1-1.2:1.0

scsi 2:0:0:0: Direct-Access     SanDisk  Cruzer Micro     0.1  PQ: 0 ANSI: 2

sd 2:0:0:0: [sda] 1000944 512-byte logical blocks: (512 MB/488 MiB)

sd 2:0:0:0: [sda] Write Protect is off

sd 2:0:0:0: [sda] No Caching mode page found

sd 2:0:0:0: [sda] Assuming drive cache: write through

sd 2:0:0:0: [sda] No Caching mode page found

sd 2:0:0:0: [sda] Assuming drive cache: write through

sda: sda1

sd 2:0:0:0: [sda] No Caching mode page found

sd 2:0:0:0: [sda] Assuming drive cache: write through

sd 2:0:0:0: [sda] Attached SCSI removable disk

------------------------------------------------------------------------------------

(2) log meesage :   When usb in platform, system boot up.

------------------------------------------------------------------------------------

ci_hdrc ci_hdrc.1: doesn't support gadget

ci_hdrc ci_hdrc.1: EHCI Host Controller

ci_hdrc ci_hdrc.1: new USB bus registered, assigned bus number 1

ci_hdrc ci_hdrc.1: USB 2.0 started, EHCI 1.00

usb usb1: SerialNumber: ci_hdrc.1

usb 1-1: new high-speed USB device number 2 using ci_hdrc

usb 1-1.2: new high-speed USB device number 3 using ci_hdrc

  ------------------------------------------------------------------------------------

I refer (2) log message.

Usb disk should be set the ci_hdrc.1

so I modify ci_hdrc.1 in fstab_sd.freescale ,but the result is the same.

fstab_sd.freescale :

/devices/soc0/soc.0/2100000.aips-bus/2184000.usb/ci_hdrc.1  /mnt/media_rw/udisk vfat defaults voldmanaged=udisk:auto

How can I do setting in Android 6.0.1?

Thanks

Clayder

0 Kudos

3,219 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi Huang,

Have a look at "USB  media support" here. Traditional Storage | Android Open Source Project and here Adoptable Storage | Android Open Source Project

Some items have changed in MM and external storage seems to be a big one that affects many.

In Android 6.0, any device that is not adopted is considered portable. […] Third-party apps must go through the Storage Access Framework to interact with files on portable storage; direct access is explicitly blocked for privacy and security reasons.

Hope this will be useful for you.
Best regards!
/Carlos
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos