2012-01-09 01:38 AM
Hi,
I've a problem with my STM32. I need to use fat filesystem on SD card to read/write/create files. I tried to use Chan FatFs module but it didn't working at all ... I use SD card in SDIO and 4 wires mode. When I debug, check_fs() function can't retrieve 0x55 0xAA on boot sector, but, when I read sector n�0 in the main(), I can correctly read all datas on boot sector. If someone can help me with this problem ... Thanks. #sdio-fatfs #sdio-chan-fatfs2012-01-09 02:05 AM
check if the attached file will be helpful.
________________ Attachments : stm32_eval_sdio_sd.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0pk&d=%2Fa%2F0X0000000beA%2FdE4fzbGU3PXI8Oh9Cs2nP2JVq7LMsw.rSrvVVsIY4gk&asPdf=false2012-01-09 02:25 AM
Thank you for your fast answer.
I tried with this file but the problem is the same ... In check_fs() function, after if (disk_read(fs->drv, fs->win, sect, 1) != RES_OK) /* Load boot record */ , I check values into fs->win, and they didn't match with correct values ... But, if I call disk_read() with same parameters in the main(), I have correts datas into buffer ... I hope it can help you to find what's wrong .2012-01-09 02:57 AM
Can you try with some other micro SD card. Just to confirm the problem.
2012-01-09 03:08 AM
I already tried with 1GB micro SD card (
provided
with developpement board) and with a 2GB and I have the same results ...2012-01-09 05:40 AM
I tried low level functions such as SD_ReadBlock() and higher level functions like disk_read() (which call SD_ReadBlock() ) and all of them are OK.
But, when check_fs() use disk_read(), the buffer is complete correctly in disk_read(), and when I go back into check_fs(), buffer had change by himself ...2012-01-09 12:29 PM
2012-01-09 11:28 PM
I hope the attached files will be helpful:
________________ Attachments : diskio.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0pf&d=%2Fa%2F0X0000000be8%2F6NDHji2RvQGUonc_TEMPBthC4_DfygeJaH1a1Q14UqQ&asPdf=falsestm32f2xx_it.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0oT&d=%2Fa%2F0X0000000be9%2FhdTGsA.bEoVlydV2ttn6WnadsPr0uZ0FubhWFYoJnq8&asPdf=false2012-01-10 12:24 AM
Hi mikael,
If you have some informations about this problem with FatFs, I will happy to get them if you can post here of if you want to mail me. Thanks2012-01-10 02:26 AM
Hi AMSN,
I tried with your files and I've got the same problem ... I don't know why, but when I read boot sector in main(), I've no problem and I can read datas like 0x55AA at offset 510, but, when I want read sector boot in check_fs() function, buffer which should contains boot sector contains values with no sense ...