Bulk End Point IN not working

Hello,

I am trying to get Bulk transfer working in USB. i can send data from host to device (out report), but my IN Report is not working.
To test the bulk transfer I am using the C# program from Jan Axelson wesbite.http://www.lvr.com/winusb.htm
I am using a sniffer program to check the end points and the program does show that i have both Input, Bulk and Output Bulk end points with max packet size of 64 bytes.
When i try to read data, i dont even seem to get an interrupt when i put a break point at USB_ISR.
I am using LPC 2478 with Keil and i modified the HID example to work with bulk.
Any ideas?

/* Endpoint, BULK In */
  USB_ENDPOINT_DESC_SIZE,            /* bLength */
  USB_ENDPOINT_DESCRIPTOR_TYPE,      /* bDescriptorType */
  USB_ENDPOINT_IN(2),                /* bEndpointAddress */
  //USB_ENDPOINT_TYPE_INTERRUPT,       /* bmAttributes */
  USB_ENDPOINT_TYPE_BULK,       /* bmAttributes */
  WBVAL(0x0040),                     /* wMaxPacketSize */
  0x00,          /* 32ms */          /* bInterval , not used in bulk*/


/* Endpoint, BULK Out */
  USB_ENDPOINT_DESC_SIZE,            /* bLength */
  USB_ENDPOINT_DESCRIPTOR_TYPE,      /* bDescriptorType */
  USB_ENDPOINT_OUT(2),               /* bEndpointAddress */
  //USB_ENDPOINT_TYPE_INTERRUPT,       /* bmAttributes */
  USB_ENDPOINT_TYPE_BULK,       /* bmAttributes */
  WBVAL(0x0040),                     /* wMaxPacketSize */      // = 64
  0x00,                                                 /* 32ms  not used in bulk*/

Parents
  • > I am trying to get Bulk transfer working in USB. i can send data from host to device (out report), but my IN Report is not working.
    > When i try to read data, i dont even seem to get an interrupt when i put a break point at USB_ISR.

    Fill the IN endpoint with a packet using USB_WriteEP(), first, outside of the endpoint ISR (callback). USB endpoint interrupt doesn't occur on IN endpoints, until your firmware passes a packet to the IN endpoint.

    Endpoint interrupt arises just when a transaction finishes successfully. For OUT endpoints, it is when the USB engine receives a packet from host. But for IN endpoints, it's when a packet, loaded by firmware, is sent to the host. That is, unless your firmware passes a packet to the IN endpoint, no endpoint interrupt occurs.

    For IN endpoint, usually, endpoint interrupt is used for block transfer of large data.
    The first packet of the block is written to the endpoint outside of the endpoint ISR, to start block transfer. Second and latter packets are filled to the IN endpoint in the endpoint ISR.

    It's similar to UART RX/TX.
    For UART RX, your firmware reads data at UART RX interrupt.
    But for UART TX, your firmware writes to the UART TX buffer, first.

    Tsuneo

Reply
  • > I am trying to get Bulk transfer working in USB. i can send data from host to device (out report), but my IN Report is not working.
    > When i try to read data, i dont even seem to get an interrupt when i put a break point at USB_ISR.

    Fill the IN endpoint with a packet using USB_WriteEP(), first, outside of the endpoint ISR (callback). USB endpoint interrupt doesn't occur on IN endpoints, until your firmware passes a packet to the IN endpoint.

    Endpoint interrupt arises just when a transaction finishes successfully. For OUT endpoints, it is when the USB engine receives a packet from host. But for IN endpoints, it's when a packet, loaded by firmware, is sent to the host. That is, unless your firmware passes a packet to the IN endpoint, no endpoint interrupt occurs.

    For IN endpoint, usually, endpoint interrupt is used for block transfer of large data.
    The first packet of the block is written to the endpoint outside of the endpoint ISR, to start block transfer. Second and latter packets are filled to the IN endpoint in the endpoint ISR.

    It's similar to UART RX/TX.
    For UART RX, your firmware reads data at UART RX interrupt.
    But for UART TX, your firmware writes to the UART TX buffer, first.

    Tsuneo

Children
More questions in this forum