LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Write to SD card fails (http://www.linuxquestions.org/questions/linux-newbie-8/write-to-sd-card-fails-789860/)

Niraj Kulkarni 02-18-2010 12:46 AM

Write to SD card fails
 
Hi,
I am using Sandisk 2GB micro SD card on ARM processor EP9307A.
The card is detected , mounted.
I can read data from the SD card.
But cannot write to it.
There is no error when I attempt to write to the Card.It appears as if its working fine.But after umount and re-mount , the data written is gone.

Here is the log when the SD card is detected:
# insmod drv
card size = 1977614336, sector size = 31, wp_grp_size = 127, wp_grp_enable = y
S:00001000 M:fffff000

What is the significance of Write Group Protect Enable (wp_grp_enable=y).
Is it the case that the SD card is write protected.

Using CMD9 : SEND_CSD , I can read the Card Specific Data (CSD).

I have tried CMD27 : PROGRAM_CSD , to CLEAR wr_grp_enable : No effect seen.
I have tried CMD29 : CLEAR_WRITE_PROT ,: No effect seen.

Where is the issue,
1. I could not send commands properly.
2. Card cannot be set free from WRITE_PROTECT.
3. Some thing else

Pls help.
Regards Niraj

mpier 02-18-2010 02:26 AM

Hi,
there is no protection switch on the card? Did yo try to connect it through sd adapter (sd adapters have this switch).

Simon Bridge 02-18-2010 03:22 AM

Quote:

What is the significance of Write Group Protect Enable (wp_grp_enable=y).
Is it the case that the SD card is write protected.
It means that group write protection is possible.

Related to:
http://www.freepatentsonline.com/EP1615225.html
... the idea is that the write protection is "permanent" - i.e. you should not be able to just disable it.

From the Sandisk multi-media card manual 1.5.7.6 [pdf]:
Quote:

Two card level write protection options are available: permanent and temporary. Both can be set using the PROGRAM_CSD command (see section 4.2.3). The permanent write protect bit, once set, cannot be cleared. This feature is implemented in the MultiMediaCard controller firmware and not with a physical OTP cell.
Presumably something has been able to write to it. It will be as well to check the HW switch state.

It may be that there is another partition on the drive - the write protection is not supposed to be for the whole card. With in mounted: fdisk -l


All times are GMT -5. The time now is 11:45 AM.