Thx Dat,
My mass storage interface finally work ! I believe the trick was to setup the callback below when we initialize the controller.
RemovableMedia.Insert += new InsertEventHandler(RemovableMedia_Insert);
RemovableMedia.Eject += new EjectEventHandler(RemovableMedia_Eject);
I used to do that with an [em]event.set/waitOne[/em], and the handler what initialized in the [em]Controller_MassStorageConnected[/em] handler, what I guess was not the proper way to do for timing reasons…
Now, I am back to the USB/Serial interface which is still not detected. I set up a raw device handler to see if anything pops up on that side when I plug on of my USB/Serial cable … And it happens indeed !
As far as I understands how the framework works, it means the USB device is properly detected (I checked the VID&PID using VendorId/ProductId properties of the RawDevice object), but it does not match whatever the device type criteria is to start the USBSerial driver.
Once again, I use a Prolific and a FTDI cable, which are pretty standard on the market. With the netmf 4.2, I used to have a way to force a new USBSerial object creation as show below:
UsbSerialDevice = new USBH_Device(device.ID, device.INTERFACE_INDEX, USBH_DeviceType.Serial_FTDI, device.VENDOR_ID, device.PRODUCT_ID, device.PORT_NUMBER);
UsbSerial = new USBH_SerialUSB(UsbSerialDevice, 19200, Parity.None, 8, StopBits.One);
Since my USB/Serial cables are not detected properly, what work around do I have with the 4.3 framework? I look at the USBSerial class, and there is no constructor available, meaning I can not use the same trick I used with 4.2. If there is a similar thing to do, I will be ok because I will provide my customer with the [em]U[/em]SB/Serial cable as part of the delivery package, so I can hard-code its configuration.
For your information, I output the USB descriptor of both my cables (because I assume you somehow detect the USBSerial interface based on something in the USB descriptor (VID&PID, device class, etc…))
FTDI:
[em]Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x0403 Future Technology Devices International, Ltd
idProduct 0x6015 Bridge(I2C/SPI/UART/FIFO)
bcdDevice 10.00
iManufacturer 1
iProduct 2
iSerial 3
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 32
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
MaxPower 90mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 255 Vendor Specific Subclass
bInterfaceProtocol 255 Vendor Specific Protocol
iInterface 2
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0[/em]
Prolific:
[em]Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x067b Prolific Technology, Inc.
idProduct 0x2303 PL2303 Serial Port
bcdDevice 3.00
iManufacturer 1
iProduct 2
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 39
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x000a 1x 10 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0[/em]
Thank you