Composite devices on NXPUSBlib

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Composite devices on NXPUSBlib

775 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Muis on Wed Jan 16 10:18:14 MST 2013
There are some examples on how to create composite devices for the Keil USB rom drivers, but none for NXPUSBlib. Suppose I succeed to merge the descriptors so that enumeration sees HID+MSC devices, is this even reliable? Because there is only a single buffer for all endpoints (in and out)? For example when I'm reading from the MSC device and writing to the HID device at the same time, data should not get corrupted. Anyone tested this?
Labels (1)
0 Kudos
4 Replies

646 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by fariouche on Thu Jan 02 09:03:27 MST 2014
hello,

I know, this thread is one year old, but in case this helps, I've posted a series of patches to fix the limitations.
Check this forum for them

Hpe this help
0 Kudos

646 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by danhauck on Fri Mar 15 02:21:49 MST 2013
Hello nxpteam, is there anybody out there who could answer the question? Or better who could fix the problem?

regards

Daniel
0 Kudos

646 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Muis on Thu Jan 17 05:47:23 MST 2013
I think it's weird that LUFA supports this, and NXPUSBlib (which is just a re-branded version of LUFA) doesn't. I hope they implement support for this soon.

Offtopic: The reason why I cannot use the USB rom drivers, is that I'm creating a Mass Storage device, and when using the ROM drivers, all I get is MSC_Read callbacks, instead of the raw SCSI commands. The callbacks from the USB ROM only requests 64 bytes each time (the endpoint size), and don't tell me the total number of sectors requested by the host. So I cannot do fast multi-sector reads on SPI, since I have no idea how many sectors are requested. The only way to solve this would be some predictive caching mechanism, for example that when the first 64 bytes are requested, the host will most likely request the next 8 sector (* 512 bytes) also, but its not a clean solution.
0 Kudos

646 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tsuneo on Thu Jan 17 03:46:29 MST 2013
<i>> Suppose I succeed to merge the descriptors so that enumeration sees HID+MSC devices, is this even reliable?</i>

Descriptor work is not enough.
You have to combine handlers of class-specific requests for these classes.
Also, as you pointed out, current version of NXPUSBlib (v0.98b) supports just single IN and single OUT endpoint, other than the default EP. To support more endpoints, you have to touch to these routines, so that these routines refer to specific buffer for the target endpoint.

usb_data_buffer_IN - Endpoint_Write_8(), Endpoint_ClearIN(), USB_ProcessInterrupt()
usb_data_buffer_OUT - Endpoint_ConfigureEndpoint(), Endpoint_Read_8(), Endpoint_ClearOUT(), etc.

Easiness of making composite device, especially for a composite device of the same class like HID + HID, is one of criteria to estimate maturity of the USB stack. In this aspect, LPC11Uxx USB on-chip drivers goes much more advanced than NXPUSBlib.

Tsuneo
0 Kudos