We are using RL-USB and RL-FlashFS and ffree function to check the space availabe on the USB drive. With one 4GB drive with free space of 3.37GB, it reports proper free space ie. 0x0d7fad000 But for another 4GB USB Drive with free space of 767MB, it is reporting free space as 0x12000. We have checked the drive with chkdsk command on windows and there are no errors reported. We would like to know what could be the reason of incorrect free space returned by ffree function.
Do you know what is different with the USB drive which is not working? Is it formatted with a different block size. Can you duplicate this problem with another USB drive when you copy the same files over? If the problem can be duplicated, you could send a description how to duplicate it in a support case (see www2.keil.com/.../silver). If this can only be duplicated with one USB drive, an image of it could help us to see this issue.
If we copy the same files over to other USB drive, the problem is not duplicated. But if we create image of the drive and write to another USB drive, the problem is repeated. How shall we share the image of the drive?
Is the disk you take an image from a low cost one, as they sometimes have fake size and real capacity is less then reported?
The size of this image file will most likely be bigger than what is allowed to attach to a support case. Maybe you can provide this image on one of your server or on Dropbox for download. Unfortunately we don't have an upload area for huge files. It would be good if you could reduce the size of this image as much as possible by deleting files from the USB drive. Of course the problem must still exist.
Note that the image will not become smaller because files are erased.
To shrink the storage requirements, i.e. to allow the image to compress well, the file data and the free space should be filled with constant data. Then a standard file compress program can be used.
The easiest way to normalize the binary patterns of the free space is to create a file as large as possible with constant data. Then erase that file.
Disc is not a low cost one. It is SanDisk USB Drive.
What exactly model of Sandisk USB drive is it? If you reformat the Sandisk in Windows does it again shoe on embedded device incorrect free size?
It is SanDisk Cruzer Micro 4.0GB.
We have deleted number of folders on the Drive and now the free space on the drive is 3.38GB. Each time after deleting few folders, when we checked free space, ffree always returned 0x12000. Earlier with 767 MB free space and now with 3.38GB free space,return value of ffree doesn't change.
Zip up the image file, and post it to a hosting site of your choice, Drop Box, Google Drive, whatever, not a complicated thing to do.
This will save all guessing about the state of the file system, and why it's reporting the way it is. Reformatting might make the problem change, but the point would be to understand WHY it's failing now, whether it's an issue with the software, or structures on the media.
Make sure there isn't any loss of precision moving from 64 or 32-bits, or in math done with the numbers.