An experiment update...
I have mentioned in past that there are issues with the Index file setup, if for example the first FS added is for SD and there is no SD file or it is Read only or...
You do have the option of creating a RAM disk and add that first, but that is sort of messy if you really don't want a ramdisk to show up...
So wondered about creating a Memory Filesystem, sort of like my BogusFS and sort of like Frank's Memory file stuff, although different as, weill I allocate the
buffer or reallocate if if needed...
I put the code up in a new branch to play with:
https://github.com/KurtE/MTP_Teensy/tree/Index_file_memory_fs
And I currently enable this by: MTP.useFileSystemIndexFileStore(MTPStorage::INDEX_STORE_MEM_FILE);
Which is in the SD_MTP_debug.ino sketch which I also pushed up...
This is the one that was using to debug the 490+ file issue...
There are still debug messages and the like I need to fix and remove.
Also may play with. If we fail to open the Initial index on the default Storage (first FS added), then have it fallback to this code...
I left in the code that shows when it malloc or realloc... For T4.x it uses the extended malloc code to allow it to go to PSRAM by default...
Ran it with the 490+ file case.
Code:
cannot open Index file
$$$ Failed to seek for write Index record: 0 addr:0 Cur: 0
$$0x2020f390 = malloc(2048)
$$0x2020f390 = realloc(0x2020f390, 4096)
$$0x2020f390 = realloc(0x2020f390, 6144)
$$0x2020f390 = realloc(0x2020f390, 8192)
$$0x2020f390 = realloc(0x2020f390, 10240)
$$0x2020f390 = realloc(0x2020f390, 12288)
$$0x2020f390 = realloc(0x2020f390, 14336)
$$0x2020f390 = realloc(0x2020f390, 16384)
$$0x2020f390 = realloc(0x2020f390, 18432)
Dump Storage list(1)
store:0 storage:10001 name:SD Card fs:20000ed8
Dump Index List
0: 0 1 1 65535 0 530 0 0 /
16: 0 0 0 0 0 48 1655278820 1655278820 Mrt_ 1.txt
17: 0 0 0 0 16 48 1655278820 1655278820 Mrt_ 2.txt
18: 0 0 0 0 17 48 1655278820 1655278820 Mrt_ 3.txt
19: 0 0 0 0 18 48 1655278820 1655278820 Mrt_ 4.txt
20: 0 0 0 0 19 48 1655278820 1655278820 Mrt_ 5.txt
21: 0 0 0 0 20 48 1655278820 1655278820 Mrt_ 6.txt
22: 0 0 0 0 21 48 1655278820 1655278820 Mrt_ 7.txt
23: 0 0 0 0 22 48 1655278820 1655278820 Mrt_ 8.txt
24: 0 0 0 0 23 48 1655278820 1655278820 Mrt_ 9.txt
25: 0 0 0 0 24 48 1655278820 1655278820 Mrt_ 10.txt
26: 0 0 0 0 25 48 1655278820 1655278820 Mrt_ 11.txt
27: 0 0 0 0 26 48 1655278820 1655278820 Mrt_ 12.txt
28: 0 0 0 0 27 48 1655278820 1655278820 Mrt_ 13.txt
29: 0 0 0 0 28 48 1655278820 1655278820 Mrt_ 14.txt
30: 0 0 0 0 29 48 1655278820 1655278820 Mrt_ 15.txt
31: 0 0 0 0 30 48 1655278820 1655278820 Mrt_ 16.txt
32: 0 0 0 0 31 48 1655278820 1655278820 Mrt_ 17.txt
33: 0 0 0 0 32 48 1655278820 1655278820 Mrt_ 18.txt
34: 0 0 0 0 33 48 1655278820 1655278820 Mrt_ 19.txt
35: 0 0 0 0 34 48 1655278820 1655278820 Mrt_ 20.txt
36: 0 0 0 0 35 48 1655278820 1655278820 Mrt_ 21.txt
37: 0 0 0 0 36 48 1655278820 1655278820 Mrt_ 22.txt
38: 0 0 0 0 37 48 1655278820 1655278820 Mrt_ 23.txt
39: 0 0 0 0 38 48 1655278820 1655278820 Mrt_ 24.txt
40: 0 0 0 0 39 48 1655278820 1655278820 Mrt_ 25.txt
41: 0 0 0 0 40 48 1655278820 1655278820 Mrt_ 26.txt
42: 0 0 0 0 41 48 1655278820 1655278820 Mrt_ 27.txt
43: 0 0 0 0 42 48 1655278820 1655278820 Mrt_ 28.txt
44: 0 0 0 0 43 48 1655278820 1655278820 Mrt_ 29.txt
45: 0 0 0 0 44 48 1655278820 1655278820 Mrt_ 30.txt
46: 0 0 0 0 45 48 1655278820 1655278820 Mrt_ 31.txt
47: 0 0 0 0 46 48 1655278820 1655278820 Mrt_ 32.txt
48: 0 0 0 0 47 48 1655278820 1655278820 Mrt_ 33.txt
49: 0 0 0 0 48 48 1655278820 1655278820 Mrt_ 34.txt
50: 0 0 0 0 49 48 1655278820 1655278820 Mrt_ 35.txt
51: 0 0 0 0 50 48 1655278820 1655278820 Mrt_ 36.txt
52: 0 0 0 0 51 48 1655278820 1655278820 Mrt_ 37.txt
53: 0 0 0 0 52 48 1655278820 1655278820 Mrt_ 38.txt
54: 0 0 0 0 53 48 1655278820 1655278820 Mrt_ 39.txt
55: 0 0 0 0 54 48 1655278820 1655278820 Mrt_ 40.txt
56: 0 0 0 0 55 48 1655278820 1655278820 Mrt_ 41.txt
57: 0 0 0 0 56 48 1655278820 1655278820 Mrt_ 42.txt
58: 0 0 0 0 57 48 1655278820 1655278820 Mrt_ 43.txt
59: 0 0 0 0 58 48 1655278820 1655278820 Mrt_ 44.txt
60: 0 0 0 0 59 48 1655278820 1655278820 Mrt_ 45.txt
61: 0 0 0 0 60 48 1655278820 1655278820 Mrt_ 46.txt
62: 0 0 0 0 61 48 1655278820 1655278820 Mrt_ 47.txt
63: 0 0 0 0 62 48 1655278820 1655278820 Mrt_ 48.txt
64: 0 0 0 0 63 48 1655278820 1655278820 Mrt_ 49.txt
65: 0 0 0 0 64 48 1655278820 1655278820 Mrt_ 50.txt
66: 0 0 0 0 65 48 1655278820 1655278820 Mrt_ 51.txt
67: 0 0 0 0 66 48 1655278820 1655278820 Mrt_ 52.txt
68: 0 0 0 0 67 48 1655278820 1655278820 Mrt_ 53.txt
69: 0 0 0 0 68 48 1655278820 1655278820 Mrt_ 54.txt
70: 0 0 0 0 69 48 1655278820 1655278820 Mrt_ 55.txt
71: 0 0 0 0 70 48 1655278820 1655278820 Mrt_ 56.txt
72: 0 0 0 0 71 48 1655278820 1655278820 Mrt_ 57.txt
73: 0 0 0 0 72 48 1655278820 1655278820 Mrt_ 58.txt
74: 0 0 0 0 73 48 1655278820 1655278820 Mrt_ 59.txt
75: 0 0 0 0 74 48 1655278820 1655278820 Mrt_ 60.txt
76: 0 0 0 0 75 48 1655278820 1655278820 Mrt_ 61.txt
< Skiped 77 - 79 >
80: 0 0 0 0 76 48 1655278820 1655278820 Mrt_ 62.txt
81: 0 0 0 0 80 48 1655278820 1655278820 Mrt_ 63.txt
82: 0 0 0 0 81 48 1655278820 1655278820 Mrt_ 64.txt
83: 0 0 0 0 82 48 1655278820 1655278820 Mrt_ 65.txt
...
517: 0 0 0 0 516 48 1655278822 1655278822 Mrt_481.txt
518: 0 0 0 0 517 48 1655278822 1655278822 Mrt_482.txt
519: 0 0 0 0 518 48 1655278822 1655278822 Mrt_483.txt
520: 0 0 0 0 519 48 1655278822 1655278822 Mrt_484.txt
521: 0 0 0 0 520 48 1655278822 1655278822 Mrt_485.txt
522: 0 0 0 0 521 48 1655278822 1655278822 Mrt_486.txt
523: 0 0 0 0 522 48 1655278822 1655278822 Mrt_487.txt
524: 0 0 0 0 523 48 1655278822 1655278822 Mrt_488.txt
< Skiped 525 - 527 >
528: 0 0 0 0 524 48 1655278822 1655278822 Mrt_489.txt
529: 0 0 0 0 528 48 1655278822 1655278822 Mrt_490.txt
530: 0 0 0 0 529 0 1655449988 0 mtpindex.dat
So the file was only about 18K...
Now back to playing