Hi Adarsh1
Normally the default demo code is FS USB. To change to HS USB:
Chang file :usb_device_config.h
/*! @brief LPC USB IP3511 FS instance count */
#define USB_DEVICE_CONFIG_LPCIP3511FS (0U)
/*! @brief LPC USB IP3511 HS instance count */
#define USB_DEVICE_CONFIG_LPCIP3511HS (1U)
Did you do the same?
If yes, How if works with default optimization level (-O0)? Do you mean this problem occurs when optimization change from -O0 to -O3?
Did you test O1 and O2?
Please let me know your testing result, I could get a board to test it later.
Thanks,
Jun Zhang