Hi,
As you know that the LPC5512 has one full-speed USB, which can function as both device and host.
We provide USB stack in SDK package, you can download SDK package from the link:
https://www.nxp.com/design/software/development-software/mcuxpresso-software-and-tools-/mcuxpresso-s...
You can select the USB class example in SDK USB example for example CDC, MSC...
From hardware perspective, when the USB of LPC5512 functions as a device, when a USB cable is inserted, an USB interrupt will be fired on LPC5512 side, the host can communicate with the device and exchange the descriptor inf.
Hope it can help you
BR
XiangJun