Go Down

Topic: [Solved] Editing Files on SD Card under Windows (Read 1 time) previous topic - next topic

aisc

I have formatted an SD card with SDFormatter under Windows 7 and written to it with a sketch using an Ethernet shield. The card works just fine.

However, when I take the card out of the shield and put it in my laptop's SD card slot, a message pops up stating I need to format the card in order to use it.

Is it normal for Windows not to recognize a card which was actually formatted using Windows?

Having destroyed my only other card, I don't really want to try this with my only remaining one, but....

Will the Arduino be able to read a card written to with something like Windows Notepad?

I am sure this must have been tried already - anybody willing to share their findings?

FWIW I did search the forum but could not find quite the info I am interested in.


Peter_n

#1
Sep 10, 2015, 07:15 pm Last Edit: Sep 10, 2015, 07:17 pm by Peter_n
It will work, but some cards seems to have compatibility problems.
When I remove the card from my Ethernet Shield, sometimes the Arduino was writing to it at the moment. Then Windows 7 asks me to check the card, and after that all files are still available. To avoid that I have added a 'Eject' button, to prevent the Arduino to write to the card so I can take it out.

A few older 1GB and 2GB microSD cards seems to work best. I use SDformatter and Windows 7 and linux, and have no problems since I use that 'Eject' button.
I can make files in Windows and linux and they can be read without problem.
I'm not sure if NotePad writes a few irritating useless UTF-8 or UniCode BOM identifier bytes at the start of the file. I use AkelPad in Windows.

I never had a question to format my card. I think that Windows 7 doesn't even recognize the start section of the SD card when it asks to format it.

It could be a SD card that is not very compatible. It could be an Ethernet Shield clone with very bad contacts for the SD socket. It could be that the 3.3V is too low. Do you have power problems ?

aisc

The card is a Kingston 4GB Micro SD HC Class 4 model SDC4/4GB.

The shield is a "Keyes" clone but I have no problem reading from / writing to the card when its in the shield.
My Windows 7 (Professional) laptop has a built-in SD card slot, in which I originally formatted the card.

I just tried the card in my Windows 10 laptop (also a built in slot), I could read the files no problem.

Within the sketch I use the SD Card to store config info, so the card is only read at start-up.
The card is never written to, so I probably don't really need an eject button.

I guess I will need to do some testing with Windows 7.

Peter_n

#3
Sep 10, 2015, 08:14 pm Last Edit: Sep 10, 2015, 08:15 pm by Peter_n
Strange.
I think that is a very normal SD card.
If you don't write to the card in the sketch, then you don't need an Eject button. I write data to log files.

Perhaps the built-in SD slot in the Windows 7 laptop is not compatible with the SD card.

You could retry the SDformatter with both the options on, on the Windows 10 laptop, and read the card also on the Windows 10 laptop. That should work.

What if you use a seperate usb-SD-reader for the Windows 7 laptop ?

aisc

Perhaps the built-in SD slot in the Windows 7 laptop is not compatible with the SD card.
Not likely considering I used that slot to format the card.

Quote
You could retry the SDformatter with both the options on, on the Windows 10 laptop, and read the card also on the Windows 10 laptop. That should work.
I will try reformatting once I buy another card. Don't want to risk being stuck without one.

Quote
What if you use a seperate usb-SD-reader for the Windows 7 laptop ?
I have one of those multi-port card readers and I could not format the card in it nor can I read the card in it - think I need a new driver.

aisc

#5
Sep 10, 2015, 09:07 pm Last Edit: Sep 10, 2015, 09:41 pm by aisc
Eureka! - found the problem.
The problem is the adapter.
I was using the adapter (brand new) that I received with the card - it works with Windows 10 but not windows 7.

Your suggestion made me check my portable multi-port USB drive, and I saw it has a Micro SD slot, so I plugged the card directly into it and it worked under Windows 7.

That made me realize the issue could be the adapter, which it was.
Originally I used an old one which was at hand so there was no problem.
Using the new one was a problem.
Anyway, I'm pleased I found the source of that problem.

Back to writing to the card...
I have Notepad++ installed - I will test creating a file with that before installing more software.
 

Peter_n

Cool  8)  I'm glad you found the problem.

Notepad++ has an option in the Encode menu : "Encode in UTF-8 without the irritating useless BOM".
But perhaps you better store it as ANSI, your sketch probably does not read UTF-8.

aisc

Cool  8)  I'm glad you found the problem.

Notepad++ has an option in the Encode menu : "Encode in UTF-8 without the irritating useless BOM".
But perhaps you better store it as ANSI, your sketch probably does not read UTF-8.
I created a test file in Notepad++ and saved it to my HDD using the default settings. I then copied it to the SD card with Windows Explorer. I can read the file with a sketch - so it works.

Following your message I went back to Notepad++ and checked the Encoding setting... it is set on UTF-8.
The file is saved as a "normal text file".

That's great, now I can edit my config files in Windows rather than via a sketch.
Thanks for the helpful input.

Go Up