Author Topic: Problem with transmission of multiple packets in usb  (Read 7488 times)

maheshkarrajmanda

  • Member
  • ***
  • Posts: 13
Problem with transmission of multiple packets in usb
« on: October 15, 2014, 04:07:49 am »
Hi all,
I'm working on usb module in xmc4500 device.I'm able to transmit 512bytes to a rxfifo but i'm not able to get 512bytes.can anyone please help me where i'm getting wrong.how to configure rxfifo size.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Problem with transmission of multiple packets in usb
« Reply #1 on: October 15, 2014, 09:11:15 am »
More information needed.

Is your xmc4500 functioning as a host or device?

You are unable to send 512 bytes from the xmc4500?

What happens when you attempt a transfer?

maheshkarrajmanda

  • Member
  • ***
  • Posts: 13
Re: Problem with transmission of multiple packets in usb
« Reply #2 on: October 16, 2014, 03:08:32 am »
Hi jan,
I configured xmc4500 in a device mode. And i'm using user interface tool(UI) for transmitting data to usb device(xmc4500).

i configured txfifo[1] of 512bytes, global rxfifo of 512 bytes.

For these i also configured endpoints.
TX-EP[1] is of 512bytes and direction is IN(device to host).

RX-EP[2] is of 512bytes and direction is host to device[OUT].

problem is

case 1:from ui tool[host] when i transmit 64/256/ or lessthan 512 bytes my device is not receiving the data.[OUT direction]

case 2:from ui tool when i transmit 512bytes my device is receiving [OUT] and when i transmit lessthan 448bytes from my xmc usb device to ui

tool is receiving and printing on ui tool but from xmc usb device side when i transmit morethan 448 bytes to ui tool is not receiving data(in ui tool read is blocking).

And one more thing is for ui tool tx and rx buffers are configured to 512bytes each.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Problem with transmission of multiple packets in usb
« Reply #3 on: October 16, 2014, 08:45:46 pm »
To isolate the problem, use whatever debugging tools you have to find out exactly what is happening.

For example, in case 1, is the data going out on the bus but the device firmware isn't detecting it, or is the host not sending the data?

What is the host OS? What USB class or other driver is the host using to communicate with the device?

maheshkarrajmanda

  • Member
  • ***
  • Posts: 13
Re: Problem with transmission of multiple packets in usb
« Reply #4 on: October 17, 2014, 05:01:12 am »
Data is coming on the bus

Host os is windows7.

I'm working on winusb application.

Host is using generic winusb driver for communication.

if i use DMA transfer mode i'm getting AHB error on device OUT endpoint.
if i use fifo transfer method,maybe device firmware is not receiving data.

if host sends data (no matter how many bytes are there),i need to receive but its not happening.

how to resolve it?

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Problem with transmission of multiple packets in usb
« Reply #5 on: October 17, 2014, 09:59:02 am »
If I understand correctly, the data is going out on the bus, but the device firmware isn't seeing it.

The device's data sheet and firmware should show you how the device endpoint should respond on receiving data. For example, is the endpoint armed to trigger an interrupt to tell the firmware that data has arrived, and if so, is this happening? That is where I would start.

maheshkarrajmanda

  • Member
  • ***
  • Posts: 13
Re: Problem with transmission of multiple packets in usb
« Reply #6 on: October 17, 2014, 10:28:06 am »
what u said was right.
I'm having Rxfifolevel bit (if it is set) indicates that atleast one packet is pending in rxfifo.
but i'm not getting that rxfifolvl interrupt.

maheshkarrajmanda

  • Member
  • ***
  • Posts: 13
Re: Problem with transmission of multiple packets in usb
« Reply #7 on: October 29, 2014, 01:28:58 am »
Hi jan,
i have some doubts.
1)-->when we send morethan 64bytes of data is split into multiple 64byte packts.
so,is it the hardware that split the packets or our device firmware needs to spit it.(i think firmware needs to split it up if so i kept my INEp and OUTEp buffers to 512 or i need to put to 64)

2)-->At an instant how much data i can read into rxfifo when host transmits 64bytes or more.

And whatever the points u mentioned previously in this thread,i implemented those in firmware.
so,i'm able to read and write the data.

one more problem is that when i exactly transfer 64/128/192/256/320/384/448bytes from host to device ,nothing is happening.
other than these above mentioned bytes i'm reading and writing the all the data successfully including 512bytes also.

Also i enabled zero length packet.
« Last Edit: October 29, 2014, 06:24:26 am by maheshkarrajmanda »

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Problem with transmission of multiple packets in usb
« Reply #8 on: October 29, 2014, 09:53:20 am »
These questions are dependent on your device hardware as documented in its data sheet, your OS, if any, and  your other host firmware.