usb multiple packet transmission problem

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hi all,

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

so my question is 1-> when i transmit data of 512 bytes,my device firmware needs to receive 512 bytes or 64 bytes?
bcoz in mutliple packet transfer when we send morethan 64bytes of data,it is splitted into 64byte packets.

so within single read or write call,cant i transmit or recive 512 bytes.
can anyone suggest me how to implement it.
0 Likes
5 Replies
Not applicable
Hi,

Your observation is correct: When sending more than 64bytes of data, it is split into 64byte packets.
In Descriptors.c (located under ..\Dave\Generated\src\USBD_VCOM\vc\), the Endpoint0Size is set to 64 which is the maximum support capacity.

Best regards,
Sophia
0 Likes
Not applicable
Hi,
I'm least bothered about endpoint zero.
For endpoints 1 and 2 in descriptors, max pakt size is 64bytes. so for multi packet mechanism i'm increasing those endpoint sizes.
Actually in USBD_VCOM.c i changed tx and rx buffer sizes to 512(as per my requirement).so that during set_configuration command, tx and rx endpoints and their sizes are configured.
Coz in multiple packet transfer mechanism,we can put our endpoint sizes to multiple of 64bytes.

my problem is 1-> when i transmit data of lessthan 64 bytes and greaterthan 64bytes upto 512,i'm able to read and write the data acquired.
but when i transmit exactly 64,128,192bytes i'm not able to read or write.

For these endpoints i'm using bulk transfer
what my requirement is to get transfer rate of 3 to 4mega bits/sec.
And i'm using winusb example code not the virtual com.port example.
0 Likes
Not applicable
Hi,

1) The Max. support capacity of USB stack is 64. Hence, changing of the endpoint size will not take effect.
2) As for the problem of transmitting exact 64/128/192bytes data, our colleague is looking into it, will update you once get reply.

Best regards,
Sophia
0 Likes
Not applicable
Hi,

1) As for the transmitting exact 64/128/192bytes data, our colleague has checked and confirmed it works fine. Would you pls check again?
2) As for the bulk transfers, the maximum bulk packet size is either 8, 16, 32 or 64 bytes long for full speed endpoints. There is no way to increase (refer to "USB in a Nutshell")

Best regards,
Sophia
0 Likes
Not applicable
Hi,

your problem sending exactly multiples of 64 bytes is maybe caused by an uncompleted USB transfer. USB specifies ZLPs (zero length packets) to signal the end of the transfer. With ZLP configured you have to send an extra NULL byte packet towards the receiver to signal the end of the transfer.

Best regards
0 Likes