LPC2368 - USBHwEPWrite doesn't write on SIE?

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by cyba on Fri Sep 04 08:32:47 MST 2015
Hi, I have a problem with a project based on the LPC2368  micro and the LPCUSB stack (the same stack used on the CMSIS2 examples for the LPC17xx family too).
The project makes a custom USB communiction with a Windows application in the host PC, using 4 Bulk Endpoint (2 IN and 2 Out). Everithing work well with USB2.0 ports on all windows o.s. and different USB mainboard hardware, but with USB3.0 ports the communication hangs.
With USB3.0 the device is correctly enumerated, windows load the right driver and the host application starts the communication sending a command to the LPC2368 with a BulkOut endpoint message, I've found that the problem is with a USBHwEPWrite function that should answer to this command: the USBHwEPWrite seems to write the data buffer to the SIE but with a USB sniffer I can't see the message (and the host app also crash).
This is a part of code to explain what I mean ( BULK_CMD_IN_EP 0x82, BULK_CMD_OUT_EP 0x05), the function GetUSBCmd() is called in the BULKOUT handler:

void GetUSBCmd(void)
       /* here I receive the host command */
iLen = USBHwEPRead(BULK_CMD_OUT_EP, abBulkBuf, sizeof(abBulkBuf));
        if( .... ) {
            here I make some controls on the command received from the host
            and If it is correct I reply with a confirmation message that I send here after
   iLen = USBHwEPWrite(BULK_CMD_IN_EP, abBulkBuf, 0x10);

Just to understand what happen I've traced the status of the EP with some debug string messages and i've found that with USB3.0 after the USBHwEPWrite instruction the count of transferred bytes iLen seems to be correct but I can't see any message on the usb (checked with a sniffer).
Also I've tryied to analyze the EP status with  the instruction:
EPStatus = USBHwEPGetStatus(BULK_CMD_IN_EP);
but I have some problems with the meaning of the reported answer (maybe I'm just stupid but I can't find this info on LPC2368 manual)...
Someone has any idea or can help me with this issue?