Problems readin/writing industrial microSD card

chaosct
Posts: 2
Joined: Fri Jan 29, 2021 5:58 pm

Problems readin/writing industrial microSD card

Postby chaosct » Fri Jan 29, 2021 6:14 pm

Hi all,

I bought a swissbit industrial MicroSD card (512MB) and I am trying to use it with an ESP32 board.
( https://eu.mouser.com/ProductDetail/Swi ... YQg0T1WQ== )

The board works flawlessly with normal MicroSD cards (Sandisk for instance), but I can't really get it to work with the industrial SD card.

I tested it with this example program from the Arduino-ESP32:
https://github.com/espressif/arduino-es ... D_Test.ino

This are the results with the industrial microSD card. After testing a little, it seems that after some operations (like mkdir) the library can't access to the underlying data anymore (and for instance can't list directories anymore):

Code: Select all

Card Type: SDSC
SD Card Size: 472MB
Listing directory: /
  DIR : /System Volume Information
  DIR : /.Spotlight-V100
  DIR : /.fseventsd
  FILE: /setup.jsn  SIZE: 44
  FILE: /._setup.jsn  SIZE: 4096
  FILE: /PLIST.JSN  SIZE: 2
  DIR : /.Trashes
  FILE: /R0  SIZE: 141640
  FILE: /R1  SIZE: 141640
  FILE: /R2  SIZE: 141640
Creating Dir: /mydir
mkdir failed
Listing directory: /
Removing Dir: /mydir
rmdir failed
Listing directory: /
Writing file: /hello.txt
Write failed
Appending to file: /hello.txt
Append failed
Reading file: /hello.txt
Failed to open file for reading
Deleting file: /foo.txt
Delete failed
Renaming file /hello.txt to /foo.txt
Rename failed
Reading file: /foo.txt
Failed to open file for reading
Failed to open file for reading
1048576 bytes written for 0 ms
Total space: 468MB
Used space: 1MB
As a reference, this is the result with the same contents but in a Sandisk MicroSD card:

Code: Select all

SD Card Type: SDHC
SD Card Size: 15103MB
Listing directory: /
  DIR : /.Spotlight-V100
  DIR : /.fseventsd
  FILE: /setup.jsn  SIZE: 44
  FILE: /._setup.jsn  SIZE: 4096
  FILE: /R1  SIZE: 141640
  FILE: /PLIST.JSN  SIZE: 2
  FILE: /test.txt  SIZE: 0
  FILE: /R0  SIZE: 141640
  FILE: /foo.txt  SIZE: 13
  FILE: /R2  SIZE: 141640
  DIR : /.Trashes
  DIR : /System Volume Information
Creating Dir: /mydir
Dir created
Listing directory: /
  DIR : /.Spotlight-V100
  DIR : /.fseventsd
  FILE: /setup.jsn  SIZE: 44
  FILE: /._setup.jsn  SIZE: 4096
  FILE: /R1  SIZE: 141640
  FILE: /PLIST.JSN  SIZE: 2
  FILE: /test.txt  SIZE: 0
  FILE: /R0  SIZE: 141640
  FILE: /foo.txt  SIZE: 13
  DIR : /mydir
  FILE: /R2  SIZE: 141640
  DIR : /.Trashes
  DIR : /System Volume Information
Removing Dir: /mydir
Dir removed
Listing directory: /
  DIR : /.Spotlight-V100
Listing directory: /.Spotlight-V100
  DIR : /.Spotlight-V100/Store-V2
Listing directory: /.Spotlight-V100/Store-V2
  DIR : /.Spotlight-V100/Store-V2/B4B5BDD0-CCDA-4619-AF37-8B97A1AD8322
  FILE: /.Spotlight-V100/VolumeConfiguration.plist  SIZE: 4315
  DIR : /.fseventsd
Listing directory: /.fseventsd
  FILE: /.fseventsd/fseventsd-uuid  SIZE: 36
  FILE: /setup.jsn  SIZE: 44
  FILE: /._setup.jsn  SIZE: 4096
  FILE: /R1  SIZE: 141640
  FILE: /PLIST.JSN  SIZE: 2
  FILE: /test.txt  SIZE: 0
  FILE: /R0  SIZE: 141640
  FILE: /foo.txt  SIZE: 13
  FILE: /R2  SIZE: 141640
  DIR : /.Trashes
Listing directory: /.Trashes
  DIR : /System Volume Information
Listing directory: /System Volume Information
  FILE: /System Volume Information/WPSettings.dat  SIZE: 12
  FILE: /System Volume Information/IndexerVolumeGuid  SIZE: 76
Writing file: /hello.txt
File written
Appending to file: /hello.txt
Message appended
Reading file: /hello.txt
Read from file: Hello World!
Deleting file: /foo.txt
File deleted
Renaming file /hello.txt to /foo.txt
File renamed
Reading file: /foo.txt
Read from file: Hello World!
0 bytes read for 0 ms
1048576 bytes written for 5692 ms
Total space: 15095MB
Used space: 6MB
The card seems to work perfectly when used with a computer. Is there anything I can try to make it work?

Thanks a lot!
C

chaosct
Posts: 2
Joined: Fri Jan 29, 2021 5:58 pm

Re: Problems readin/writing industrial microSD card

Postby chaosct » Tue Feb 09, 2021 11:31 am

Just to update,

By using a different model from the same manufacturer this is working (SFSD4096N3BM1TO-E-GE-2D1-STD)

So it might be a problem with the card, with the size of the card (512Mb vs 4Gb) or with the formatting of the card (Fat16 vs FAT32).

chegewara
Posts: 2364
Joined: Wed Jun 14, 2017 9:00 pm

Re: Problems readin/writing industrial microSD card

Postby chegewara » Tue Feb 09, 2021 7:00 pm

esp32 is very picky about sd cards, and yes, it may be the size in this case, since its from the same manufacturer.

Who is online

Users browsing this forum: No registered users and 60 guests