Hi Igor I don't have any information about error recovery of MMC cards. I think floppy discs have the same problem; if the user doesnot wait for write completion, the disc may become corrupted. =20 Perhaps one way to deal with this might be to use the fact that MMC cards have 2 or more FATs. MMC cards also have entire 512 byte sectors written at once. Here is a possible idea... 1. Before you write out a sector of data, first update FAT #2. 2. After writing a sector of data successfully, update FAT #1. 3. In your PC software, compare FAT #1&2. If they are the same, the write was successful. If they are different, then the data is good up to but not including the last sector. I think when MSDOS (Windows, etc.) reads the card, it will read from FAT #1 (I'm guessing here). If the write to the data sector was interrupted (card pulled out, etc.) the FAT #1 will still show good data up to the corrupted sector. (Unless the card was pulled out while writing to the FAT) I don't think there is *anything* you can do about losing data to a sector if the user yanks the card out before it's done writing. The only way to handle this would be to write your own complete card access routines. Or have a mechanical lockout to prevent removal of the card if the write is in progress....??? Good luck! Tom At 01:38 AM 6/27/2004 +0200, you wrote: >Hi friends,=20 > >I develop a datalogger with a MMC card for our special purpose. There is >implemented FAT syst=E9m (not fully, but most of it). I am not able to >solve one problem. When writing operation to root directory is broken >before finishing and it can hap anytime pulling a card out, I am not >able to find a way how to repair the defected sector. Rewriting such >sector from a PIC ends with endless loop of busy signal. I am not able >to format the card in a PDA because Windows CE doesn't accept by this >way damaged card. =20 >I wasn't able to find any appnotes discussed error recovery of MMC cards >as well as a detailed instructions how to erase a sector or block of >sectors.=20 >Use SPI mode for communication to MMC/SD card.=20 >I appreciate any help.=20 > >Thanks=20 > >Igor=20 -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics