KurtE
Senior Member+
Alright guy's. Will hang tough
Thanks.
I hear you, but we are slowly getting the pieces into place and things are coming along. Been having some fun trying to make some simpler to create MTP sketches and include things like detecting when SD card inserted on T4.x... Maybe T35/6 as well... Have not tested in awhile.
Also with external SD readers that have an IO pin for card detection... Still WIP...
Right now trying to figure out why: trying to get the Free space on FAT32 external volume is REAL REAL REAL slow. I know one of the reasons is we have to read in every ... FAT sector and count the bits... But I also through we had option turned on to cache the free after the first time we call it... And that is not working...
In my SD wrap class I enabled the Free Space callback to my code (like we do for MSC drives) so I see what is happening...
Debug Run:
Code:
:\GitHub\MTP_t4\examples\SD_MTP-logger\SD_MTP-logger.ino Sep 1 2021 17:40:06
Initializing SD ...
Date: 1/9/2021 17:41:17
addFSToStorage: Added FS
sd_addFilesystem: 0 200040ac SDIO 20004568 200040ac
Total Size: 66002944 Used Size: 21889024
Trying to open SPI config: 10 255 0 16000000
addFSToStorage: Added FS
sd_addFilesystem: 1 2000458c SPI10 20004a48 2000458c
Total Size: 32014073856 Used Size: 524288
SD initialized.
Menu Options:
[0-9] - Set Active Storage
l - List files on disk
e - Erase files on disk
s - Start Logging data (Restarting logger will append records to existing log)
x - Stop Logging data
d - Dump Log
h - Menu
CMD: 1002(OPEN_SESSION)l: 16 T:0 : 1
RESP:2001(RSP:OK)l: 16 T:0 : 1
CMD: 1001(GET_DEVICE_INFO)l: 12 T:1
RESP:2001(RSP:OK)l: 12 T:1
CMD: 1014(GET_DEVICE_PROP_DESC)l: 16 T:2 : d402
RESP:2001(RSP:OK)l: 16 T:2 : d402
CMD: 1004(GET_STORAGE_IDS)l: 12 T:3
RESP:2001(RSP:OK)l: 12 T:3
CMD: 1005(GET_STORAGE_INFO)l: 16 T:4 : 10001
}}}}}}}}} SDMTPClass::usedSizeCB called 20004a6c 0 536887468 cs:254 ft:16
2
65537 0 name:SDIO
}}}}}}}}} SDMTPClass::usedSizeCB called 20004a6c 0 536887468 cs:254 ft:16
1
65537 0 name:SDIO
RESP:2001(RSP:OK)l: 16 T:4 : 10001
CMD: 1005(GET_STORAGE_INFO)l: 16 T:5 : 20001
}}}}}}}}} SDMTPClass::usedSizeCB called 20004a6c 1 536888716 cs:10 ft:32
10016
131073 1 name:SPI10
}}}}}}}}} SDMTPClass::usedSizeCB called 20004a6c 1 536888716 cs:10 ft:32
7143
131073 1 name:SPI10
RESP:2001(RSP:OK)l: 16 T:5 : 20001
When I try to enumerate the top level Teensy Object, the used size is called like 2 or 3 times for each one of these.
The internal small FAT16 one takes like: 1 ms
The larger 32GB Fat32 external drive is taking like: 10 seconds, 7 seconds, 10 seconds... Yes seconds...
So will debug to see why the values are not cached... And/Or may try to do some stuff where I will tell MTP a lie and when it asks for free space... If I suspect it will slow... (Size > X Fat32...) then say 50% free... To see if I can quickly get the drives to work in MTP.
MTP will timeout in many of these cases.