-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Small SD cards do not work correctly #288
Comments
How many clusters does this volume has? If less than 65525, it should be formatted as FAT16. In MiniDexed the FatFs file system module is used for file access and I don't think, there is a bug in it regarding this, because it is widely used. |
Learned something. Will add this to the documentation. |
It's a 128MB Sd card with 240.112 clusters.
"I don't think there are bugs in Microsoft Windows because it is widely used." Maybe not the best line of defense, if someone has clearly documented that MiniDexed (and also MT-32) does not work on a small SD card. |
I tried a similar sized µSD card and a very old 1.00 or 1.01 SD card with Circle. Both worked well. I cannot exclude, that there are (µ)SD cards, which do not work with Circle. I can only recommend to use an other card. |
With the smallest ones one can buy today well in the GB range, I don't think it's worthwhile to spend a lot of effort on this. @fp64lib if you really care about this, maybe it'd be worthwhile to ask over at http://elm-chan.org/fsw/ff/bd/ and maybe test the same SD card with another FatFs based project? @rsta2 I see that FatFs also supports exFAT, does this mean that Circle also supports it? |
@probonopd No, this may require a license fee. That's why this is disabled in Circle. See: http://elm-chan.org/fsw/ff/doc/appnote.html#exfat (second paragraph). |
I had issues with a few of the 100+ 128MB cards I have used where the SPI return code wasn't putting the usual 111 or 000 in the unused bits which mean that it thought that a write had failed when it had actually succeeded meaning that it only did a partial update. The fix was to ignore the unused bits! |
Thanks. In which controller register are these bits? May masking out these bits affect operation with other SD cards? |
I think it is the write response byte, but a better explanation from the guy who fixed it is here: https://stardot.org.uk/forums/viewtopic.php?p=247106#p247106 There are also some 128MB cards that fail to initialise properly and require a power cycle to reset. |
I guess, we are talking about different issues here, because the initial problem was (most likely) related to the FAT file system driver. Unfortunately I do not have direct access to the data token, sent by the SD card, which were mentioned in the referenced article. I can only program the EMMC or SDHOST controller of the Raspberry Pi. The SD card is not accessed via SPI in the Circle drivers. I'm open for fixes, but generally it is difficult, because I do not have these SD cards here, which do not work. I have a 16 MB SD card from Canon is working well with Circle. |
I had similar issues with random errors and narrowed it down to the FatFs driver. After switching over to Circle CFATFileSystem everything worked perfectly. FatFs is much more complicated for me to even start bug finding but the major problems were random lockups accessing the card and initializing the card. Although, using a Fat16 64MB partition with smallest cluster size, significantly reduced the lockups |
Does this also happen with SD card partitions with sizes greater than or equal 1 GB? FatFs issues can be reported in the FatFs User Forum. But this makes only sense, if there is a reliable proof of the problem. There has been a recent update to the FatFs release, which is used in Circle. Perhaps this solved the problem(s)? |
I'm not sure as I only work with FAT16 partitions of sizes less than 512MB. I dont use FAT32 in my projects so the problem I had could well have been a FAT16 only problem. I have since updated my circle build with the newer FatFs driver and so far I have not any issues with the FATFS drivers when using an SD card. I do rememebr that the older FatFs driver read clusters in 512 byte chunks and if I did not format the card with 512 byte clusters then a would get random lockups reading/writing to the card. |
Thanks for info! So in case of problems my suggestion would be to use SD cards with partitions >= 1 GB size. Of course it would be good to find the reason of an issue, if there is one, but unfortunately I wasn't able to reproduce any problem in this field with the available error reports. |
This issue originally was raised for the MiniDexed. After booting the appropriate kernel image, access to the FAT32 file system does not work correctly for a small Micro SD card, i.e. in my case 128MB. More details can be found here probonopd/MiniDexed#160 , also what was already checked. Filesystem is definitely FAT32, card was freshly formatted.
The text was updated successfully, but these errors were encountered: