eclipse-threadx/filex

FileX cluster size problem and log fault tolerance

aod-ad opened this issue · 6 comments

Hello, Have a few questions?

  1. When fileX uses fat32 mode, why can't the size of a cluster exceed 4096?
    ...
    if((bytes_per_sector == 0) || (bytes_per_sector > 4096))
    return(FX_SECTOR_INVALID);
    ...
  2. Can the function of usbX be used after log fault tolerance is turned on?
    thank you

Hi, could you point out the filename and lines for that piece of code?
Yes. Fault tolerant is supported when media is open by USBX. But it is user application's responsibility to call fx_fault_tolerant_enable().

At line 139 of fx_media_format.
thank you.

From the FAT or exFAT spec, the maximum value of sector size is 4096. Did you encounter any issues?

When I format the SD card on Windows 10, I found that when the SD card is FAT32, the cluster size can be formatted as 512, 1024, 2048, 4096, 8096, or 16KB, so I feel this question.

That check targets to sector size. But the values you listed above is cluster size.

Sorry, my question is understood now.
The cluster can be composed of multiple sectors, and each sector cannot exceed the size of 4096.
Originally, my application planned to use 8096 bytes per page as the management unit of nand flash, so that memory consumption can be reduced when searching quickly. It seems that nand flash can only use a maximum of 4096 bytes as a unit.