2009-09-05 06:51 PM
SDIO + FAT16/FAT32
#microsoft:-broken-for-sure2011-05-17 03:54 AM
This topic is named : ''SDIO + FAT16/FAT32'', and I would like people to respect this simple fact. Please, people who implement a FAT lib over =SPI=, stop hijacking this topic.
Now, if you just wonder what the heck I'm talking about: Most SD cards out there are mandated to respect compatibility with the SPI port. Most of the projects out there use the SPI port to acess SD Cards. The high-density line of STM32 have a SDIO port, wich is faster but different to implement. This topic is about interfacing a FAT library over that specific port: SDIO. Thanks, -Relaxe2011-05-17 03:54 AM
Hi,
I have downloaded and compiled the SDIO_DosFS_V02.zip project that relaxe was working on. Must say well done to Relaxe on that , its the only SDIO FAT example I have found so far. It compiles and works ok for me. I can read and write files to my SDCard. My only problem with it is that its slow to write out 1Meg of data. Takes about 50 seconds. Its a lot quicker to read. Am I doing something wrong or is there another example where a write of 1Meg would be quicker. thanks Liam. [ This message was edited by: lmullane on 08-06-2009 15:44 ]2011-05-17 03:54 AM
http://fullfat-fs.co.uk/ try this, its open source, and I've had excellent performance with this.
2011-05-17 03:54 AM
Maybe you should also try different cards.
I had write 12x slower than read on an old 16 MB card, but only 2x slower than read on 256 MB card. (My setup is not really related - SPI mode, efsl, but the conclusion might be valid)2011-05-17 03:54 AM
Hi,relaxe.
I used your SDIO_DosFS_V01 code, before I used Transcend 1G SD card is OK, but now i used Transcend 2G SD card fail, I entered the Debug model to see my errorstatus is 0x2A, always error in while (!(status & (SDIO_FLAG_CCRCFAIL | SDIO_FLAG_CMDREND | SDIO_FLAG_CTIMEOUT))) { status = SDIO->STA; } I have no idea to resolve this problem, Will give me some tips to resolve this problem do? I would like to know how to solve the problem, Please discuss with me. Thank you very much!! it is my Email: fu0653@gmail.com or MSN: fu0653@yahoo.com.tw thanks!! [ This message was edited by: fu0653 on 06-09-2009 07:28 ] [ This message was edited by: fu0653 on 06-09-2009 08:38 ] [ This message was edited by: fu0653 on 06-09-2009 08:46 ]2011-05-17 03:54 AM
Hi Afinko,
Thanks for this post, I think this helps indeed. I noticed from the source code that you are using the SDIO in 1-bit mode. Wouldn't the performance be improved if you you switch to 4-bit mode instead?2011-05-17 03:54 AM
I successfully implemented
http://elm-chan.org/fsw/ff/00index_e.html
system onhttp://www.st.com/mcu/modules.php?name=mcu&file=devicedocsmdt&FAM=110&DEV=STM3210E-EVAL
on SD card connected through the SDIO port (not SPI). The whole project is attached. I am using KEIL uVision and ULINK2 debugger. The original DEMO code from STM3210E-EVAL board was used, just the sd_FAT(); is called from sd_FAT.c before the menu is started. In this routine the file ''srcfile_aaaaa_bbb.dat'' is opened from SDcard and copied to the file ''dstfile.dat''. The source file is copied in 512 bytes block in RAM and written to the destination file in a cycle, until the whole file is copied. The FatFS is ported in diskio.c, reading and writing in supported, the f_mkfs for making file system was not implemented yet (was not required yet, the SD card is much easily formated in any PC). In sd_FAT.c are commented the routines for speed tests for reading and writing. I obtained these results: 1) 128 MB micro SD card that was included with eval board: Read 1MB file - 830kB/s Write 1MB file - 133kB/s 2) 4GB micro SDHC card from my mobile phone: Read 1MB file - 1MB/s Write 1MB file - 325kB/s The speeds here are a bit better that I obtained by reading/writing files through the MassStorage USB mode. The Stack size was resized from 0x000000400 (that is used in original DEMO code) to the 0x00004000 in startup_stm32f10x_hd.s. Otherwise the HardFault error occur. The memory usage can be seen in /List/BOOT_FLASH.map (at the end of file). Hope it will help to someone. Afi2011-05-17 03:55 AM
Sometimes its easier to use less pin numbers of uC. Not everytime you need to achive high speed transfers.
2011-05-17 03:55 AM
Hey Relaxe, could you please attach the files of your Project? This would be very nice!! I cant find your attached file :\
2011-05-17 03:55 AM
Hi. I would also like to see the source code.
Thanks in advance. Soenke