I've been able to create, mount a FatFs file system. I've also been able to f_open() a new file for writing, store some bytes, close the files, and then later open f_open() for reading, and get back the expected data. Given that, I have some confidence my interface to the SD Card is working correctly, and that the FatFs library is in general working.
What I'm not sure is after power cycling, how am I supposed to re-initialize and re associated my FatFs instance(s) with what is on the SD Card already, without wiping the data out on the card? I've tried just calling f_mount() and or disk_initialize, but that doesn't access the physical drive by itself. Calling f_mount() followed by f_mkfs() doesn't return errors, but the files I saved previously can't be found. and my program get stuck.
so my question is : what is the procedure for setting up the file system the very first time on the SD Card, and then what is the procedure to regain access to that file system after a power cycle. Are there any special API calls needed when first initializing to tell the library a FatFs file system should already be present? What API calls can I use to know that?
and is there any procedure that i have to do, before i can remove the mmc safely? i tried f_mount(0,null) and/or re-disk_initialize after i put back mmc and what happened is FatFs got stuck, but timer interrupt for disk_timerproc still running.
Thanks, any information helps!