Difference between revisions of "IoTGateway/BSP/Android/Gettingstarted/How to use SD/MMC Card"

From ESS-WIKI
Jump to: navigation, search
Line 1: Line 1:
SD/MMC card is supported in Android system. Starting in Android 6.0, Android supports [https://source.android.com/devices/storage/adoptable.html ''adoptable'' storage], which is provided by physical media, like an SD card or USB, that is encrypted and formatted to behave like internal storage. 
+
Starting in Android 6.0, Android supports [https://source.android.com/devices/storage/adoptable.html ''adoptable'' storage], which enables a user to set up the SD card as internal storage and store applications, their data, and media on an "adopted" SD card. Please refer to "Storage" section on the Android website [https://source.android.com/devices/storage/index.html https://source.android.com/devices/storage/index.html]
  
Please refer to "Storage" section on the Android web site [https://source.android.com/devices/storage/index.html https://source.android.com/devices/storage/index.html]
 
  
  
  
== Android 6.0 ==
 
  
fstab.device
+
== Browse the SD ==
 +
 
 +
Android 6 Marshmallow includes a built-in file manager feature to browse the SD card.
 +
 
 +
*Launch the '''Settings''' app.
 +
*Tap on '''Storage & USB'''.
 +
*Tap on '''SD card '''to explore the files.
 +
 
 +
[[File:Sd01.png|RTENOTITLE]]
 +
 
 +
[[File:Sd02.png|RTENOTITLE]]
 +
 
 +
[[File:Sd03.png|RTENOTITLE]]
 +
 
 +
 
 +
 
 +
External storage (SD/MMC card) is managed by a combination of the&nbsp;<code>vold</code>&nbsp;init service and&nbsp;<code>MountService</code>&nbsp;system service. Mounting of physical external storage volumes is handled by&nbsp;<code>vold</code>, which performs staging operations to prepare the media before exposing it to apps. Please refer to "Device Configuration" section on the Andrid website&nbsp;[http://source.android.com/devices/storage/config.html http://source.android.com/devices/storage/config.html]
 +
 
 +
== fstab.device ==
 
<pre>/devices/soc0/soc/2100000.aips-bus/219c000.usdhc/mmc_host* auto auto defaults voldmanaged=sdcard:auto,encryptable=userdata
 
<pre>/devices/soc0/soc/2100000.aips-bus/219c000.usdhc/mmc_host* auto auto defaults voldmanaged=sdcard:auto,encryptable=userdata
 
</pre>
 
</pre>

Revision as of 07:52, 26 January 2017

Starting in Android 6.0, Android supports adoptable storage, which enables a user to set up the SD card as internal storage and store applications, their data, and media on an "adopted" SD card. Please refer to "Storage" section on the Android website https://source.android.com/devices/storage/index.html



Browse the SD

Android 6 Marshmallow includes a built-in file manager feature to browse the SD card.

  • Launch the Settings app.
  • Tap on Storage & USB.
  • Tap on SD card to explore the files.

RTENOTITLE

RTENOTITLE

RTENOTITLE


External storage (SD/MMC card) is managed by a combination of the vold init service and MountService system service. Mounting of physical external storage volumes is handled by vold, which performs staging operations to prepare the media before exposing it to apps. Please refer to "Device Configuration" section on the Andrid website http://source.android.com/devices/storage/config.html

fstab.device

/devices/soc0/soc/2100000.aips-bus/219c000.usdhc/mmc_host* auto auto defaults voldmanaged=sdcard:auto,encryptable=userdata

Check sysfs node

# cat /sys/block/mmcblk0/device/type
MMC
# cat /sys/block/mmcblk1/device/type
SD

SD Card is taken as an example:

Generate random file

# dd if=/dev/urandom of=data bs=1 count=1024

Back up

# dd if=/dev/mmcblk1 of=backup bs=1 count=1024 skip=4096

Write to SD

# dd if=data of=/dev/mmcblk1 bs=1 seek=4096

Read and Verify

# dd if=/dev/mmcblk1 of=data1 bs=1 count=1024 skip=4096
# diff data data1

If fail, it shows as below:

Binary files data1 and data differ

Restore

# dd if=backup of=/dev/mmcblk1 bs=1 seek=4096