This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

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
  • Hi Tsuneo,

    >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.

    This is exactly what i am trying to do. I have about 127 bytes of data (status message) that i want to transfer from device to PC everytime i hit the read button on the PC App. Like you mentioned above i sent 64 bytes of 0s outside the ISR, and the latter packet of 63 bytes in the endpoint ISR.
    But in the PC App (that i got from Jan Alexons website), even after changing the "bytesToRead" to 127 bytes, it reads only first the 64 bytes and reads the next 63 bytes when i hit the read button again.
    Can i call the USB_Write function in the main loop? or is there some time i need to wait between every USB_write function calls?

    Thanks,
    Nav

Reply
  • Hi Tsuneo,

    >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.

    This is exactly what i am trying to do. I have about 127 bytes of data (status message) that i want to transfer from device to PC everytime i hit the read button on the PC App. Like you mentioned above i sent 64 bytes of 0s outside the ISR, and the latter packet of 63 bytes in the endpoint ISR.
    But in the PC App (that i got from Jan Alexons website), even after changing the "bytesToRead" to 127 bytes, it reads only first the 64 bytes and reads the next 63 bytes when i hit the read button again.
    Can i call the USB_Write function in the main loop? or is there some time i need to wait between every USB_write function calls?

    Thanks,
    Nav

Children
No data