nxpUSBlib inside another project

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by lsimons on Thu Aug 23 06:25:00 MST 2012
I've gotten the nxpUSBlib VirtualSerialDevice example running on an LPCXpresso 1769 dev. board using the multiple projects per workspace approach defined by http://www.nxp-lpc.com/images/nxpUSBlib_v1_1.pdf.

For our application, it would be much easier to control the code for certification by keeping all of the source in a single project.  I have been trying to move the relevant parts of the nxpUSBlib, BSP, and CDL projects into my application project, paying heed to the compiler flags.  Everything compiles, and I can see that the USB interrupt is triggered when the USB port is plugged in.  However, unlike with the multi-project approach, the device shows up as "Unknown device."  The USB_DeviceState doesn't make it past state 2, DEVICE_STATE_Default.  A successful enumeration would be state 4, DEVICE_STATE_Configured.

I'm not too familiar with the CDL, so was wondering if that could be tripping things up.  My understanding of nxpUSBlib is that so long as the USB interrupt is hooked up properly, it should cooperate.  I've been stepping through both the single project version and the multi-project version, but am having a hard time tracking down the differences because breakpoints in the USB configuration cause Windows to fail to recognize the device even with good code.  I'd be very grateful to any tips on how to debug this or tips from someone who's gone through this.  Also, feel free to tell me if I'm barking up the wrong tree.