Question
USB bulk in interrupt missing
Posted on June 09, 2010 at 03:59
Hi all,
I am debugging a device which connects to PC through USB cable. On PC side, this USB device has been enumerated as a serial port. It works now, I can see the new COM4 has appeared. The problem is through the Hyperterminal, I can send many key strokes to device, but there is no data been sent back. I am using end point1 to transmit, end point 3 to receive data. Through the JTAG, I can see the end point 1's transmission byte counter been set to 1, 1 byte data been write to PMA end point 1's transmission address, end point 1 register's STAT TX[1:0] been set to '11' which means valid. The code is: u32 VCOM_Send(BYTE* buf, u32 len) { if(len > USBCOMMS_PORT_DATA_SIZE) { remainData = len - USBCOMMS_PORT_DATA_SIZE; len = USBCOMMS_PORT_DATA_SIZE; } UserToPMABufferCopy(buf, ENDP1_TXADDR, len); SetEPTxCount(ENDP1, len); SetEPTxValid(ENDP1); return 0; } But there is no interrupt happens after the VCOM_Send(). At the same time, the bit DTOG_TX and bit CTR TX in end point 1 register are all cleared which should be set by hardware. The end point descriptor is: /*Endpoint 3 Descriptor*/ 0x07, /* bLength: Endpoint Descriptor size */ USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType: Endpoint */ 0x03, /* bEndpointAddress: (OUT3) */ 0x02, /* bmAttributes: Bulk */ USBCOMMS_PORT_DATA_SIZE, /* wMaxPacketSize: */ 0x00, 0x00, /* bInterval: ignore for Bulk transfer */ /*Endpoint 1 Descriptor*/ 0x07, /* bLength: Endpoint Descriptor size */ USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType: Endpoint */ 0x81, /* bEndpointAddress: (IN1) */ 0x02, /* bmAttributes: Bulk */ USBCOMMS_PORT_DATA_SIZE, /* wMaxPacketSize: */ 0x00, 0x00 /* bInterval: ignore for Bulk transfer */ Is there any one can give any clues that I can go further to find the problem? Thanks in advance! Dawei