MTP Responder Contribution

@mjs513 defragster ...

I was playing around some more with Format code. The quick format goes through without timing out the MTP connection.

SO I would try a two step low format version, where I call twice with a follow up parameter passed in, such that I could quickly return the command response OK, and then call it again to do the actual work... And
after this one completes send the sledgehammer reset event.

However MTP I believe tried to send additional requests, which then timed out. So for the fun of it I am now going to try a secondary part to this...
Before I start up the format, I will try starting up an interval timer, which looks for and processes simple messages, like query data...
For everything else return something like: MTP_RESPONSE_DEVICE_BUSY

And see what happens.

But first need to go play in the snow :D
 
Been playing around and pushed up a new update, that partially sort of works.

First pass - split the format to work in two passes. The first pass is called like before, but in the case of low level format it starts this work on 2nd pass. The 2nd pass is after it sent response to caller for format. It starts up an interval timer which does sort of like the main loop code, but on a restricted set of messages. Any message it does not process it returns bus busy, which if you try to copy a file it will actually put up dialog saying the device is busy...

So partially working. But I think it is asking for some properties of the formatted device, which I probably return garbage...

Plus, if I then try to go into some directory it might get the data, but I think the format is screwed up and does not complete. Wonder how well littleFS is on being re-entrant?

But thought I would go ahead and push it up, so others can play as well :D

WOndering if I should for now remove the more complicated sendObject code as I think more things are resolved by the getting LittleFS to work reasonably...
 
@KurtE

Well I think good news.

With a file on a 8MB flash I did a "quick format" and it seemed to work. When I went look at the directory after the quick format file was not there and was able to copy another file to the flash. Then I did the same thing but with a low level format selected and got the "."'s and again worked. Have to try a larger chip next
 
Quick format only wipes LFS data, like LLformat. But Quick doesn't prepare any blocks to a formatted state like LLformat or formatUnused, so write will still take time when block requires format before use.

If the problem is finding the next free block and searching the dir tree - which is easy after LFS wipe - then altering the 'lookahead_size ' size to have enough bits for all the media blocks would perhaps offer the same speedup. i.e. 4096 blocks - 512 bytes and upwards from there ... looks like it is allocating half that for the 16M? Will be worse for 64M flash - but use the same small value.
This?:
Code:
	//config.lookahead_size = info->progsize; // 256
	config.lookahead_size = config.block_count/8;
ref:
The block allocator in littlefs is a compromise between a disk-sized bitmap and
a brute force traversal. Instead of a bitmap the size of storage, we keep track
of a small, fixed-size bitmap called the lookahead buffer. During block
allocation, we take blocks from the lookahead buffer. If the lookahead buffer
is empty, we scan the filesystem for more free blocks, populating our lookahead
buffer. In each scan we use an increasing offset, circling the storage as
blocks are allocated.
...
the
performance of the allocator can be optimized by adjusting the block size or
size of the lookahead buffer, trading either write granularity or RAM for
allocator performance.

Will get to the updated code - working formatUnused into that scheme would be much better general purpose solution as it preserves the LFS wear leveling and won't just restart each time on the first same 5-10... blocks.
 
Made the 'lookup' change - got a couple of copy/delete cycles of T_4.1 - then it died on 64MB SPI. Was probably formatted up front?
Using new code but : g_lowLevelFormat = false

Code:
...
SendObjectInfo: 7 26 20004180: 0 3000 0 e2e75 3000 0 0 0 0 0 0 0 0 0 0 : AN12253.pdf
RESP:2001(RSP:OK)l: 24 T:c8 : 7 1a 1b
CMD: 100d(SEND_OBJECT)l: 12 T:c9
MTPD::SendObject: len:929397
 # USB Packets: 1815 total: 22 avg ms: 0 max: 1
 # Write: 114 total:5455 avg ms: 47 max: 116
>>>Total Time: 5481518
RESP:2001(RSP:OK)l: 12 T:c9
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:ca : 1b dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:ca : 1b dc02
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:cb : 1b dc01 (STORAGE_ID)
RESP:2001(RSP:OK)l: 20 T:cb : 1b dc01
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:cc : 1b dc07 (OBJECT NAME)
RESP:2001(RSP:OK)l: 20 T:cc : 1b dc07
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:cd : 1b dc0b (PARENT)
RESP:2001(RSP:OK)l: 20 T:cd : 1b dc0b
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:ce : 1b dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:ce : 1b dc41
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:cf : 1b dc44 (NAME)
RESP:2001(RSP:OK)l: 20 T:cf : 1b dc44
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:d0 : 1b dc03 (PROTECTION)
RESP:2001(RSP:OK)l: 20 T:d0 : 1b dc03
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:d1 : 1b dc04 (SIZE)
RESP:2001(RSP:OK)l: 20 T:d1 : 1b dc04
CMD: 1008(GET_OBJECT_INFO)l: 16 T:d2 : 1b
RESP:2001(RSP:OK)l: 16 T:d2 : 1b
CMD: 100c(SEND_OBJECT_INFO)l: 20 T:d3 : 7 1a
DATA:100c(SEND_OBJECT_INFO)l: 182 T:d3 : 0 3000 5c2cf 3000 0
SendObjectInfo: 7 26 20004180: 0 3000 0 5c2cf 3000 0 0 0 0 0 0 0 0 0 0 : card11a_rev3_web.pdf
RESP:2001(RSP:OK)l: 24 T:d3 : 7 1a 1c
CMD: 100d(SEND_OBJECT)l: 12 T:d4
MTPD::SendObject: len:377551

MTPD::SendObject *** USB Read Timeout ***
 # USB Packets: 452 total: 10 avg ms: 0 max: 1
 # Write: 29 total:3030 avg ms: 104 max: 149
>>>Total Time: 3543991
*MTPD::send_Event(4001)
RESP:2007(RSP:INCOMPLETE_TRANSFER)l: 12 T:d4
 
Looked a bit more at the callback code? Not seeing it activate from sketch?
Narrowed down to single FLASH5 drive - no rpints from the mtpd_format_cb?
Code:
MTP_test
sd_addFilesystem: 0 20005040 sflash5 1
SPIFlash Storage 0 5 sflash5 67108864 12288

Setup done
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 : 1
RESP:2001(RSP:OK)l: 16 T:4 : 1
CMD: 9801(GET_OBJECT_PROPS_SUPPORTED)l: 16 T:5 : 3000
RESP:2001(RSP:OK)l: 16 T:5 : 3000
CMD: 9801(GET_OBJECT_PROPS_SUPPORTED)l: 16 T:6 : 3001
RESP:2001(RSP:OK)l: 16 T:6 : 3001
f
Quick format of LittleFS disks selected

f
low level format of LittleFS disks selected
 
Looked a bit more at the callback code? Not seeing it activate from sketch?
Narrowed down to single FLASH5 drive - no rpints from the mtpd_format_cb?
Code:
MTP_test
sd_addFilesystem: 0 20005040 sflash5 1
SPIFlash Storage 0 5 sflash5 67108864 12288

Setup done
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 : 1
RESP:2001(RSP:OK)l: 16 T:4 : 1
CMD: 9801(GET_OBJECT_PROPS_SUPPORTED)l: 16 T:5 : 3000
RESP:2001(RSP:OK)l: 16 T:5 : 3000
CMD: 9801(GET_OBJECT_PROPS_SUPPORTED)l: 16 T:6 : 3001
RESP:2001(RSP:OK)l: 16 T:6 : 3001
f
Quick format of LittleFS disks selected

f
low level format of LittleFS disks selected

@defragster
Same here when I first tried it but then figured it out.

'f' toggles the type of format you want to do - quick or lowlevel. Then when you right click on the drive in Windows explorer you see "Format" on the drop down. When you click on it it starts formating the drive - neat - I like.
 
Good Morning All

I went back and retested the 8MB Flash and found a few interesting things.

Code:
f
Quick format of LittleFS disks selected



CMD: 100f(FORMAT_STORE)l: 20 T:8 : 2 0
 MTPD::formatStore called post:0
Format Callback: store: 1 p2:0
Quick Format: sflash5
RESP:2001(RSP:OK)l: 20 T:8 : 2 0
 MTPD::formatStore called post:1
*** Start Interval Timer ***
Format Callback: store: 1 p2:0
Quick Format: sflash5
*** end Interval Timer ***
CMD: 1005(GET_STORAGE_INFO)l: 16 T:9 : 2
RESP:2001(RSP:OK)l: 16 T:9 : 2
CMD: 1007(GET_OBJECT_HANDLES)l: 24 T:a : 1 0 ffffffff
RESP:2001(RSP:OK)l: 24 T:a : 1 0 ffffffff
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:b : d dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:b : d dc02
CMD: 9802(GET_OBJECT_PROP_DESC)l: 20 T:c : dc41 3000 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:c : dc41 3000
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:d : d dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:d : d dc41
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:e : c dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:e : c dc02
.......
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:52 : 19 dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:52 : 19 dc02
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:53 : 19 dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:53 : 19 dc41
CMD: 1007(GET_OBJECT_HANDLES)l: 24 T:54 : 2 0 ffffffff
RESP:2001(RSP:OK)l: 24 T:54 : 2 0 ffffffff
==========================

Copied 1Mb file to flash and failed and lost drive (Small file of 214KB works though after Quick format):
Code:
SendObjectInfo: 2 4294967295 20003600: 0 3000 0 1679aa 3000 0 0 0 0 0 0 0 0 0 0 : Visio-driver.pdf
RESP:2001(RSP:OK)l: 24 T:6a : 2 ffffffff 24
CMD: 100d(SEND_OBJECT)l: 12 T:6b
MTPD::SendObject: len:1472938

MTPD::SendObject *** USB Read Timeout ***
 # USB Packets: 500 total: 3 avg ms: 0 max: 1
 # Write: 32 total:3050 avg ms: 95 max: 134
>>>Total Time: 3554711
*MTPD::send_Event(4001)
RESP:2007(RSP:INCOMPLETE_TRANSFER)l: 12 T:6b

-------------------------------------

Doing a LowLevelFormat:
Code:
f
low level format of LittleFS disks selected



CMD: 100f(FORMAT_STORE)l: 20 T:8 : 2 0
 MTPD::formatStore called post:0
Format Callback: store: 1 p2:0
Low Level Format: sflash5 post: 0
RESP:2001(RSP:OK)l: 20 T:8 : 2 0
 MTPD::formatStore called post:1
*** Start Interval Timer ***
Format Callback: store: 1 p2:0
Low Level Format: sflash5 post: 1
.CMD: 1005(GET_STORAGE_INFO)l: 16 T:9 : 2
RESP:2001(RSP:OK)l: 16 T:9 : 2
........................CMD: 1007(GET_OBJECT_HANDLES)l: 24 T:a : 1 0 ffffffff
RESP:2001(RSP:OK)l: 24 T:a : 1 0 ffffffff
..CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:b : d dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:b : d dc02
..CMD: 9802(GET_OBJECT_PROP_DESC)l: 20 T:c : dc41 3000 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:c : dc41 3000
..CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:d : d dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:d : d dc41
...CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:e : c dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:e : c dc02
.
.
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:53 : 19 dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:53 : 19 dc41
CMD: 1007(GET_OBJECT_HANDLES)l: 24 T:54 : 2 0 ffffffff
RESP:2001(RSP:OK)l: 24 T:54 : 2 0 ffffffff
......................................................
*** end Interval Timer ***

When completed and I try to send any size file it beeps. If I reopen Windows Explorer the drive shows RED (FULL). After some fiddling found if I close Explorer and wait a few minutes the drive recovers and I can now transfer >1MB files to the flash.
 
Just gave a LowLevelFormat of the 1G flash and same thing happens as did on the 8MB flash. The 1G shows RED in Explorer.

Interesting thing is that if I try to send a file to the 2G NAND i getting a device busy:
Code:
RESP:2019(RSP:DEVICE_BUSY)l: 20 T:62 : 6 ffffffff
DATA:100c(SEND_OBJECT_INFO)l: 172 T:62 : 0 3000 11a470 3000 0
RESP:2019(RSP:DEVICE_BUSY)l: 172 T:62 : 0 3000 11a470 3000 0
CMD: 100c(SEND_OBJECT_INFO)l: 20 T:63 : 6 ffffffff
RESP:2019(RSP:DEVICE_BUSY)l: 20 T:63 : 6 ffffffff

'r' - resetting does not work in this case. Looks like something hangs in the sketch since any command 'd' does not work.

QUICK FORMAT - seems to be working with 1G NAND seems to work, i.e., no issues with the drive turning red in Explorer and can transfer a 8.5MB file immediately after formating.

QUICK FORMAT - For the 2G same thing happens as for the 1G NAND

Looks like its getting real close to fully working....
 
64MB QSPI FLASH:
Did a lowlevelFormat on the 64MB FLASH:
Code:
 MTPD::formatStore called post:0
Format Callback: store: 0 p2:0
Low Level Format: QSPI post: 0
RESP:2001(RSP:OK)l: 20 T:1e : 1 0
 MTPD::formatStore called post:1
*** Start Interval Timer ***
Format Callback: store: 0 p2:0
Low Level Format: QSPI post: 1
.CMD: 1005(GET_STORAGE_INFO)l: 16 T:1f : 1
RESP:2001(RSP:OK)l: 16 T:1f : 1
........................................................................................................................
*** end Interval Timer ***
If I try and copy workshop.pdf(8.5MB) immediately after formatting completes I get a beep. If I close Explorer and Reopen it I can copy the file and open it to read without an issue.
 
Morning all - I am thinking we may need to more reduce how many messages I try to handle at all in the function processIntervalTimer. Probably to make sure that it does not do anything that may actually have to go and call any of the FS functions, as I think there are issues with library being re-entrant of the different FS's library code? So when in doubt remove the cases and let the default: set the MTP_RESPONSE_DEVICE_BUSY response

Wish I had way to get more data back through MTP to the user or from the user. Would be nice if the format gave me the ability to specify quick or not.
For example with windows if I plug in an thumb drive, if I select a Format command it will come up with dialog showing capacity... but also a checkbox with Quick Format.

Back to playing, coffee and probably look at a couple ILI9341_t3n questions.
 
64MB QSPI FLASH:
Did a lowlevelFormat on the 64MB FLASH:
If I try and copy workshop.pdf(8.5MB) immediately after formatting completes I get a beep. If I close Explorer and Reopen it I can copy the file and open it to read without an issue.

Question is, if after it completes, if you in debug terminal type:
r<cr>
does it fix it without having to restart. The code is supposed to do that already, but when I got a beep or the like, doing the manual one worked for me yesterday... Again more to look at.
 
Tried doing a 'r' a couple of times didn't work for me. Usually closing and reopening Explorer did. Seemed had to wait a while after all the debug messages completed, close and reopen explorer and then was able to transfer files. One of challenges I think is that you get that window saying it format completed but it didn't really complete yet. Sometimes doing a refresh helped. Think it may be a timing issue on when it actuall completes formating.
 
More Info
If I do a lowlevel format of flash6:
Code:
MTP_test
sd_addFilesystem: 0 20003510 RAM1 0
RAM Storage 0 RAM1 199936 512
sd_addFilesystem: 1 200035d8 RAM2 0
RAM Storage 1 RAM2 3999744 4096
sd_addFilesystem: 2 20005c20 sflash5 1
SPIFlash Storage 0 5 sflash5 67108864 16384
sd_addFilesystem: 3 20005cf8 sflash6 1
SPIFlash Storage 1 6 sflash6 67108864 8192
Flash ID: EF AA 21
Flash size is 125.50 Mbyte
Device ID: 0xEFAA21
sd_addFilesystem: 4 200029b8 WINBOND1G 1
Storage 0 3 WINBOND1G 131596288 9175040
Flash ID: EF AA 22
Flash size is 253.00 Mbyte
Device ID: 0xEFAA22
sd_addFilesystem: 5 20002aa8 WINBOND2G 1
Storage 1 4 WINBOND2G 265289728 9437184

Setup done
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 : 1
RESP:2001(RSP:OK)l: 16 T:4 : 1
CMD: 1005(GET_STORAGE_INFO)l: 16 T:5 : 2
RESP:2001(RSP:OK)l: 16 T:5 : 2
CMD: 1005(GET_STORAGE_INFO)l: 16 T:6 : 3
RESP:2001(RSP:OK)l: 16 T:6 : 3
CMD: 1005(GET_STORAGE_INFO)l: 16 T:7 : 4
RESP:2001(RSP:OK)l: 16 T:7 : 4
CMD: 1005(GET_STORAGE_INFO)l: 16 T:8 : 5
RESP:2001(RSP:OK)l: 16 T:8 : 5
CMD: 1005(GET_STORAGE_INFO)l: 16 T:9 : 6
RESP:2001(RSP:OK)l: 16 T:9 : 6
CMD: 9801(GET_OBJECT_PROPS_SUPPORTED)l: 16 T:a : 3000
RESP:2001(RSP:OK)l: 16 T:a : 3000
CMD: 9801(GET_OBJECT_PROPS_SUPPORTED)l: 16 T:b : 3001
RESP:2001(RSP:OK)l: 16 T:b : 3001
CMD: 1007(GET_OBJECT_HANDLES)l: 24 T:c : 4 0 ffffffff
RESP:2001(RSP:OK)l: 24 T:c : 4 0 ffffffff
CMD: 100c(SEND_OBJECT_INFO)l: 20 T:d : 4 ffffffff
DATA:100c(SEND_OBJECT_INFO)l: 178 T:d : 0 3000 35b75 3000 0
SendObjectInfo: 4 4294967295 20003a00: 0 3000 0 35b75 3000 0 0 0 500 353 18 0 0 0 0 : T4.1-Cardlike0.jpg
RESP:2001(RSP:OK)l: 24 T:d : 4 ffffffff 6
CMD: 100d(SEND_OBJECT)l: 12 T:e
MTPD::SendObject: len:220021
 # USB Packets: 429 total: 10 avg ms: 0 max: 1
 # Write: 27 total:1220 avg ms: 45 max: 113
>>>Total Time: 1230887
RESP:2001(RSP:OK)l: 12 T:e
CMD: 9802(GET_OBJECT_PROP_DESC)l: 20 T:f : dc44 3000 (NAME)
RESP:2001(RSP:OK)l: 20 T:f : dc44 3000
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:10 : 6 dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:10 : 6 dc02
CMD: 9802(GET_OBJECT_PROP_DESC)l: 20 T:11 : dc01 3000 (STORAGE_ID)
RESP:2001(RSP:OK)l: 20 T:11 : dc01 3000
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:12 : 6 dc01 (STORAGE_ID)
RESP:2001(RSP:OK)l: 20 T:12 : 6 dc01
CMD: 9802(GET_OBJECT_PROP_DESC)l: 20 T:13 : dc07 3000 (OBJECT NAME)
RESP:2001(RSP:OK)l: 20 T:13 : dc07 3000
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:14 : 6 dc07 (OBJECT NAME)
RESP:2001(RSP:OK)l: 20 T:14 : 6 dc07
CMD: 9802(GET_OBJECT_PROP_DESC)l: 20 T:15 : dc0b 3000 (PARENT)
RESP:2001(RSP:OK)l: 20 T:15 : dc0b 3000
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:16 : 6 dc0b (PARENT)
RESP:2001(RSP:OK)l: 20 T:16 : 6 dc0b
CMD: 9802(GET_OBJECT_PROP_DESC)l: 20 T:17 : dc41 3000 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:17 : dc41 3000
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:18 : 6 dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:18 : 6 dc41
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:19 : 6 dc44 (NAME)
RESP:2001(RSP:OK)l: 20 T:19 : 6 dc44
CMD: 9802(GET_OBJECT_PROP_DESC)l: 20 T:1a : dc03 3000 (PROTECTION)
RESP:2001(RSP:OK)l: 20 T:1a : dc03 3000
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:1b : 6 dc03 (PROTECTION)
RESP:2001(RSP:OK)l: 20 T:1b : 6 dc03
CMD: 9802(GET_OBJECT_PROP_DESC)l: 20 T:1c : dc04 3000 (SIZE)
RESP:2001(RSP:OK)l: 20 T:1c : dc04 3000
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:1d : 6 dc04 (SIZE)
RESP:2001(RSP:OK)l: 20 T:1d : 6 dc04
CMD: 1008(GET_OBJECT_INFO)l: 16 T:1e : 6
RESP:2001(RSP:OK)l: 16 T:1e : 6
CMD: 1005(GET_STORAGE_INFO)l: 16 T:1f : 4
RESP:2001(RSP:OK)l: 16 T:1f : 4
CMD: 100f(FORMAT_STORE)l: 20 T:20 : 4 0
 MTPD::formatStore called post:0
Format Callback: store: 3 p2:0
Low Level Format: sflash6 post: 0
RESP:2001(RSP:OK)l: 20 T:20 : 4 0
 MTPD::formatStore called post:1
*** Start Interval Timer ***
Format Callback: store: 3 p2:0
Low Level Format: sflash6 post: 1
.CMD: 1005(GET_STORAGE_INFO)l: 16 T:21 : 4
RESP:2001(RSP:OK)l: 16 T:21 : 4
...CMD: 1007(GET_OBJECT_HANDLES)l: 24 T:22 : 1 0 ffffffff
RESP:2001(RSP:OK)l: 24 T:22 : 1 0 ffffffff
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:23 : 12 dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:23 : 12 dc02
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:24 : 12 dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:24 : 12 dc41
.CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:25 : 11 dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:25 : 11 dc02
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:26 : 11 dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:26 : 11 dc41
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:27 : 10 dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:27 : 10 dc02
.CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:28 : 10 dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:28 : 10 dc41
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:29 : f dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:29 : f dc02
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:2a : f dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:2a : f dc41
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:2b : e dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:2b : e dc02
.CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:2c : e dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:2c : e dc41
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:2d : d dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:2d : d dc02
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:2e : d dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:2e : d dc41
.CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:2f : c dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:2f : c dc02
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:30 : c dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:30 : c dc41
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:31 : b dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:31 : b dc02
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:32 : b dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:32 : b dc41
.CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:33 : a dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:33 : a dc02
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:34 : a dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:34 : a dc41
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:35 : 9 dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:35 : 9 dc02
.CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:36 : 9 dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:36 : 9 dc41
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:37 : 8 dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:37 : 8 dc02
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:38 : 8 dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:38 : 8 dc41
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:39 : 7 dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:39 : 7 dc02
.CMD: 9802(GET_OBJECT_PROP_DESC)l: 20 T:3a : dc41 3001 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:3a : dc41 3001
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:3b : 7 dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:3b : 7 dc41
CMD: 9802(GET_OBJECT_PROP_DESC)l: 20 T:3c : dc01 3001 (STORAGE_ID)
RESP:2001(RSP:OK)l: 20 T:3c : dc01 3001
.CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:3d : 7 dc01 (STORAGE_ID)
RESP:2001(RSP:OK)l: 20 T:3d : 7 dc01
CMD: 1007(GET_OBJECT_HANDLES)l: 24 T:3e : 1 0 7
RESP:2001(RSP:OK)l: 24 T:3e : 1 0 7
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:3f : 1d dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:3f : 1d dc02
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:40 : 1d dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:40 : 1d dc41
.CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:41 : 1c dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:41 : 1c dc02
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:42 : 1c dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:42 : 1c dc41
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:43 : 1b dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:43 : 1b dc02
.CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:44 : 1b dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:44 : 1b dc41
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:45 : 1a dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:45 : 1a dc02
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:46 : 1a dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:46 : 1a dc41
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:47 : 19 dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:47 : 19 dc02
.CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:48 : 19 dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:48 : 19 dc41
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:49 : 18 dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:49 : 18 dc02
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:4a : 18 dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:4a : 18 dc41
.CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:4b : 17 dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:4b : 17 dc02
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:4c : 17 dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:4c : 17 dc41
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:4d : 16 dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:4d : 16 dc02
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:4e : 16 dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:4e : 16 dc41
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:4f : 15 dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:4f : 15 dc02
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:50 : 15 dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:50 : 15 dc41
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:51 : 14 dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:51 : 14 dc02
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:52 : 14 dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:52 : 14 dc41
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:53 : 13 dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:53 : 13 dc02
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:54 : 13 dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:54 : 13 dc41
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:55 : 13 dc01 (STORAGE_ID)
RESP:2001(RSP:OK)l: 20 T:55 : 13 dc01
CMD: 1007(GET_OBJECT_HANDLES)l: 24 T:56 : 1 0 13
RESP:2001(RSP:OK)l: 24 T:56 : 1 0 13
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:57 : 27 dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:57 : 27 dc02
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:58 : 27 dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:58 : 27 dc41
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:59 : 26 dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:59 : 26 dc02
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:5a : 26 dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:5a : 26 dc41
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:5b : 25 dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:5b : 25 dc02
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:5c : 25 dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:5c : 25 dc41
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:5d : 24 dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:5d : 24 dc02
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:5e : 24 dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:5e : 24 dc41
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:5f : 23 dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:5f : 23 dc02
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:60 : 23 dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:60 : 23 dc41
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:61 : 22 dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:61 : 22 dc02
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:62 : 22 dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:62 : 22 dc41
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:63 : 21 dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:63 : 21 dc02
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:64 : 21 dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:64 : 21 dc41
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:65 : 20 dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:65 : 20 dc02
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:66 : 20 dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:66 : 20 dc41
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:67 : 1f dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:67 : 1f dc02
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:68 : 1f dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:68 : 1f dc41
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:69 : 1e dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:69 : 1e dc02
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:6a : 1e dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:6a : 1e dc41
CMD: 1007(GET_OBJECT_HANDLES)l: 24 T:6b : 2 0 ffffffff
RESP:2001(RSP:OK)l: 24 T:6b : 2 0 ffffffff
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:6c : 28 dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:6c : 28 dc02
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:6d : 28 dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:6d : 28 dc41
CMD: 1007(GET_OBJECT_HANDLES)l: 24 T:6e : 3 0 ffffffff
RESP:2001(RSP:OK)l: 24 T:6e : 3 0 ffffffff
CMD: 1007(GET_OBJECT_HANDLES)l: 24 T:6f : 4 0 ffffffff
RESP:2001(RSP:OK)l: 24 T:6f : 4 0 ffffffff
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:70 : 6 dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:70 : 6 dc02
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:71 : 6 dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:71 : 6 dc41
CMD: 1007(GET_OBJECT_HANDLES)l: 24 T:72 : 5 0 ffffffff
RESP:2001(RSP:OK)l: 24 T:72 : 5 0 ffffffff
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:73 : 29 dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:73 : 29 dc02
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:74 : 29 dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:74 : 29 dc41
CMD: 1007(GET_OBJECT_HANDLES)l: 24 T:75 : 6 0 ffffffff
RESP:2001(RSP:OK)l: 24 T:75 : 6 0 ffffffff
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:76 : 2b dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:76 : 2b dc02
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:77 : 2b dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:77 : 2b dc41
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:78 : 2a dc02 (FORMAT)
RESP:2001(RSP:OK)l: 20 T:78 : 2a dc02
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:79 : 2a dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:79 : 2a dc41
At this point it stops. Doing a 'r' there is no response in debug window. And:
Capture.jpg

If I restart and format flash5 same thing happens. Again this is for lowLevelFormat.


NOTE: For QUICK FORMAT it works. I can do a 'r' and it will transfer files. One note - seems like I can only format one disk during a single session.
 
Cool Context Menu Format - How Handy. Good Info.

Makes sense now and with cover of Dialog all should be well - of course unusedFormat - same timing as LLformat and no disk disruption so it should not need to restart?

Got an appt to donate - traffic says better than usual with snow clearing?
 
I just pushed up change where the IntervalTimer handler returns device busy for all messages.
With this I was able to format one of the drives, and when it finally completed was able to copy files to it. Then I formatted the PropShield and again after it finally completed, I was able to copy files to it.
 
Afternoon all
Just downloaded the latest and greatest. Just formatted a 64MB Flash and works much better with the device busy. I do get the format complete window right away and not after complete - don't know if there is a way that can adjusted?

Anyway after format complete I see this:
Capture.PNG

If I do a windows explorer refresh I get the drive with the used/available as normal. Once this happens I can transfer the file, but not until I do the refresh. Did try the 'r' command but doesn't update explorer.

Repeated the above for the 2G NAND and worked like a charm. Same described above.

Repeated the same test on a M02 2G Winbond QSPI and worked even better. Didn't have to refresh windows explorer before transfering the file but for NAND formatting seems faster.
 
Afternoon all
Just downloaded the latest and greatest. Just formatted a 64MB Flash and works much better with the device busy. I do get the format complete window right away and not after complete - don't know if there is a way that can adjusted?
Yes and NO - Right now I do the low level format in 2 passes. First pass does nothing and returns with status OK. The Host sees that it is done... But then I call back again to format and here I do the low level format with the Interval timer and the like and when it is done cancel the interval timer and start respond properly to messages, which can take minutes.

Problem here is if I wait to respond until it is done, the host gets tired of me and errors out and then you need to reboot teensy...

Wish there was a way to respond: OK but not done. And a way to send event saying I am done now... But so far have not found anything in the documents or the like that gives us this capability.

Nor any way to send an event for the host to see and maybe display a message like: The format is Really done now...
 
Online with new computer today - actually remote desktop from new to the old ... now can move old to remote desk and put new one in place ...

So not much done Teensy-wise except on this new machine copied over Teensy Drive contents - and mapped it in registry to T: where it was now as a subfolder on new machine boot SSD. So it builds using same COMPILE.cmd from TSET. Sublime Installed but not prepped for TSET use - but drive map from RaymondC website was clean and easy! And uploaded the mtp-test.ino hex it built to the Teensy I brought over. One thing needed was the Arduino15 and subfolder in %appdata% since that was included in TSET linkage and new machine never ran IDE yet.

So tomorrow I'll look to update formatUnused() {shorter blankFormat test } - and integrate into the new other format style option. For LFS drive having user manually DELETE all files then formatUnused() would be better than either other format for media life - and any continuity desired for saved files those would wipe.
 
Warning: I just pushed up changes to my MEM_send_object_large branch which removed the send object yield code and the send object simple code.

This removed the extra parameter I added to storage class to tell system to use the send object yield code, plus the code to add secondary buffer...

Before I did this I did create another holding branch, with the current stuff in case we wish to get back to it.

It built and was able to format. Had one case where it dinged at me when I tried to copy a file, did the refresh command and it did copy next time, so not the MTP died error.

Now to see if we can get some better feedback information.
 
Morning @KurtE
Just gave new branch a try with LowLevelFormat on the 64MB flash, seemed to format faster:
Code:
CMD: 100f(FORMAT_STORE)l: 20 T:3a : 5 0
 MTPD::formatStore called post:0
Format Callback: store: 4 p2:0
Low Level Format: sflash6 post: 0
RESP:2001(RSP:OK)l: 20 T:3a : 5 0
 MTPD::formatStore called post:1
*** Start Interval Timer ***
Format Callback: store: 4 p2:0
Low Level Format: sflash6 post: 1
.CMD: 1005(GET_STORAGE_INFO)l: 16 T:3b : 5
RESP:2019(RSP:DEVICE_BUSY)l: 16 T:3b : 5
...CMD: 9802(GET_OBJECT_PROP_DESC)l: 20 T:3c : dc41 3000 (PERSISTENT_UID)
RESP:2019(RSP:DEVICE_BUSY)l: 20 T:3c : dc41 3000
.....................................................................................................................
*** end Interval Timer ***
CMD: 1005(GET_STORAGE_INFO)l: 16 T:3d : 5
RESP:2001(RSP:OK)l: 16 T:3d : 5
CMD: 1007(GET_OBJECT_HANDLES)l: 24 T:3e : 5 0 ffffffff
RESP:2001(RSP:OK)l: 24 T:3e : 5 0 ffffffff
CMD: 100c(SEND_OBJECT_INFO)l: 20 T:3f : 5 ffffffff
DATA:100c(SEND_OBJECT_INFO)l: 166 T:3f : 0 3000 87b999 3000 0
SendObjectInfo: 5 4294967295 20003180: 0 3000 0 87b999 3000 0 0 0 0 0 0 0 0 0 0 : workshop.pdf
RESP:2001(RSP:OK)l: 24 T:3f : 5 ffffffff 7
CMD: 100d(SEND_OBJECT)l: 12 T:40
MTPD::SendObject: len:8894873
 # USB Packets: 17372 total: 235 avg ms: 0 max: 1
 # Write: 1086 total:29588 avg ms: 27 max: 109
>>>Total Time: 29858334
RESP:2001(RSP:OK)l: 12 T:40
CMD: 9802(GET_OBJECT_PROP_DESC)l: 20 T:41 : dc44 3001 (NAME)
RESP:2001(RSP:OK)l: 20 T:41 : dc44 3001
CMD: 9802(GET_OBJECT_PROP_DESC)l: 20 T:42 : dc01 3001 (STORAGE_ID)
RESP:2001(RSP:OK)l: 20 T:42 : dc01 3001
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:43 : 7 dc01 (STORAGE_ID)
RESP:2001(RSP:OK)l: 20 T:43 : 7 dc01
CMD: 9802(GET_OBJECT_PROP_DESC)l: 20 T:44 : dc41 3001 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:44 : dc41 3001
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:45 : 7 dc41 (PERSISTENT_UID)
RESP:2001(RSP:OK)l: 20 T:45 : 7 dc41
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:46 : 7 dc44 (NAME)
RESP:2001(RSP:OK)l: 20 T:46 : 7 dc44
CMD: 9802(GET_OBJECT_PROP_DESC)l: 20 T:47 : dc03 3001 (PROTECTION)
RESP:2001(RSP:OK)l: 20 T:47 : dc03 3001
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:48 : 7 dc03 (PROTECTION)
RESP:2001(RSP:OK)l: 20 T:48 : 7 dc03
CMD: 9802(GET_OBJECT_PROP_DESC)l: 20 T:49 : dc04 3001 (SIZE)
RESP:2001(RSP:OK)l: 20 T:49 : dc04 3001
CMD: 9803(GET_OBJECT_PROP_VALUE)l: 20 T:4a : 7 dc04 (SIZE)
RESP:2001(RSP:OK)l: 20 T:4a : 7 dc04
CMD: 1008(GET_OBJECT_INFO)l: 16 T:4b : 7
RESP:2001(RSP:OK)l: 16 T:4b : 7
CMD: 1005(GET_STORAGE_INFO)l: 16 T:4c : 5
RESP:2001(RSP:OK)l: 16 T:4c : 5
After refresh I tried to copy a file to the flash - it copied but showed as direcotory:
Capture.PNG

if I do a 'r' to reset the file shows up correctly. Looks like the sequence after formatting (LL) is to do a windows refresh and then do a 'r' before transferring any files.

NOTE: Even if you transfer before you a 'r' the file will transfer just may not show correctly. If you do a 'r' it corrects it.

UPDATE:
Tested on the 8MB flash (same one on propshield) format completed successfully, but quite a bit longer. Still had to do a Explorer refresh but didn't have to do a 'r' to get the file to show correctly. So the 'r' may be chip specific.
 
@mjs513 and all

Just pushed up some more changes.

a) I brought over some of the stuff from other unused branch where simple command processing and use case statement... Will add some more specific event tests soon.

b) Playing with detecting Built in SD Card insertion. So far only T4.1 - If it fails to start up the SD drive at startup, each time though loop it checks the DAT3 line and when it detects it goes high, it then tries to open the SDCard then, and if works adds the storage... And it sends event to tell MTP that there is a new store.

It partially works. In that if you have not browsed anything, than it pops it into the list which shows at to the top level Teensy window... But if it has enumerated other objects, than the storage list gets confused.
But if later do a refresh command it rebuilds the index including this new store. SO two options fix the index stuff to handle a dynamically inserted device or... use large hammer (reset event).
 
But if it has enumerated other objects, than the storage list gets confused.
But if later do a refresh command it rebuilds the index including this new store. SO two options fix the index stuff to handle a dynamically inserted device or... use large hammer (reset event).
Reason is, that index list assumes that for N storages, the first N indices indicate the N root devices and have itself as parent. So if storage is added at a later time, a reset is required. Assuming this is working, a reset clears the index list and starts from beginning, that is allocates the first indices to storages.
 
See LittleFS thread for updates.

Next step to include new and improved unusedFormat into MTP-test - no longer wastes time reading whole block for format test - so disk doesn't go offline (like other formats Q and LL) and it can be done in a few seconds or less {slower than Quick - but actually does something useful } - depending on media format time and number of dirty unused blocks to format.
 
Reason is, that index list assumes that for N storages, the first N indices indicate the N root devices and have itself as parent. So if storage is added at a later time, a reset is required. Assuming this is working, a reset clears the index list and starts from beginning, that is allocates the first indices to storages.
Thanks, I was pretty sure of that as well.

Now just trying to figure out what I would expect as a user and what is possible with MTPD (Both code base as well as by spec).

For example in the case of a fixed SD Adapter such as on T3.5/6 and T4.x. If the code specifies for SDCard type with BUILT_IN, maybe we always add this storage to the list. Whenever some MTP message refers to this
storage, if we are still in the state where the SDCard has not been inserted, the code should maybe return: MTP_RESPONSE_STORE_NOT_AVAILABLEm
Which the Spec shows that Store may have been ejected and not physically available.

I may play with this and see how well it works.
 
Back
Top