This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Diff between File system and FAT file system

Hi to all, i started to work on FAT file system on SD 1GB card. LPC2388 on MCB2300 board.

Just now i have completed my binary search on File system on SD card. Simply fopen, fread, fseek,etc.

Now i have to work on SD card using FAT file system. i went through so many web pages that didnt answer my question or i was not able to understand.

how to make a File allocating table on my SD Card? Some simple example can give me a good start...

my question is Whats the difference between Normal File system (which i have done on my SD card) and FAT File system?

And I had formatted the SD card on LAPTOP with the 2 options of FAT(Default) and FAT32.
When i tried to use the card after i did format using FAT(Default) option, i was able to work with my code which i developed for SD card using normal File system.

But if format using FAT32 option, then while trying to initialize the card it says SD card un formatted.

So what its trying to say?

So by default my controller accept FAT12?

Can i use FAT32 on the same SD card for my same code in which i didnt give an option to recognize FAT32?

As i studied from the web source for FAT16, the clusters address divide my SD card in to sectors and gives back the location address to me(2^16 address)?

So on for FAT32?

So please give me some clear explanation how to start? And i gone through Wikipedia and all the sources so dont give me the link for wikipedia pls.

Parents
  • Hi to all:(

    Still i am not able to get any success on anything even i tried so many options(changing in the code).

    But the same results or not good results.

    Still i am working on this because i believe i can get some help from you peoples.

    All commends i tried but no results. I followed the flow of cmds. But same results.

    from the elm-chan.org/.../dwrite.html

    DRESULT disk_write ( BYTE Drive, /* Physical drive number */ const BYTE* Buffer, /* Pointer to the write data (may be non aligned) */ DWORD SectorNumber, /* Sector number to write */ BYTE SectorCount /* Number of sectors to write */
    );

    Here what is SectorNumber. What value i should give here?

    From the page www.sdcard.org/.../Simplified_Physical_Layer_Spec.pdf
    page no 89 gives me the details of received CSD values.
    But with my result of CSD doesn't match with that table.

    MCI_Send_CSD result: 002f0032 5f5983bd edb7ff9f 964000a8

    From this value how can i get my Sector address where i can f_write and f_read?

    The 0th bit of CSD is reserved int the doc that should be 1. but in my result Which one is that reserved bit? Please reply for my all questions. If you leave any then i ill be blank always.

    simply here i am trying to write a sector with some value.

        FATFS fs;   // Work area (file system object) for logical drive
        BYTE buffer[4096];   // file copy buffer
    
            disk_initialize(0);
    
            i = disk_status(0);
            xprintf("\r\nDisk status is :%d", i);
    
            for(i = 0; i < 10; i++)
            buffer[i] = i;
    
            i = disk_write(0, (const BYTE *)&buffer, 0xD2, 56);
            xprintf("\r\nWrite status is :%d", i);
    

    This one gives the result
    MCI_INIT ok
    no timeout on CMD8 -> SD-Card>=Version 2.0
    ACMD41 success -> SD-Card SC or HC
    SDSC detected
    MCI_Send_CSD result: 002f0032 5f5983bd edb7ff9f 964000a8
    setting 4bit width success

    Disk status is :0

    Write status is :0

    Should i give BLOCK_LEN before i read or write the Block?

    The Basic thing still i dont know is after formatting the card how to read the clusters and sectors with without file system?

    Please really i tried a lot. I need some point out from you to make it....

    From when i started i am trying so many things but no progress. hard luck...

Reply
  • Hi to all:(

    Still i am not able to get any success on anything even i tried so many options(changing in the code).

    But the same results or not good results.

    Still i am working on this because i believe i can get some help from you peoples.

    All commends i tried but no results. I followed the flow of cmds. But same results.

    from the elm-chan.org/.../dwrite.html

    DRESULT disk_write ( BYTE Drive, /* Physical drive number */ const BYTE* Buffer, /* Pointer to the write data (may be non aligned) */ DWORD SectorNumber, /* Sector number to write */ BYTE SectorCount /* Number of sectors to write */
    );

    Here what is SectorNumber. What value i should give here?

    From the page www.sdcard.org/.../Simplified_Physical_Layer_Spec.pdf
    page no 89 gives me the details of received CSD values.
    But with my result of CSD doesn't match with that table.

    MCI_Send_CSD result: 002f0032 5f5983bd edb7ff9f 964000a8

    From this value how can i get my Sector address where i can f_write and f_read?

    The 0th bit of CSD is reserved int the doc that should be 1. but in my result Which one is that reserved bit? Please reply for my all questions. If you leave any then i ill be blank always.

    simply here i am trying to write a sector with some value.

        FATFS fs;   // Work area (file system object) for logical drive
        BYTE buffer[4096];   // file copy buffer
    
            disk_initialize(0);
    
            i = disk_status(0);
            xprintf("\r\nDisk status is :%d", i);
    
            for(i = 0; i < 10; i++)
            buffer[i] = i;
    
            i = disk_write(0, (const BYTE *)&buffer, 0xD2, 56);
            xprintf("\r\nWrite status is :%d", i);
    

    This one gives the result
    MCI_INIT ok
    no timeout on CMD8 -> SD-Card>=Version 2.0
    ACMD41 success -> SD-Card SC or HC
    SDSC detected
    MCI_Send_CSD result: 002f0032 5f5983bd edb7ff9f 964000a8
    setting 4bit width success

    Disk status is :0

    Write status is :0

    Should i give BLOCK_LEN before i read or write the Block?

    The Basic thing still i dont know is after formatting the card how to read the clusters and sectors with without file system?

    Please really i tried a lot. I need some point out from you to make it....

    From when i started i am trying so many things but no progress. hard luck...

Children