-When a packet is classified as IN, that means from device to host. OUT is host to device.
-Control messages are sent only to endpoint 0 (which has no descriptor)
-A mass storage device has at least two additional endpoints, bulk in and bulk out.
-The interface and endpoint descriptors are not directly accessible using a GET_DESCRIPTOR transfer; do the op on the config descriptor and you'll get all of them.
-A Get Max LUN is done using a SETUP, IN and OUT packets. A bulk read uses OUT, IN, IN. A bulk write uses OUT, OUT, IN.
-Data toggle is reset to '0' at Set_Configuration request on all interrupt and bulk endpoints in enumeration. And then it toggles every time when the endpoint exchange a packet, regardless of transfer termination. It continues until the device is re-enumerated by bus reset. Another request which resets data toggle is Clear_Feature( ENDPOINT ).
-With a bulk out, be careful with the setting of the queue head and qTD data control bits.
SanDisk Sticks
These come pre-formatted:
< 2GB = FAT
4–32GB = FAT32
64GB+ = exFAT
(2014)
File Systems
Due to licensing, exFAT is not universally supported. It was designed for flash devices. It doesn’t offer symbolic or hard links? TexFAT also adds transactions.
NTFS is a journaling file system, recording metadata changes. The system is consistent in the case of crashes and allows easy rollback of changes to critical data structures on remount. A master file table stores file properties, location, access info and enables journaling.
One forum post claims that NTFS is the best option for sharing among all 3 leading desktop OSes.
2013 default system for Win 7.
FAT32 max file size is 4GB, and is not journaling or transaction based. TFAT is a driver layer modification to FAT using two versions of the table. FAT32 is the 2013 default for many USB drives. Default for Win95,98.
JFFS2 added support for NAND over JFFS. Added hard links and compression.
HFS+ is the Mac OS file system.
Linux Hotplug
Typically the system should either be using /sbin/hotplug pointed to by /proc/sys/kernel/hotplug (https://docs.kernel.org/driver-api/usb/hotplug.html), or the udev library (https://bootlin.com/doc/legacy/udev/udev.pdf).
Links
http://www.beyondlogic.org/usbnutshell/usb1.shtml
UART
USB serial or USB UART is often implemented using the USB CDC (communications device class) type. Here is some sample PIC driver code showing this:
// This is a sample implementation. The function is not called by the application.
BOOL USBUARTInit (unsigned long flags)
{
memset(&gCdcSer, 0, sizeof(gCdcSer));
// Initialize an state necessary
gCdcSer.flags = flags & CDC_FLAGS_INIT_MASK;
// Perform other initialization as necessary
return TRUE;
}
// Sample Function Driver Table Entry:
// USB CDC Serial Emulation Function Driver
{
USBUARTInit,// Init routine
USBUARTEventHandler,// Event routine
0 // Init flags
}, // Additional entries may follow.