LPCUSBlib - USBD library confusion

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

LPCUSBlib - USBD library confusion

3,555 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by sturzi on Fri Mar 06 08:08:34 MST 2015
Hi,
I am evaluating the LPCOpen USB solutions and after reading through the documentation and looking at the code I am thoroughly confused.
Here are some of the questions that popped up, hopefully someone can provide some answers:

- Where is the documentation for LPCUSBlib? The only thing I found was for the old 1.03 release.

- LPCUSBlib supports both drivers in ROM and in software, but it is for example not included in LPCOpen for LPC11U68.
   - Are not all chips with ROM drivers supported? I assumed the USBD ROM API is the same for all of these?

- Is there an overview which USB solution supports which chips?

- What are the major differences between LPCUSBlib and the USBD library (apart from the missing host support)?

- What are the plans for the future, will one of these die, will they be merged, or coexist?

- Which one is the preferred solution to make sure upcoming chips are supported as well?

- Is there source code available for the USBD library?

Thanks
Labels (1)
8 Replies

1,773 Views
hmyoong
Contributor III

Where do you get the latest LPCUSBLib?

I only get find it from github, such as GitHub - openxc/nxpUSBlib: Fork of NXP's USB library for all LPC microcontrollers, with bug fixes 

0 Kudos

1,773 Views
hmyoong
Contributor III

I found it via google search: https://community.nxp.com/docs/DOC-334782 

1,773 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpetersen on Wed Feb 03 09:58:42 MST 2016
I am running into the same issues, attempting to get both Host and Device working on an 18xx series chip.

Are there any examples available which show how to use both USB Host (lpcusblib) and USB Device (ROM stack) together? I know there is an example for USB Host/Device together, but that uses an old version of lpcusblib which supported both host and device.

Additionally, could the USB Device support be added back into lpcusblib for future LPCOpen releases? It seems that if you wanted to use both Host and Device, they would integrate much more easily that way. There is still the USE_USB_ROM_STACK symbol (found in UsbMode.h) which would apparently allow you to specify the ROM stack if you wanted to use it.

The current version of lpcusblib includes non-existent files for USB device in USB.h, even when USE_USB_ROM_STACK is defined.
0 Kudos

1,773 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by twiddle on Tue Jun 16 15:46:53 MST 2015
I'd like to second some of these concerns.
I'm working with LPC11U35, so from what you're saying I should be using USBD/ USB ROM api.
However this is impossible to debug in its current form, which is sorta necessary given the USB_Error_Handler doesn't really have much in the way of informative parameters to convey the source of any errors encountered - or if it does they aren't documented. At least the Init() return value is meaningful. The error handler tells me the current interrupt status but in and of itself that doesn't do much to indicate the cause of an error. 

I have a copy of LPCUsbLib which works with the part in question, but you are saying this is unsupported. The LPCOpen page here still mentions LPCUSBLib: http://www.lpcware.com/lpcopen - so how are people supposed to realise that it's not supported any longer?

Please consider publishing debug symbols for the ROM API/USBD like TI does: http://www.ti.com/lit/an/slaa663/slaa663.pdf
Given the presence of a number of bugs in the LPC11U3x ROM, which still remain rather poorly documented despite NXP promising a consolidation of same, cf http://www.lpcware.com/content/forum/rom-driver-bugs-documentation , and the aforementioned troubles debugging, compounded by slow support (restricting it to the forums feels rather low-effort), it tends to push me towards a competitor's product that at least has a supported software-based stack I can debug during development - and that would be a pity because other than this I've quite liked the experience of working with LPC parts.

1,773 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by sturzi on Mon Mar 09 09:24:41 MST 2015

Quote: mc
Hi sturzi,
As mentioned by nerd_heard LPCUSBlib device stack is not supported in LPCopen,however the LPCUSBlib host stack is supported and you can see examples with this stack in LPC17xx and LPC18xx/LPC43xx LPCopen packages.



Ah, that would explain why I only found LPCUSBlib in those packages and not in LPC11xx etc.

Thanks
0 Kudos

1,773 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by sturzi on Mon Mar 09 09:22:14 MST 2015
Thanks for the clarification.


Quote: nerd herd
- USBD is the library equivalent to the USB ROM driver for most current MCUs (don't know the exact list off the top of my head, but you seem to be using the LPC11U68 and I can confirm this is the case for this particular MCU).


Can I assume that a chip is supported if there's one version of this chip which has on-chip drivers? e.g. LPC11U2x has on-chip drivers, but LPC11U1x doesn't, therefore LPC11U1x should be supported by USBD lib.


Quote: nerd herd
- Since USBD is essentially the USB ROM driver, the source code is not publicly available.


That's a shame, because it makes debugging problems quite a bit harder.
I saw a few workarounds in the example code with a reference like "WORKAROUND for artf32289 ROM driver BUG".
Is there a bug tracker or a list for these known issues available since it is pretty crucial information?


Quote: nerd herd
- LPCUSBlib is an older USB stack that we no longer support in LPCOpen but has the source code available.


So there won't be new drivers to support future chips?
Could you update the information on LPCUSBlib that it's no longer supported?
Because for example here it still says:
[list]
  [*] LPCUSBLib - an open-source USB device and host stack (upcoming support for USBD ROM API and USBD standalone library)
  [*] USBD library - a USB device library available for all NXP devices that either uses the USB ROM APIs or a library
[/list]
Which doesn't exactly sound like it is no longer supported.

Regards,
sturzi
0 Kudos

1,773 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc on Mon Mar 09 08:53:05 MST 2015
Hi sturzi,
As mentioned by nerd_heard LPCUSBlib device stack is not supported in LPCopen,however the LPCUSBlib host stack is supported and you can see examples with this stack in LPC17xx and LPC18xx/LPC43xx LPCopen packages.
0 Kudos

1,773 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nerd herd on Mon Mar 09 07:42:45 MST 2015
Hi sturzi,

The main differences between LPCUSBlib and USBD:
- USBD is the library equivalent to the USB ROM driver for most current MCUs (don't know the exact list off the top of my head, but you seem to be using the LPC11U68 and I can confirm this is the case for this particular MCU).
- Since USBD is essentially the USB ROM driver, the source code is not publicly available.
- LPCUSBlib is an older USB stack that we no longer support in LPCOpen but has the source code available.


As far as I know, the two USB stacks are very similar in what they support but ultimately unless you need to make modifications to the library source, I would advise you to use the USBD library.
0 Kudos