STM32U5A5: Azure FileX FAT12 with more than 4096 byte (or 4096 cluster of 512 byte)
I have written quite a bit of code to familiarize myself better with Azure FileX with 192K sram, and so far, it is working well under ThreadX. The Azure FileX documentation made clear that FAT12 has a maximum number of bytes of 4096 per filename which is confirmed via code inspection within FileX. I struggle to find logic to report errors if exceeded the filename size.
Below is the response of the test code where a command invokes file write each 512-byte data (sector) with UDT1970 timestamp and DWT in uSec string embedded on the test pattern (see below). Using the same filename, I repeat the write roughly every 1 second until I achieve 5120 bytes and then inspect the timestamp string as shown below. I found there was no error for exceeding 4096 bytes, and the DateTime looks consistent after 4096 bytes, i.e. it does not loop back to start after 4096 bytes.
I found a reference to another source where FAT12 supports filename with 4096 clusters, not byte. So, I am a tad confused there. (See FAT12 in https://www.wikiwand.com/en/File_Allocation_Table)
Comment?
#BTN-1:FXWRITE(1;0s/Tiscy/Data1.hex)
---INFO: eWRITEDATA
Filename Path /Tiscy/Data1.hex:
Writing Data to file: 512 (byte)
File Size: 5120 (byte)
#BTN-3:FXREAD(2;0s/Tiscy/Data1.hex)
---INFO: eREADDATA
File Size: 5120 (byte)
Filename Path /Tiscy/Data1.hex:
UDT1970:0x659983F6 Note:1st sector
DWT:0x003B7953
UDT1970:0x659983F7
DWT:0x0047B8D4
UDT1970:0x659983F8
DWT:0x0051FEA2
UDT1970:0x659983F8 Note:4th sector 2048 byte written
DWT:0x005C4E98
UDT1970:0x65998419
DWT:0x00BA2933
UDT1970:0x6599841B
DWT:0x00D1ABBA
UDT1970:0x6599841C
DWT:0x00DD525C
UDT1970:0x6599841C Note:8th sector 4096 byte written
DWT:0x00E74D9C
UDT1970:0x6599841D
DWT:0x00F46B3D
UDT1970:0x6599841E
DWT:0x010414A6
Total Byte transferred: 5120
#BTN-2:FXREAD(1;0s/Tiscy/Data1.hex)
---INFO: eREADDATA
File Size: 5120 (byte)
Filename Path /Tiscy/Data1.hex:
00000000: 55 44 54 31 39 37 30 3A 30 78 36 35 39 39 38 33 | UDT1970:0x659983
00000010: 46 36 0A 44 57 54 3A 30 78 30 30 33 42 37 39 35 | F6.DWT:0x003B795
00000020: 33 0A 00 EE 11 55 33 EE 11 55 33 EE 11 55 33 EE | 3....U3..U3..U3.
00000030: 11 55 33 EE 11 55 33 EE 11 55 33 EE 11 55 33 EE | .U3..U3..U3..U3.
00000040: 11 55 33 EE 11 55 33 EE 11 55 33 EE 11 55 33 EE | .U3..U3..U3..U3.
