When talking about Embedded Linux driver development, I found many students interested in the SD card driver. I will discuss it with you later. In many technical forums,Many people have asked this question, so I want to write it and hope it will be helpful for everyone's learning. To learn how the SD card works, you mu
1, transplant Mtd-utils:A) download utd-utils for ftp://ftp.infradead.org/pub/mtd-utils/b) Cross-compiling mtd-utilsI modify makefile cross=arm-linux-II MakeIII See if we have the big tools we need under the mtd-utils-1.0.0 directory.(Flashcp,nandwrite ... , etc.). There are tools generated, OK, cross-compilation successful.IV Copy the resulting large tool to the filesystem board's root filesystem, either in/bin or/sbin.2,
This paper illustrates the existence of the SD card and the implementation of capacity query using the Android programming method. Share to everyone for your reference, specific as follows:
1. To determine whether the existence of SD card returns TRUE indicates existence
/* To determine if
= Sf.getavailableblocks (); Returns the SD card idle size return freeblocks * blockSize; Unit byte is public long getsdallsize () {//Get SD card file path filename = environment.getexternalstoragedirectory (
); Statfs SF = new Statfs (Path.getpath ());
Gets the size of a single block of data (Byte) long bloc
1. Determine if the SD card exists returns TRUE indicates that there is1 /*determine if the SD card exists returns TRUE indicates that there is*/2 Public BooleanAvaiablemedia () {3String status =environment.getexternalstoragestate ();4 5 if(Status.equals (en
I believe there are many people .... There is an internal SD too small ... External SD (SDCARD2 or EXTSD) can only be placed on the material .... Some games or video player software .... Not going to read external SD (SDCARD2 or EXTSD) ..... Most of the memory cards are not used to buy more ..... Very disturbed ..... Finally ... Find a way to change the path ....
Do SD/MMC Card Drive project also has a big six months, always feel that the sum up something. Here, the main is to record some of the more common problems and solutions, so as not to encounter again.
The first is the SD/MMC card initialization error problem. Before finding the error, confirm: 1. Use the
1. mksdcard command
Run cmd to enter the SDK tools directory and run the mksdcard command. The following help information is displayed:
We can see that sdcard image supports the FAT32 format. Usage: mksdcard [-l label]
-L the disk is followed by the volume label. For example, G indicates g disk;Size indicates the size, measured in KB and MB;File indicates the generated SD image file name, such as android_sdcard_image.
SIM card not recognized by mobile phone
1 Please confirm that all SIM cards are not recognized;
2 if not, suggest to the dot to change a sim card try;
3 If all of the SIM card is not recognized, please try to restart or restore the factory settings;
4 if not resolved please go to the nearest Huawei repair network d
Because of the large amount of data that needs to be recorded, and sometimes the user is inconvenient to upload data in real time, it is required to use SD card to store data and then manually collect uploads. For this we have chosen a Universal SD card reader and writer.1 , Card
1. First, register the SD card read and write permissions for manifest
I didn't use MainActivity. class as the software entry here.
Copy codeThe Code is as follows: AndroidManifest. xml
Package = "com. tes. textsd"
Android: versionCode = "1"
Android: versionName = "1.0" type = "codeph" text = "/codeph">
Android: minSdkVersion = "8"
Android: targetSdkVersion = "16"/>
Android: allowBackup = "true"
Android: i
BBB power on by pressing the button can decide to boot from the SD card, if there is a system from the SD card boot, if not on the boot from the eMMC. Because the BBB has already had the 4G eMMC, inside the factory existence Angstrom Linux, this system is specially for the embedded Linux system, therefore for the gener
1String status =environment.getexternalstoragestate ();2 if(Status.equalsignorecase (environment.media_mounted)) {3Toast.maketext (Techolite. This, "SD card exists", Toast.length_long). Show ();4 //the SD is readable and writable at this time5}Else if(Status.equalsignorecase (environment.media_mounted_read_only)) {
Android 2.2 software can be installed on SD for support, ADB commands have also been improved, for Android 2.2 firmware PM command support installation option parameters, the setinstalllocation parameter is added here. Here we can use ADB to execute the Linux PM command to add some parameters, such as ADB shell PM setinstalllocation 0. The last parameter 0 indicates auto. The Android system automatically selects this parameter, while 1 indicates the R
T2_50mhz, Mx6dl_pad_sd3_dat3__usdhc3_dat3_50mhz,/*SD3_CD*/Mx6dl_pad_key_col2__gpio_4_10,/*sd3_wp not used*/mx6dl_pad_sd3_rst__gpio_7_8, ...} ..... Three, board-level file configuration: Cat Arch/arm/mach-mx6/board-mx6q_sabresd.c ...#defineSABRESD_SD3_CD IMX_GPIO_NR (4, 10) ...... Static Const structEsdhc_platform_data Mx6q_sabresd_sd3_data __initconst ={. Cd_gpio=Sabresd_sd3_cd,//no answer, so no, another reason is that we are using a TF card
SD card mounting file system: VFS: Cannotopenrootdevice quot; mmcblk0p2 quot; solve the problem of using the initramfs file system. linux can run normally and read and write SD cards normally. However, if it is mounted to the SD card, the disk cannot be mounted. the bootar
Recently, we are studying the driver of pxa300 SD card.Program, Figured out the SD card initialization process, the record is as follows
1. The pxamci_probe () function calls mmc_alloc_host () to allocate the mmc_host structure and initializes the mmc_rescan latency task.
2. initialize the mmc_host structure, initi
') and change display units to
Sectors (Command ' u ').
Command (M for help): M
Command Action
A toggle a bootable flag
b Edit BSD Disklabel
C Toggle the DOS compatibility flag
D Delete a partition
L list known partition types
M Print this menu
n Add a new partition
o Create a new empty DOS partition table
P Print the partition table
Q Quit without saving changes
s create a new empty Sun Disklabel
t change a partition ' s system ID
U Change display/entry units
V Verify the partition table
W W
the requirements of the host, not satisfied, then Power_off host.Note II: MMC_ATTACH_SD completes the match, and initializes the function of the cardHOST-GT;OCR = Mmc_select_voltage (host, OCR); see if it matches, and if it does, do the following initialization workMmc_sd_init_card (host, HOST-GT;OCR, NULL); we analyze the function(1) mmc_all_send_cid () This function takes place CMD2, obtains card's identity information, enters the identity state(2)
1, first to manifest registered SD card read and Write permissions
To illustrate, I'm not using Mainactivity.class as a software portal here.
Copy Code code as follows:
Androidmanifest.xml
Package= "COM.TES.TEXTSD"
Android:versioncode= "1"
Android:versionname= "1.0" >
Android:minsdkversion= "8"
Android:targetsdkversion= "/>"
Android:allowbackup= "true"
android:icon= "@drawable/ic_launch
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.