what are posssible causes? does it matter the hardware?
in USBDevIntEn CC_EMPTY_EN and CD_FULL_EN are 0s
this is the current USB setup:
void USB_Setup(void (*InReport)(), void (*OutReport)())
{
volatile int n;
HidDevInfo.idVendor = USB_VENDOR_ID;
HidDevInfo.idProduct = USB_PROD_ID;
HidDevInfo.bcdDevice = USB_DEVICE;
HidDevInfo.StrDescPtr = (uint32_t)&USB_StringDescriptor[0];
HidDevInfo.InReportCount = 2;
HidDevInfo.OutReportCount = 2;
HidDevInfo.SampleInterval = 0x20;
HidDevInfo.InReport = InReport;
HidDevInfo.OutReport = OutReport;
DeviceInfo.DevType = USB_DEVICE_CLASS_HUMAN_INTERFACE;
DeviceInfo.DevDetailPtr = (uint32_t)&HidDevInfo;
/* Use pll and pin init function in rom */
(*rom)->pUSBD->init_clk_pins();
/* insert a delay between clk init and usb init */
for (n = 0; n < 75; n++) {}
(*rom)->pUSBD->init(&DeviceInfo); /* USB Initialization */
(*rom)->pUSBD->connect(true); /* USB Connect */
}
LPC_SYSCON->SYSAHBCLKCTRL |= (EN_GPIO |
EN_TIMER32_0 |
EN_TIMER32_1 |
EN_USBREG |
EN_IOCON |
EN_UART);