You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use the GPT partition tool to partition the disk and format the file system with exFAT. Use Filex (no system mode) on the zynq xc7z045(ARM Cortex-A9 32bit) development board. An error is always reported. Such as a function _fx_utility_logical_sector_read:
Has anyone patched it.
The text was updated successfully, but these errors were encountered:
This does appear to be a bug due to an overflow, as ULONG max is 4294967295, which would correspond to 21990023255040 bytes if there was a 512-byte sector size. I am not sure why fx_media_total_sectors (a ULONG64) is cast to ULONG, as there is no comment explaining it; perhaps this was done to speed up the comparison. I suspect this was a simple mistake, as fx_media_total_sectors is cast to ULONG64 in a number of other places, and is not cast at all when the exact same comparison is made in fx_utility_sector_write (lines 318 & 388).
The simplest solution (and the one I believe to be best) for this would be to simply eliminate the cast. Another solution (to allow for large drives without unnecessarily compromising performance for smaller media) would be to allow a ULONG64 comparison when exFAT is enabled:
`#ifdef FX_ENABLE_EXFAT
if ((logical_sector + sectors - 1) > media_ptr -> fx_media_total_sectors)
#else
if ((logical_sector + sectors - 1) > (ULONG)media_ptr -> fx_media_total_sectors)
#endif`
A workaround would be to increase sector size, and the exFAT max of 4096 bytes/sector would result in a 17592186040320 byte limit. The issue with this is that it limits you to what are basically FAT32 partitions.
I use the GPT partition tool to partition the disk and format the file system with exFAT. Use Filex (no system mode) on the zynq xc7z045(ARM Cortex-A9 32bit) development board. An error is always reported. Such as a function _fx_utility_logical_sector_read:
Has anyone patched it.
The text was updated successfully, but these errors were encountered: