VS1063 strange SD card issues

Designing hardware that use VLSI Solution's devices as the system controller for the entire design.
Post Reply
jdtengineering
User
Posts: 11
Joined: Fri 2018-10-12 16:58

VS1063 strange SD card issues

Post by jdtengineering » Tue 2018-10-16 17:14

I'm running into some issues when interfacing with SD cards. I have four cards, two of which without issues. The other two don't work, but with different symptoms. Both of the not working cards are microSD cards, have significantly higher storage capacity and are SDHC devices.

Working:
128 MB, full size SD, brandname: pq1
FAT, 16K

Code: Select all

Card ok
FAT ok
fat 248225
files 1
> R
Init Record
CallEncoders
E
Finish Rec!
Saving Recording!
Card ok
FAT ok
fat 248225
files 6 <--- this is a bit weird but ok
512 MB, full size SD, Kodak (came with the proto board)
FAT32, 4096

Code: Select all

Card ok
FAT ok
fat 964608
files 4
> R
Init Record
CallEncoders
E
Finish Rec!
Saving Recording!
Card ok
FAT ok
fat 964608
files 5
Not-working:
8 GB, micro SDHC in SanDisk SD adapter, cheap brand
FAT32, 4096

Code: Select all

Card ok
FAT ok
fat 15605760
files 0
> R
Init Record
<-- device freezes and has to be power cycled -->
I've waited about 10 minutes for the device to respond, it really seems frozen.

32GB, micro SDHC in SanDisk SD adapter, Transcend
FAT32, 16K & FAT32, 8192

Code: Select all

Card ok
No FAT
Card ok
No FAT
<-- etc. etc. etc -->
So on one card the FAT is not accepted at all (the card works fine if I plug it in my laptop), and the other one freezes the VS1063 when it attempts to record.

I suspect this might have something to do with the microSD's being SDHC devices, although the example code explicitly states:

Code: Select all

/* Now support High-Capacity SD (SDHC) cards by default! */
I am using http://www.vlsi.fi/fileadmin/software/V ... 181015.zip, as posted yesterday by pasi

I'll get some more SD cards to test with. Any ideas as to what could be the problem? As mentioned in my previous thread, I noticed some voltage sag on the 2.8 V line on plugging in the card so I connected my lab supply to the 2.8 V line and also replaced the CCN1 0.1µF 0603 cap with a 10 µF low-ESR capacitor, the voltage sag is now basically gone.

edit:
I have changed DEBUG_LEVEL to 3 in the code in order to enable some more verbose output. However with the two non-working cards, I never get any debug output. The 32 GB one still causes 'No FAT' messages, and the 8 GB one still freezes the device.

User avatar
pasi
VLSI Staff
Posts: 1586
Joined: Thu 2010-07-15 16:04

Re: VS1063 strange SD card issues

Post by pasi » Wed 2018-10-17 11:03

Both normal and HC are handled, so there should not be a direct link.

However, there are cards that do not implement the SPI communication mode quite correctly. The latest I have seen are:
- multiple read block fails on (my guess) page boundaries
- read single block randomly fails
So, the standalone player is now performing single block reads using multiple block read but reading only one block.
- one card randomly didn't send a response to a single block read, but kept the fetched data even throughout communication init. The already fetched data was then returned to the next block read. (This one was very hard to debug.)

If you can send examples of the non-working cards we can try to figure out what the issue is.

Can you play from the 8GB card if you put a playable file on it?
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook

jdtengineering
User
Posts: 11
Joined: Fri 2018-10-12 16:58

Re: VS1063 strange SD card issues

Post by jdtengineering » Wed 2018-10-17 12:15

Jep, playing from the 8 GB card works. Where can I send the cards to? I'll send them right away. Btw I much appreciate your quick response and willingness to help.

User avatar
pasi
VLSI Staff
Posts: 1586
Joined: Thu 2010-07-15 16:04

Re: VS1063 strange SD card issues

Post by pasi » Wed 2018-10-17 12:31

Give me a shout at support@vlsi.fi and I'll give the address.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook

jdtengineering
User
Posts: 11
Joined: Fri 2018-10-12 16:58

Re: VS1063 strange SD card issues

Post by jdtengineering » Wed 2018-10-17 17:13

I've sent the cards your way.

I have also tried two other 16GB SDHC cards. Initially I thought the VS1063 was not able to record to them, as they both seemed to freeze the device after "Init Record". But after waiting for about 2 minutes, the recording does start.

I read somewhere that the VS1063 first allocates free space on the disk or something like that, maybe that could be a reason why bigger cards take longer to start?

User avatar
pasi
VLSI Staff
Posts: 1586
Joined: Thu 2010-07-15 16:04

Re: VS1063 strange SD card issues

Post by pasi » Fri 2018-10-19 15:04

Something funky is going on, it shouldn't take that long. (Still the supply current issue slowing it down?)

The scan for free space has an upper limit to not go through the whole file allocation table. It ends as soon as there is (twice) the space defined by MAXFILESECTORS. The current value seems to be the maximum filesize though, the value could be reduced.

There is also a bit of code that should cache the found space to speed up the next record onto the same card, but it doesn't actually do that right now. (Bug: code has memcpy instead of memcmpXY, but adding that requires more memory.)

When I get your cards I can test them and also try some of the newer big cards we have tested the vs1005 SD driver with.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook

Post Reply