USB host and SSD?

bastler59

Member
Hi,

inside Arduino IDE I'm using the DriveInfo example from USBHost_t36\storage folder.
I attached an USB-socket to the USB host pins on Teensy 4.1 board.

An USB hub with a USB stick and a card reader together are recognized and a lot of information comes out at serial monitor.

But connecting a SSD (mSATA with USB adapter) fails.

1. Connecting directly to USB socket at USB host pins:
Code:
04:35:23.825 -> Initializing USB drive 1...
04:35:26.207 -> initialization failed with code: USB drive error: 0x34,0x0 --> Type: NO_SENSE 
                Cause: UNKNOWN ASC/ASCQ (1Bh/B1h)

SSD enclosure has a LED. At beginning of sketch LED is flashing white, so program tries to access the SSD. Then LED stays white, so it gets only power. Connected to my computer colour changes to blue meaning that it is recognized.

2. Connecting to USB-Hub Red4Power R4-U002B:
Code:
04:36:41.095 -> Initializing USB drive 1...
04:36:46.229 -> initialization failed with code: USB drive error: 0x23,0x0 --> Type: NO_SENSE 
                Cause: NO ADDITIONAL SENSE INFORMATION

3. Connecting to USB-Hub Orico TWU3-4A:
Code:
04:38:45.902 -> Initializing USB drive 1...
04:38:48.150 -> initialization failed with code: USB drive error: 0x34,0x0 --> Type: NO_SENSE 
                Cause: UNKNOWN ASC/ASCQ (1Bh/B1h)

Orico TWU3-4A has a type C power port with "anti backflow design". So you can power harddisk that needs more current than a USB socket can deliver and it will not cause trouble by current flowing back to socket of a laptop. I try this also, may be USB host pins from Teensy can't deliver enough current. But same problem, same error code.

So USBHost_t36 doesn't work with SSD?
What is the meaning of these error codes?

Bye
Jürgen
 
Not sure what those errors mean to be honest but I can tell you we have tested SSD's to the USBHost port and they worked.

From the error messages it looks like it sees the drive and is trying to initialize it but its failing on the drive, i.e., issue with the drive. Not sure what drive model/make you are using, how its formatted etc. One of the things I always try is to make sure the drive can be read on a PC/laptop etc.
 
I do know that some SSD drives do work with this.
I have two cable adapters for SSD drives.
One works well(https://smile.amazon.com/gp/product/B00HJZJI84/), the other some of the time (https://smile.amazon.com/gp/product/B07S9CKV7X/)

And I have a few different SSD drives.

Not 100% sure about the error codes and how to read them.
That is: nitialization failed with code: USB drive error: 0x23,0x0 --> Type: NO_SENSE

I am not sure if that is supposed to map through the ASC_NUM_LIST
If so that might map to: SENSE_CODE(0x23, 0x0, "INVALID TOKEN OPERATION, CAUSE NOT REPORTABLE") \

And the other one: SENSE_CODE(0x34, 0x0, "ENCLOSURE FAILURE") \

I know not much help here, but hopefully the developer of this will chime in.

But until then, you might try to grab some more debug information.

Like go into MassStorageDriver.cpp and turn on more debug output:

// Uncomment this to display function usage and sequencing.
//#define DBGprint 1

And for even more debug info, go into USBHost_t36.h
and uncomment: (about line 62)

// Uncomment this line to see lots of debugging info!
//#define USBHOST_PRINT_DEBUG
 
@mjs513:
It is a Samsung SSD 860 EVO mSATA with 500 GB. It's formated as exFAT and of course it is working at my computer. It is also working together with a Samsung tablet (Android 9).

Enclosure is from Fantec (Alu31mSATA), it's supporting USB3.1 and UASP. Windows device manager tells me "asmedia ASM1351 SCSI disk device". Sounds a little bit funny, but ASM1351 from ASMedia is an USB 3.1 to SATA chipset.
 
Last edited:
Like go into MassStorageDriver.cpp and turn on more debug output:
// Uncomment this to display function usage and sequencing.
//#define DBGprint 1
And for even more debug info, go into USBHost_t36.h
and uncomment: (about line 62)
// Uncomment this line to see lots of debugging info!
//#define USBHOST_PRINT_DEBUG

SSD is connected directly to Teensy 4.1 board without an USB hub.After copying out all lines from Serial Monitor:
Code:
14:42:24.831 -> USB2 PLL running
14:42:25.037 ->  reset waited 6
14:42:25.037 -> USBHS_ASYNCLISTADDR = 0
14:42:25.037 -> USBHS_PERIODICLISTBASE = 2000A000
14:42:25.037 -> periodictable = 2000A000
14:42:25.037 -> 
14:42:25.037 -> Initializing USB drive 1...
14:42:25.037 -> >>USBFilesystem::begin(0x2000b0e0, 1, 1)
14:42:25.037 -> mscIint()
14:42:25.975 -> port change: 10001803
14:42:25.975 ->     connect
14:42:26.168 ->   begin reset
14:42:26.172 -> port change: 18001205
14:42:26.172 ->   port enabled
14:42:26.172 ->   end recovery
14:42:26.172 -> new_Device: 480 Mbit/sec
14:42:26.172 -> new_Pipe
14:42:26.174 -> enumeration:
14:42:26.174 -> enumeration:
14:42:26.174 -> enumeration:
14:42:26.174 -> Device Descriptor:
14:42:26.174 ->   12 01 10 02 00 00 00 40 4C 17 AA 55 00 01 02 03 01 01 
14:42:26.174 ->     VendorID = 174C, ProductID = 55AA, Version = 0100
14:42:26.174 ->     Class/Subclass/Protocol = 0 / 0 / 0
14:42:26.174 ->     Number of Configurations = 1
14:42:26.174 -> enumeration:
14:42:26.174 -> enumeration:
14:42:26.174 -> Manufacturer: asmedia
14:42:26.174 -> enumeration:
14:42:26.174 -> Product: ASM1351
14:42:26.174 -> enumeration:
14:42:26.174 -> Serial Number: 0123456789012
14:42:26.174 -> enumeration:
14:42:26.174 -> Config data length = 85
14:42:26.174 -> enumeration:
14:42:26.174 -> Configuration Descriptor:
14:42:26.174 ->   09 02 55 00 01 01 00 C0 00 
14:42:26.174 ->     NumInterfaces = 1
14:42:26.174 ->     ConfigurationValue = 1
14:42:26.174 ->   09 04 00 00 02 08 06 50 00 
14:42:26.174 ->     Interface = 0
14:42:26.174 ->     Number of endpoints = 2
14:42:26.174 ->     Class/Subclass/Protocol = 8(Mass Storage) / 6(SCSI) / 80(Bulk Only)
14:42:26.174 ->   07 05 81 02 00 02 00 
14:42:26.174 ->     Endpoint = 1 IN
14:42:26.174 ->     Type = Bulk
14:42:26.174 ->     Max Size = 512
14:42:26.174 ->     Polling Interval = 0
14:42:26.174 ->   07 05 02 02 00 02 00 
14:42:26.174 ->     Endpoint = 2 OUT
14:42:26.174 ->     Type = Bulk
14:42:26.174 ->     Max Size = 512
14:42:26.174 ->     Polling Interval = 0
14:42:26.174 ->   09 04 00 01 04 08 06 62 00 
14:42:26.174 ->     Interface = 0
14:42:26.174 ->     Number of endpoints = 4
14:42:26.174 ->     Class/Subclass/Protocol = 8(Mass Storage) / 6(SCSI) / 98(UAS)
14:42:26.174 ->   07 05 81 02 00 02 00 
14:42:26.174 ->     Endpoint = 1 IN
14:42:26.174 ->     Type = Bulk
14:42:26.174 ->     Max Size = 512
14:42:26.174 ->     Polling Interval = 0
14:42:26.174 ->   04 24 03 00 
14:42:26.174 ->   07 05 02 02 00 02 00 
14:42:26.174 ->     Endpoint = 2 OUT
14:42:26.174 ->     Type = Bulk
14:42:26.174 ->     Max Size = 512
14:42:26.174 ->     Polling Interval = 0
14:42:26.174 ->   04 24 04 00 
14:42:26.174 ->   07 05 83 02 00 02 00 
14:42:26.174 ->     Endpoint = 3 IN
14:42:26.174 ->     Type = Bulk
14:42:26.174 ->     Max Size = 512
14:42:26.174 ->     Polling Interval = 0
14:42:26.174 ->   04 24 02 00 
14:42:26.174 ->   07 05 04 02 00 02 00 
14:42:26.174 ->     Endpoint = 4 OUT
14:42:26.174 ->     Type = Bulk
14:42:26.174 ->     Max Size = 512
14:42:26.174 ->     Polling Interval = 0
14:42:26.174 ->   04 24 01 00 
14:42:26.174 -> enumeration:
14:42:26.174 -> USBHub memory usage = 960
14:42:26.174 -> USBHub claim_device this=2000A1E0
14:42:26.174 -> USBHub memory usage = 960
14:42:26.174 -> USBHub claim_device this=2000A5A0
14:42:26.174 -> USBHub memory usage = 960
14:42:26.174 -> USBHub claim_device this=2000A960
14:42:26.174 -> USBHub memory usage = 960
14:42:26.174 -> USBHub claim_device this=2000AD20
14:42:26.174 -> USBDrive claim this=2000B0E0
14:42:26.174 -> USBDrive claim this=2000B9E0
14:42:26.174 -> Descriptor 4 = INTERFACE
14:42:26.174 -> USBDrive claim this=2000B0E0
14:42:26.174 -> 09 04 00 00 02 08 06 50 00 07 05 81 02 00 02 00 07 05 02 02 00 02 00 09 04 00 01 04 08 06 62 00 07 05 81 02 00 02 00 04 24 03 00 07 05 02 02 00 02 00 04 24 04 00 07 05 83 02 00 02 00 04 24 02 00 07 05 04 02 00 02 00 04 24 01 00 
14:42:26.174 -> numendpoint=2
14:42:26.174 -> endpointIn=81
14:42:26.174 -> endpointOut=2
14:42:26.174 -> packet size in (USBDrive) = 512
14:42:26.174 -> packet size out (USBDrive) = 512
14:42:26.174 -> polling intervalIn = 0
14:42:26.174 -> polling intervalOut = 0
14:42:26.174 -> new_Pipe
14:42:26.174 -> new_Pipe
14:42:26.174 ->    connected = 1
14:42:26.174 ->    initialized = 0
14:42:26.174 -> Descriptor 5 = ENDPOINT
14:42:26.174 -> Descriptor 5 = ENDPOINT
14:42:26.174 -> Descriptor 4 = INTERFACE
14:42:26.174 -> USBDrive claim this=2000B9E0
14:42:26.174 -> 09 04 00 01 04 08 06 62 00 07 05 81 02 00 02 00 04 24 03 00 07 05 02 02 00 02 00 04 24 04 00 07 05 83 02 00 02 00 04 24 02 00 07 05 04 02 00 02 00 04 24 01 00 
14:42:26.174 -> Descriptor 5 = ENDPOINT
14:42:26.174 -> Descriptor 36 =  ???
14:42:26.174 -> Descriptor 5 = ENDPOINT
14:42:26.174 -> Descriptor 36 =  ???
14:42:26.174 -> Descriptor 5 = ENDPOINT
14:42:26.174 -> Descriptor 36 =  ???
14:42:26.174 -> Descriptor 5 = ENDPOINT
14:42:26.174 -> Descriptor 36 =  ???
14:42:26.174 -> msReset()
14:42:26.174 -> >>msReset()
14:42:26.174 -> control CallbackIn (USBDrive)
14:42:26.174 -> 00 00 00 00 00 00 00 00 
14:42:26.174 -> msGetMaxLun()
14:42:26.174 -> control CallbackIn (USBDrive)
14:42:26.174 -> 00 00 00 00 00 00 00 00 
14:42:26.174 -> msStartStopUnit()
14:42:26.174 -> USBDrive CallbackOut (static)
14:42:26.174 -> transfer->qtd.token = 0
14:42:26.174 -> USBDrive dataOut (static)31
14:42:26.174 -> 55 53 42 43 01 00 00 00 00 00 00 00 80 00 06 1B 01 00 00 01 00 00 00 00 00 00 00 00 00 00 00 
14:42:26.174 -> msGetCSW()
14:42:26.174 -> USBDrive CallbackIn (static)
14:42:26.174 -> transfer->qtd.token = 0
14:42:26.174 -> USBDrive dataIn (static): 13
14:42:26.174 -> 55 53 42 53 01 00 00 00 00 00 00 00 00 
14:42:26.174 -> WaitMediaReady()
14:42:26.174 -> msTestReady()
14:42:26.174 -> USBDrive CallbackOut (static)
14:42:26.174 -> transfer->qtd.token = 0
14:42:26.174 -> USBDrive dataOut (static)31
14:42:26.174 -> 55 53 42 43 02 00 00 00 00 00 00 00 80 00 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
14:42:26.174 -> msGetCSW()
14:42:26.174 -> USBDrive CallbackIn (static)
14:42:26.174 -> transfer->qtd.token = 0
14:42:26.174 -> USBDrive dataIn (static): 13
14:42:26.174 -> 55 53 42 53 02 00 00 00 00 00 00 00 00 
14:42:26.174 -> msDeviceInquiry()
14:42:26.174 -> msDoCommand()
14:42:26.174 -> USBDrive CallbackOut (static)
14:42:26.174 -> transfer->qtd.token = 0
14:42:26.174 -> USBDrive dataOut (static)31
14:42:26.174 -> 55 53 42 43 03 00 00 00 24 00 00 00 80 00 06 12 00 00 00 24 00 00 00 00 00 00 00 00 00 00 00 
14:42:26.174 -> USBDrive CallbackIn (static)
14:42:26.174 -> transfer->qtd.token = 0
14:42:26.174 -> USBDrive dataIn (static): 36
14:42:26.174 -> 00 00 06 02 47 00 00 00 61 73 6D 65 64 69 61 20 41 53 4D 31 33 35 31 20 20 20 20 20 20 20 20 20 
14:42:26.174 -> msGetCSW()
14:42:26.174 -> USBDrive CallbackIn (static)
14:42:26.174 -> transfer->qtd.token = 0
14:42:26.174 -> USBDrive dataIn (static): 13
14:42:26.174 -> 55 53 42 53 03 00 00 00 00 00 00 00 00 
14:42:26.174 -> msProcessError()
14:42:26.174 -> msReadDeviceCapacity()
14:42:26.174 -> msDoCommand()
14:42:26.174 -> USBDrive CallbackOut (static)
14:42:26.174 -> transfer->qtd.token = 0
14:42:26.174 -> USBDrive dataOut (static)31
14:42:26.174 -> 55 53 42 43 04 00 00 00 08 00 00 00 80 00 0A 25 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
14:42:26.174 -> USBDrive CallbackIn (static)
14:42:26.174 -> transfer->qtd.token = 0
14:42:26.174 -> USBDrive dataIn (static): 8
14:42:26.174 -> 3A 38 60 2F 00 00 02 00 
14:42:26.174 -> msGetCSW()
14:42:26.174 -> USBDrive CallbackIn (static)
14:42:26.174 -> transfer->qtd.token = 0
14:42:26.174 -> USBDrive dataIn (static): 13
14:42:26.174 -> 55 53 42 53 04 00 00 00 00 00 00 00 00 
14:42:26.174 -> msProcessError()
14:42:26.174 -> checkConnectedInitialized()checkConnectedInitialized()msReadBlocks()
14:42:26.174 -> msDoCommand()
14:42:26.174 -> USBDrive CallbackOut (static)
14:42:26.174 -> transfer->qtd.token = 0
14:42:26.174 -> USBDrive dataOut (static)31
14:42:26.174 -> 55 53 42 43 05 00 00 00 00 02 00 00 80 00 0A 28 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
14:42:26.174 -> USBDrive CallbackIn (static)
14:42:26.174 -> transfer->qtd.token = 0
14:42:26.174 -> USBDrive dataIn (static): 512
14:42:26.174 -> 33 C0 8E D0 BC 00 7C 8E C0 8E D8 BE 00 7C BF 00 06 B9 00 02 FC F3 A4 50 68 1C 06 CB FB B9 04 00 
14:42:26.174 -> msGetCSW()
14:42:26.174 -> USBDrive CallbackIn (static)
14:42:26.174 -> transfer->qtd.token = 0
14:42:26.174 -> USBDrive dataIn (static): 13
14:42:26.174 -> 55 53 42 53 05 00 00 00 00 00 00 00 00 
14:42:26.174 -> msProcessError()
14:42:26.174 -> checkConnectedInitialized()msReadBlocks()
14:42:26.174 -> msDoCommand()
14:42:26.174 -> USBDrive CallbackOut (static)
14:42:26.174 -> transfer->qtd.token = 0
14:42:26.174 -> USBDrive dataOut (static)31
14:42:26.174 -> 55 53 42 43 06 00 00 00 00 02 00 00 80 00 0A 28 00 00 00 00 01 00 00 01 00 00 00 00 00 00 00 
14:42:26.174 -> USBDrive CallbackIn (static)
14:42:26.174 -> transfer->qtd.token = 0
14:42:26.174 -> USBDrive dataIn (static): 512
14:42:26.174 -> 45 46 49 20 50 41 52 54 00 00 01 00 5C 00 00 00 99 8C 3D DA 00 00 00 00 01 00 00 00 00 00 00 00 
14:42:26.174 -> msGetCSW()
14:42:26.174 -> USBDrive CallbackIn (static)
14:42:26.174 -> transfer->qtd.token = 0
14:42:26.174 -> USBDrive dataIn (static): 13
14:42:26.174 -> 55 53 42 53 06 00 00 00 00 00 00 00 00 
14:42:26.174 -> msProcessError()
14:42:26.174 -> >>Find Partition GPT cParts=128
14:42:26.174 -> checkConnectedInitialized()msReadBlocks()
14:42:26.174 -> msDoCommand()
14:42:26.174 -> USBDrive CallbackOut (static)
14:42:26.174 -> transfer->qtd.token = 0
14:42:26.174 -> USBDrive dataOut (static)31
14:42:26.174 -> 55 53 42 43 07 00 00 00 00 02 00 00 80 00 0A 28 00 00 00 00 02 00 00 01 00 00 00 00 00 00 00 
14:42:26.174 -> USBDrive CallbackIn (static)
14:42:26.174 -> transfer->qtd.token = 0
14:42:26.174 -> USBDrive dataIn (static): 512
14:42:26.174 -> 16 E3 C9 E3 5C 0B B8 4D 81 7D F9 2D F0 02 15 AE A8 D4 68 70 21 CE 40 46 9B 7F C5 34 E0 C3 05 74 
14:42:26.174 -> msGetCSW()
14:42:26.174 -> USBDrive CallbackIn (static)
14:42:26.174 -> transfer->qtd.token = 0
14:42:26.174 -> USBDrive dataIn (static): 13
14:42:26.174 -> 55 53 42 53 07 00 00 00 00 00 00 00 00 
14:42:26.174 -> msProcessError()
14:42:26.174 -> >>USBFilesystem::check_voltype_guid(3, 0x20067fb0)
14:42:26.174 -> E3C9E316-0B5C-4DB8-817D-F92DF00215AEUSBFilesystem - Unsupporteded GUID
14:42:26.174 -> initialization failed with code: USB drive error: 0xF1,0x0 --> Type: NO_SENSE Cause: UNKNOWN ASC/ASCQ (1Bh/B1h)

Somewhere at the beginning I see Manufacturer: asmedia Product: ASM1351 - that's correct.
 
@mjs513:
It is a Samsung SSD 860 EVO mSATA with 500 GB. It's formated as exFAT and of course it is working at my computer. It is also working together with a Samsung tablet (Android 9).

Enclosure is from Fantec (Alu31mSATA), it's supporting USB3.1 and UASP. Windows device manager tells me "asmedia ASM1351 SCSI disk device". Sounds a little bit funny, but ASM1351 from ASMedia is an USB 3.1 to SATA chipset.

Ok went to look at the specs and it registered finally that you are working with a mSATA drive. Not sure if a mSata was ever tested but I have attached nVME successfull but that might have to do with the enclosure as well, https://www.amazon.com/gp/product/B09QVPCJN2/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1. I just ordered a different msata drive just to test with and will ckeck it out
 
@Bastler59 - The reason for the failure is an unsupported GUID.

Your device GUID:
Code:
14:42:26.174 -> >>USBFilesystem::check_voltype_guid(3, 0x20067fb0)
14:42:26.174 -> [COLOR="#FF0000"]E3C9E316-0B5C-4DB8-817D-F92DF00215AE[/COLOR] USBFilesystem - Unsupporteded GUID
14:42:26.174 -> initialization failed with code: USB drive error: 0xF1,0x0 --> Type: NO_SENSE Cause: UNKNOWN ASC/ASCQ (1Bh/B1h)

Our default and only GUID:
Code:
A2A0D0EB-E5B9-3344-87C0-68B6B72699C7

Located in "MassStorageDriver.cpp" about line #52:
Code:
static const uint8_t mbdpGuid[16] PROGMEM = {0xA2, 0xA0, 0xD0, 0xEB, 0xE5, 0xB9, 0x33, 0x44, 0x87, 0xC0, 0x68, 0xB6, 0xB7, 0x26, 0x99, 0xC7};
@KurtE and @mjs513 has been working with this and know more about it. Sounds like Mike has ordered the same SSD to test with:)
 
Taking a quick look through, it appears like your drive is an GPT type and not MBR.

It has gone through a couple of iterations, as earlier we integrated it into Paul's version of SDFat, but when he upgraded to the more recent version of SDFat, that support
was removed. We added back in, to our code within USBHost, but could have some issues.

And the last stuff in your output shows:
Code:
> msProcessError()
14:42:26.174 -> >>USBFilesystem::check_voltype_guid(3, 0x20067fb0)
14:42:26.174 ->[COLOR="#FF0000"] E3C9E316-0B5C-4DB8-817D-F92DF00215AEUSBFilesystem - Unsupporteded GUID[/COLOR]
14:42:26.174 -> initialization failed with code: USB drive error: 0xF1,0x0 --> Type: NO_SENSE Cause: UNKNOWN ASC/ASCQ (1Bh/B1h)

Currently the only one we understand/support is: https://en.wikipedia.org/wiki/GUID_Partition_Table
https://en.wikipedia.org/wiki/Microsoft_basic_data_partition (BD0A0A2-B9E5-4433-87C0-68B6B72699C)

Yours is: E3C9E316-0B5C-4DB8-817D-F92DF00215AE
Which is a Microsoft Reserved Partition: https://en.wikipedia.org/wiki/Microsoft_Reserved_Partition

I thought we iterated over all of the GPT items looking for ones we understand.

Did you muck with this drive (i.e. change MBR to GPT)... Or did it come this way? If you look at the drive under windows (or linux) what partitions does it show in FDisk or equiv?

Thanks
Kurt

Ordered a cheap mSata setup:
https://www.amazon.com/gp/product/B095P3ZT2B
https://www.amazon.com/gp/product/B07VP2WH73
 
Last edited:
I simply put the SSD into the enclosure, closed the box and attached it to the computer.
Don't know, if it was formatted or not. The SSD is 4 years old.

Windows Explorer, right click on the name of the SSD and choose "format". There I can choose between NTFS and exFAT. No option MBR or GPT - I know these only for large harddisks.

I have a german version of Win 10 and so it looks inside "Datenträgerverwaltung" (I don't know names of english version):
SSD-500GB.png


I think the best is to forget about Teensy 4.1! :confused:
I can attach USB hub at smartphone or tablet, connect card reader and SSD to hub an copy files from SD card to SSD. It's slow with 18 MBytes/s, but it works.

Bye
Jürgen
 
I have a german version of Win 10 and so it looks inside "Datenträgerverwaltung" (I don't know names of english version):
I looked in Google Translate and it means "Disk Management".

The confusion here is that a Disk (the physical device) can have many drives (what you see as C or D or etc). These drives can be visible, as in C,D,etc or hidden as in System Reserved.

If you look in Disk Management, you will see various Disks labelled 0,1,2 etc each with a number of drives.

It sounds as if your drive at some time has been a system disk with its associated hidden "System Reserved" drive together with an accessible drive labelled C,D or whatever.

In order to get rid of the "System Reserved" drive you would have to (from within Disk Management) right click that drive and select "Delete Volume". Make sure that this "System Reserved" drive does in fact exist in the SSD we are talking about, otherwise Windows may NOT boot in the future.

Having deleted the volume you can then create a drive partition out of the free space created and format that volume as another drive. Alternatively, you should be able to expand the existing drive to take up the free space created.
 
Or see if we can find a simple fix to the code.
What version on arduino and Teensyduino are you running?

I just tried current stuff. DriveInfo did not build. Patched and see similar issues as you showed on a drive…

Then tried DriveInfoAll and it worked showing all of the partitions and files on them.

Sorry can not upload network down, post by cell…
 
I simply put the SSD into the enclosure, closed the box and attached it to the computer.
Don't know, if it was formatted or not. The SSD is 4 years old.

Windows Explorer, right click on the name of the SSD and choose "format". There I can choose between NTFS and exFAT. No option MBR or GPT - I know these only for large harddisks.

I have a german version of Win 10 and so it looks inside "Datenträgerverwaltung" (I don't know names of english version):
View attachment 29671


I think the best is to forget about Teensy 4.1! :confused:
I can attach USB hub at smartphone or tablet, connect card reader and SSD to hub an copy files from SD card to SSD. It's slow with 18 MBytes/s, but it works.

Bye
Jürgen

As BriComp mentioned this is Disk Management
Right now I am running on W11, so things are a little different:

Although I think I can get to same stuff:

I see two different utilities or settings

If I look at settings->System->Storage-> Disk and volumes
And look at the properties of the SSD drive I see:

Screenshot.png
Which shows it is a GPT type Drive:

With the Disk Managment tool: I think you can see/imply which one it is by right clicking on the drive like:
Screenshot1.png
And it shows convert to MBR... Which probably implies that it is GPT...

Most of the time you see/notice this, as this typically only set or updated, on a new raw disk without partitions, and most of the time you dont care. Except for example if you have a GPT drive and what you are trying to use it on does not support GPT. Or if you want several partitions and don't want to deal with Extended...

What is the difference?

Most (maybe all) SD cards and old Disk drives used MBR (Master Boot Record) partitioning, which
in the Master boot Record of a drive (0), there was a specific location where the drive could have up to 4 partitions.
Now if you actually wanted more than 4 partitions, there was a special type of partition, called an extended partition, where
the first record could again have up to 4 partitions.

More recently a new way to partition disk drives was created GPT - which used GUID's to identify the partition type and they linked to each other...

AS the SDFat library was written to work on SD Cards, it only supported MBR type disks, and did not support Extended partitions. And in fact, most of the stuff is geared around only having one partition, as that is/was the standard for SD Cards. We have extended the library to support other drives like flash drives and the like, so we added support for GPT as well as extended partitions. But we are still limited to Fat partitions (Fat16, Fat32, ExFat and in some cases Fat12). So far, we only support one GUID which is MicroSoft defined as holding Data...

If you get a chance you may want to try the DriveInfoAll sketch and see if it sees your data or not.

Hope that helps
 
My mSATA drive arrived today that I got from amazon along with a case:
https://www.amazon.com/dp/B08YJYNCQL?psc=1&ref=ppx_yo2ov_dt_b_product_details
https://www.amazon.com/dp/B00LRZPNHM?psc=1&ref=ppx_yo2ov_dt_b_product_details

I formatted it on the PC using Disk Manager and Partition Magic as a MBR disk with a FAT32 and exFAT partition and the T4.1 had no problem reading the drive, using the DriveInfo sketch - did had to use @KurtE's patch to make it work and the latest USBHost_T36:
Code:
Initializing USB drive 1...
Device 1 Info:
       connected: 1
     initialized: 1
   USB Vendor ID: 174c
  USB Product ID: 55aa
      HUB Number: 0
        HUB Port: 0
  Device Address: 1
Removable Device: NO
        VendorID: SABRENT 
       ProductID: ASM1153E        
      RevisionID: 0   
         Version: 6
    Sector Count: 500118191
     Sector size: 512
   Disk Capacity: 256060513792 Bytes

Partition Table
    part,boot,bgnCHS[3],type,endCHS[3],start,length
Extend:    1,0,0x20,0x21,0x0,0xF,0xFE,0xFF,0xFF,2048,500115584
FAT32:    1:1,0,0x1,0x2,0x0,0xB,0xFE,0xFF,0xFF,2112(64),236711936 (5)
exFAT:    1:2,0,0x1,0x2,0x0,0x7,0xFE,0xFF,0xFF,236716096(64),263401536 (0)
pt_#0:    2,0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0,0
pt_#0:    3,0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0,0
pt_#0:    4,0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0,0
     < unused area starting at: 500117632 length 559 >

Volume name: test1
Volume type: FAT32
Cluster Size: 32768 bytes
Volume size: 121166888960 bytes
 Space used: 131072 bytes  (1817 ms to compute)

Files:


Initializing USB drive 2...
initialization failed with code: No USB drive detected, plugged in?
USB drive error: 0x28,0x0 --> Type: NO_SENSE Cause: NO ADDITIONAL SENSE INFORMATION
NOTE did not have a second drive attached. But I did notice that it only picked up the first partition.

Using the DriveInfoAll sketch:
Code:
 === Drive index 0 found ===
       connected: 1
     initialized: 1
   USB Vendor ID: 174c
  USB Product ID: 55aa
      HUB Number: 0
        HUB Port: 0
  Device Address: 1
Removable Device: NO
        VendorID: SABRENT 
       ProductID: ASM1153E        
      RevisionID: 0   
         Version: 6
    Sector Count: 500118191
     Sector size: 512
   Disk Capacity: 256060513792 Bytes

Partition Table
	part,boot,bgnCHS[3],type,endCHS[3],start,length
Extend:	1,0,0x20,0x21,0x0,0xF,0xFE,0xFF,0xFF,2048,500115584
FAT32:	1:1,0,0x1,0x2,0x0,0xB,0xFE,0xFF,0xFF,2112(64),236711936 (5)
exFAT:	1:2,0,0x1,0x2,0x0,0x7,0xFE,0xFF,0xFF,236716096(64),263401536 (0)
pt_#0:	2,0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0,0
pt_#0:	3,0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0,0
pt_#0:	4,0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0,0
	 < unused area starting at: 500117632 length 559 >

=== File system (0) ===
	Manufacturer: SABRENT
	Product: ASM1153E
	Serial Number: 123456789E90
Volume name: test1
Volume type: FAT32
Cluster Size: 32768 bytes
Volume size: 121166888960 bytes
 Space used: 131072 bytes  (1817 ms to compute)

Files:

=== File system (1) ===
Volume name: test2
Volume type: FAT64
Cluster Size: 131072 bytes
Volume size: 134856310784 bytes
 Space used: 786432 bytes  (95 ms to compute)

Files:
which shows both partitions that I created.

So definitely would recommend running the DriveInfoAll sketch.
 
DriveInfoAll:
First I have to stop debugging information. Otherwise even a simple USB stick don't show a list of files and ends with
Code:
Descriptor 5 = ENDPOINT

Then I get those informations:
Code:
21:54:46.226 ->  === Drive index 0 found ===
21:54:46.226 -> 	 Partition 
21:54:46.226 ->        connected: 1
21:54:46.226 ->      initialized: 1
21:54:46.226 ->    USB Vendor ID: 174c
21:54:46.226 ->   USB Product ID: 55aa
21:54:46.226 ->       HUB Number: 0
21:54:46.226 ->         HUB Port: 0
21:54:46.226 ->   Device Address: 3
21:54:46.226 -> Removable Device: NO
21:54:46.226 ->         VendorID: asmedia 
21:54:46.226 ->        ProductID: ASM1351         
21:54:46.226 ->       RevisionID: 0   
21:54:46.226 ->          Version: 6
21:54:46.226 ->     Sector Count: 976773167
21:54:46.226 ->      Sector size: 512
21:54:46.226 ->    Disk Capacity: 500107861504 Bytes
21:54:46.226 -> 
21:54:46.226 -> Partition Table
21:54:46.226 -> 	part,boot,bgnCHS[3],type,endCHS[3],start,length
21:54:46.226 -> *** GPT Disk WIP ***
21:54:46.226 -> GPT guard:	1,0,0x0,0x2,0x0,0xEE,0xFE,0x7F,0x80,1,4294967295
21:54:46.226 -> pt_#0:	2,0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0,0
21:54:46.226 -> pt_#0:	3,0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0,0
21:54:46.226 -> pt_#0:	4,0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0,0
21:54:46.226 -> 	 < unused area starting at: 0 length 976773167 >
21:54:46.226 -> 
21:54:46.226 -> GPT partition header revision: 10000
21:54:46.226 -> LBAs current:1 backup:976773167 first:34 last:976773134
21:54:46.226 -> Disk GUID:E990D774-CE0C-4850-9BD3-2EB7A5AAD888Start LBA Array: 2 Count: 128 size:128
21:54:46.226 -> Part	 Type Guid, Unique Guid, First, last, attr, name
21:54:46.273 -> 0	E3C9E316-0B5C-4DB8-817D-F92DF00215AE, 7068D4A8-CE21-4640-9B7F-C534E0C30574, 34, 32767, 0, Microsoft reserved partition
21:54:46.273 -> 1	EBD0A0A2-B9E5-4433-87C0-68B6B72699C7, D0BACEA3-C9EF-4A82-AAFF-747815AA5A76, 32768, 976771071, 0, Basic data partition
21:54:46.273 -> >>> Microsoft Basic Data Partition
21:54:46.273 ->     EXFAT:
21:54:46.273 -> 
21:54:46.273 -> === File system (0) ===
21:54:46.273 -> 	Manufacturer: asmedia
21:54:46.273 -> 	Product: ASM1351
21:54:46.273 -> 	Serial Number: 0123456789012
21:54:46.273 -> Volume name: EVO500B
21:54:46.273 -> Volume type: FAT64
21:54:46.273 -> Cluster Size: 131072 bytes
21:54:46.273 -> Volume size: 500073234432 bytes
21:54:46.273 ->  Space used: 27925020672 bytes  (350 ms to compute)
21:54:46.592 -> 
21:54:46.592 -> Files:
21:54:46.592 -> 2022-10-26 13:22   1073741824 1.h2w
21:54:46.640 -> 2022-10-30 03:28           27 SSD500GB.txt
21:54:46.640 -> 
21:54:46.640 -> 
21:54:46.640 ->  *** enter any key to run again ***
 
@bustler59 - looks like it worked.

It shows one file in the 2nd logical partition. The first partition is the Microsoft Reserved Partition. The second one is the rest of the disk, and it looks like it has only one file on it.
 
@Kurt:
2 files, first with the name 1.h2w is 1 GB large, the other named SSD500GB.txt only 27 Bytes.
Code:
Files:
2022-10-26 13:22   1073741824 1.h2w
2022-10-30 03:28           27 SSD500GB.txt
 
Back
Top