OK, I ran the attached big_file_test.c with a file size of 0xC000 0000 (3 GB). It took 12+ hours, but no errors were found.
FreeRTOS+FAT+CLI is a little confused on the the file size (file big3):
> dir
System Volume Information [directory] [size=0]
SpeedNTemp.csv [writable file] [size=18299045]
Vibration.csv [writable file] [size=334784288]
.~lock.SpeedNTemp.csv# [writable file] [size=87]
big1 [writable file] [size=1000000]
big3 [writable file] [size=-1073741824]
.. [directory] [size=1024]
. [directory] [size=1024]
Windows is a little happier:
C:\Users\carlk>dir g:
Volume in drive G is THE 128GB
Volume Serial Number is 1315-2346
Directory of G:\
The parameter is incorrect.
ā 18,299,045 SpeedNTemp.csv
The parameter is incorrect.
ā
334,784,288 Vibration.csv
The parameter is incorrect.
ā 1,000,000 big1
The parameter is incorrect.
ā 3,221,225,472 big3
4 File(s) 3,575,308,805 bytes
0 Dir(s) 124,241,870,848 bytes free
C:\Users\carlk>chkdsk g:
The type of the file system is FAT32.
Volume THE 128GB created 3/16/2020 11:49 AM
Volume Serial Number is 1315-2346
Windows is verifying files and folders...
File and folder verification is complete.
Windows has scanned the file system and found no problems.
No further action is required.
124,821,728 KB total disk space.
64 KB in 2 hidden files.
64 KB in 2 folders.
3,491,616 KB in 6 files.
121,329,952 KB are available.
32,768 bytes in each allocation unit.
3,900,679 total allocation units on disk.
3,791,561 allocation units available on disk.
I don’t think it likes the lack of timestamps on the files. Something I need to work on.
Looking at it in Ubuntu on Windows Subsystem for Linux (WSL):
carlk@Dell:~$ sudo mkdir /mnt/g
carlk@Dell:~$ sudo mount -t drvfs G: /mnt/g
carlk@Dell:~$ ls -l /mnt/g
total 3491552
-rwxrwxrwx 1 root root 18299045 Dec 31 1969 SpeedNTemp.csv
drwxrwxrwx 1 root root 512 Mar 16 11:49 'System Volume Information'
-rwxrwxrwx 1 root root 334784288 Dec 31 1969 Vibration.csv
-rwxrwxrwx 1 root root 1000000 Dec 31 1969 big1
-rwxrwxrwx 1 root root 3221225472 Dec 31 1969 big3
carlk@Dell:~$
I’m not sure how to run dosfsck in this environment.
carlk@Dell:~$ mount
rootfs on / type lxfs (rw,noatime)
none on /dev type tmpfs (rw,noatime,mode=755)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
devpts on /dev/pts type devpts (rw,nosuid,noexec,noatime,gid=5,mode=620)
none on /run type tmpfs (rw,nosuid,noexec,noatime,mode=755)
none on /run/lock type tmpfs (rw,nosuid,nodev,noexec,noatime)
none on /run/shm type tmpfs (rw,nosuid,nodev,noatime)
none on /run/user type tmpfs (rw,nosuid,nodev,noexec,noatime,mode=755)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
cgroup on /sys/fs/cgroup type tmpfs (rw,relatime,mode=755)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,relatime,devices)
C:\ on /mnt/c type drvfs (rw,noatime,uid=1000,gid=1000,case=off)
G: on /mnt/g type drvfs (rw,relatime,case=off)
carlk@Dell:~$ dosfsck /mnt/g
fsck.fat 4.1 (2017-01-24)
open: Is a directory
carlk@Dell:~$ dosfsck G:
fsck.fat 4.1 (2017-01-24)
open: No such file or directory
Next, I will make some copies of this 3 GB file to get near the 32 GB boundary and run some more tests.
big_file_test.c (2.7 KB)