2012-02-08 04:06 PM
Hi Chaps,
Going slowly mad trying to get Chan Fat working with the sdio libs on a stm32f4.I'm using the most recent (1.0.0) library for the F4, and the low level access demo within that library builds and (at least appears to ) work OK. I've spent many, many hours attempting to patch in 0.9 version of fatfs from chan (thks chan, you're a hero) - but I can't get it to work.If possible, I'd really really appreciate a demo project/source (or direction to - though I've scoured the web and can't find anything that works!)I'll post separately about the current problems I'm having with the my current build, but a working example would sort it.Many thanks,nat. #hse-sdio-stm32 #stm32-fat-chanfat-fatfs-sdio #sdcard-stm32f4-sdio-fatfs #sdcard-stm32f4-sdio-fatfs2012-10-22 07:41 AM
Sorry to butt in, Clive1 have you got any other stm32f4discovery projects available we could have a look at? id love to have a play with some of them :)
It's not my platform of choice, but I have ported the USB MSC and VCP examples, as well as FreeRTOS. There are a bunch of USART and servo/pwm examples I've posted here.2012-10-24 12:03 AM
@Clive
I have run your project. f_mount is returning 0 ( FR_OK) f_open is returning 1 (FR_DISK_ERROR) I debugged f_open() function and i have analyzed that in f_open() the call to check_mounted() function is returning 1 (FR_DISK_ERROR) Inside check_mounted() function vol is assigned 0 and then it skips the part under the comment //Check if the file system object is valid or not. Then the control goes to the part written under the comment //the following code attempts to mount the volume In this section disk_initialize() function is called and this function is returning 0(disk initialized successfully) After disk_initialization() function disk_ioctl() function is returning 1 (FR_DISK_ERROR).2012-10-24 01:51 AM
disk_ioctl() function isn't returning any value.I checked the return value on UART but it is not displaying any value.
2012-10-24 08:12 AM
disk_ioctl() returns RES_OK
You might want to confirm you can do the sector reads (via disk_read(), or equivalent), and verify you can read from the card. If that doesn't work independently, then FatFs will have bigger issues.2012-10-24 10:32 PM
Ok i will get back to you after verifying disk_read() function........i checked f_unlink() function too but it isn't working.....I had been banging my head to figure out the problem since last week :(
2012-10-24 11:18 PM
disk_read() function is also returning 1 (not OK) ...... Can you give me code for direct disk_read() call?
2012-10-25 08:38 AM
unsigned char Buffer[512];
disk_read(0, Buffer, 0, 1);2012-10-31 03:18 AM
@Clive
disk_read() is now functional i have made certain changes in the code and made it working...I have used SD_ReadSingleBlock() to check if this function can read sectors or not Now tell me the next step? I want to know the steps that are being followed while implementing FATFS as i don't know the A B C of FATFS....I really want to make my concepts clear as to how this library works and what are the steps that we must follow to implement this file system.2012-10-31 03:22 AM
My ultimate goal is to store an image on SD Card....i would really appreciate if you give me some guideline on this as well
2012-10-31 07:26 AM
I'm not sure I want to be dragged into your project/work this deep, I think you can read the FatFs documentation/website and source as easily as I can. If you need to understand how it works you'll need to study it.