I was wondering if anyone has come up with a solution to allow the Giga to use exFAT formatted USB drives instead of only FAT32 and similar?
Looking at the mbed_config.h file, it says:
#define MBED_CONF_FAT_CHAN_FF_FS_EXFAT 0 // set by library:fat_chan
Which suggests that it might be possible to use exFAT, but that it's turned off. This is also an automatically generated configuration file and any edits will be overwritten, so I can't just change the 0 to a 1 and have it work.
Looking in FATFileSystem.h, it also says:
* @param allocation_unit
* This is the number of bytes per cluster size. The valid value is N
* times the sector size. N is a power of 2, from 1 to 128, for the FAT
* volume, and up to 16MiB for the exFAT volume. If zero is given,
* the default allocation unit size is selected by the underlying
* file system, which depends on the volume size.
Which further suggests that exFAT can be used.
In ffconf.h, it also says:
/ To enable the LFN, ffunicode.c needs to be added to the project. The LFN function
/ requiers certain internal working buffer occupies (FF_MAX_LFN + 1) * 2 bytes and
/ additional (FF_MAX_LFN + 44) / 15 * 32 bytes when exFAT is enabled.
/ The FF_MAX_LFN defines size of the working buffer in UTF-16 code unit and it can
/ be in range of 12 to 255. It is recommended to be set it 255 to fully support LFN
/ specification.
#define FF_LBA64 0
/* This option switches support for 64-bit LBA. (0:Disable or 1:Enable)
/ To enable the 64-bit LBA, also exFAT needs to be enabled. (FF_FS_EXFAT == 1) */
#define FF_FS_EXFAT MBED_CONF_FAT_CHAN_FF_FS_EXFAT
/* This option switches support for exFAT filesystem. (0:Disable or 1:Enable)
/ To enable exFAT, also LFN needs to be enabled. (FF_USE_LFN >= 1)
/ Note that enabling exFAT discards ANSI C (C89) compatibility. */
And in ff.h, it has multiple references to exFAT.
So I am thinking that it might be possible to modify the Giga's code to run exFAT. Has anyone tried this and found a solution? Or is it not allowed/accessible for some reason? Because it's really annoying that I can't use exFAT when it's getting harder and harder to find USB drives that aren't formatted in exFAT because of files size. And while yes, you can use third-party software to format larger USB drives to used FAT32 instead of exFAT, it would be nice just to be able to plug any USB in and have it work.
One option that was suggested was to regenerate libmbed.a using Linux commands after adding "fat_chan.ff_fs_exfat": 1, as a line in mbed_app.json, but I haven't tried this yet.
(All of these files are found in C:\Users\(your profile)\AppData\Local\Arduino15\packages\arduino\hardware\mbed_giga\4.6.0\variants\GIGA.)