USB on-chip drivers

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

USB on-chip drivers

328 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ECamino on Wed Jun 19 09:17:44 MST 2013
Hi, I'm using an LPC1347. When I want to send data larger than the ep data packet size, I thought the SIE breaks the data into multiple packets. Is that not the case?

UsbApi->hw->WriteEP(hUsb, HID_EP_IN, (pDATA->api_buff), 4) // works when the ep packet size is 4

UsbApi->hw->WriteEP(hUsb, HID_EP_IN, (pDATA->api_buff), [COLOR=red]25[/COLOR]) // USB pipe abort and no data sent

EC
0 Kudos
Reply
3 Replies

317 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tsuneo on Thu Jun 20 09:37:43 MST 2013

Quote:
For IN endpoints this is the number of bytes that must be transmitted.
HW decrements this value with the packet size every time when a packet is successfully transferred.

Doesn't this mean that the SIE breaks up the size of the data into the correct packet size?

When I read the description first time, I thought like you.
But I noticed that the SIE doesn't have any register for MPS (Max Packet Size) of each endpoint. Without knowing MPS, the SIE cant't split a transfer into transactions.
And then, I believe above description would be mistakenly left after SIE feature change.

Tsuneo
0 Kudos
Reply

317 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ECamino on Thu Jun 20 05:51:00 MST 2013
Sorry, still confused:

From UM10524 Rev.4, table 165:

[FONT=Arial][FONT=Arial][LEFT]NBytes RW For OUT endpoints this is the number of bytes that can be received in this buffer.

For IN endpoints this is the number of bytes that must be transmitted.
HW decrements this value with the packet size every time when a packet is successfully transferred.[/LEFT]

Doesn't this mean that the SIE breaks up the size of the data into the correct packet size?  If I want to send 25 bytes on an ep with a 4-byte packet size, isn't the SIE supposed to break up the data into 7 packets with the last packet having 1 byte of data payload?

EC
[/FONT][/FONT]
0 Kudos
Reply

317 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tsuneo on Wed Jun 19 13:26:22 MST 2013

Quote:
When I want to send data larger than the [B]report size[/B]

PC HID driver determines the buffer size of the interrupt IN endpoint, according to the greatest report size among the input reports on the report descriptor. It's because the host can't tell which one comes from device, until the device finishes the IN transfer. Therefore, the interrupt IN transfer greater than the greatest report causes overflow on the host controller. This error should result in pipe abort on the host side.

Tsuneo
0 Kudos
Reply