SD Card locked into Read Only Mode

SD Card locked into Read Only Mode after initilization using arduino ide and Seeeduino XIAO

after using arduino ide and seeeduino XIAO expansion board my proto program to log temp and humidity sensor data to micro sd card i notice the log file not being updated

i put micro sd card in sd card adapter and place in computer laptop windows 10

software indicate card is locked but not locked physically nothing will allow format or delete

somethng must have happened when program running but cannot use sd card anymore because it has 2 useless files onboard... any help would be apreciated

Is this an error/information message from a program on your Win10 system?

Can your Win10 system create a new file on the card?

I wonder if somehow the file on your SD card has somehow been marked as read only.

You should be able to use the SD card formatting utility mentioned in a sticky at the top of the storage section of the forum to reformat the card. Link below:

This should get you going again. However, I have had several SD cards that refuse to format on Win10 and I had to use a Linux system and run gparted to wipe all the partitions.

1 Like

thanks for the response

yes i tried that software i get errors stating

the disk is write protected remove write protection or use another disk

cannot format write protected disk

seems to be an error using arduino datalogger that corrupted the disk somehow
dont want to have it happen to another disk too that can get expensive

i am going to try the linux too

It may be possible that an Arduino could write to an SD that makes it unreadable by an Arduino.

Are you saying that the SD could then not be re-formatted ?

If memory serves, each time it happened to me, Windows couldn't do anything with the card. I wish I could recall the exact message. Standard format didn't work, etc. I have an old netbook with Puppy Linux on it and I used the gparted tool on that to remove all partitions from the SD card. I can't recall if I used gparted to put a FAT filesystem back on the SD card, or put the card back in a Windows PC and ran the SD formatting utility. It may be the latter as that's the suggestion in the sticky in the storage section.

"...i put micro sd card in sd card adapter..."

Just in case it might help - do you know there is a little tab/slider on the card adapter that locks the card in a read-only mode? It is very easy to nudge that out of the read/write position.

yes, thank you but that is not the problem.... i have toggled several times and also the card is read only in arduino which does not use the adapter

i have used google to download several disk partition utilities which have not been effective

usually scam free programs which i quickly uninstalled

somehow the card has a flag set that tells the os it is write protected and no amount of brute force will change its mind... i used windows cmd diskpart to no effect. have not tried regedit as it is also locked on arduino which does not have a regestry.... some say card is defective...

it may be possable that card is defective and refusing to respond but i am able to open the single file it contains

i assume the arduino was in the process of writing to the card when power was interupted or program compiled and pushed which caused... i have added a push button to abort code execution in the future before push or powerdown gotta go to another machine and get a usb to sd adapter to try formatting via linux

It does sound like the filesystem on the SD card has been corrupted - just enough to confuse the Windows formatting & diskpart utils.

BUT.... cardinfo sketch gives all correct info no problem detected on the arduino side something is fishy

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.