LPC1347 with control packets >64bytes

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

LPC1347 with control packets >64bytes

712 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by alesvicic on Sun Oct 20 10:35:04 MST 2013
Hi,

did anybody tried this?

What do I have to change to make it work?

Ales

Labels (1)
0 Kudos
7 Replies

682 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by alesvicic on Tue Nov 05 10:05:35 MST 2013
-------------------------------------
0 Kudos

682 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by alesvicic on Wed Oct 23 14:12:31 MST 2013
Hi Tsuneo,

it looks more and more as my old implementation on LPC17xx.

Thank you for your help.

Ales
0 Kudos

682 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tsuneo on Wed Oct 23 10:18:45 MST 2013
look in giedrius's code on his post, Mon, 2013-07-22 06:55
http://www.lpcware.com/content/forum/readep-does-not-work-custom-usb-class#comment-1131034

It's better than my implementation ;-)

A couple of notes,

On "case USB_EVT_SETUP:"
- parse the Setup packet to identify the request
- pCtrl->EP0Data.pData: assign a buffer to be sent to host (Control Read Transfer), or to receive data (Control Write transfer).
- pCtrl->EP0Data.Count: assign the number of bytes to be sent, or to recieve.

On "case USB_EVT_OUT:"
- Control Write transfer comes here at DATA stage, every time a packet has been received.
- The ROM driver subtracts the packet size from pCtrl->EP0Data.Count, before it calls custom EP0_hdlr()

On "case USB_EVT_IN:"
- Control Read transfer comes here at DATA stage, , every time a packet has been sent.
- The ROM driver subtracts the packet size from pCtrl->EP0Data.Count, before it calls custom EP0_hdlr()

Tsuneo
0 Kudos

682 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by alesvicic on Tue Oct 22 13:12:52 MST 2013
Hi Tsuneo,

thank you for this info.

I already took care about GetMemSize.

So I need a custom EP0 handler as I thought.

Do you know can I use ROM DataInStage or do I have to customize it?

Ales
0 Kudos

682 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tsuneo on Tue Oct 22 11:54:07 MST 2013

Quote:
I tried to convert it to LPC1347 ROM CDC driver but it seems that ROM driver it was not ment to handle control packets > USB_MAX_PACKET0 (in this case 64 bytes).


LPC1347 has the same ROM-Driver interface and the same USB engine as LPC11U2x/3x
These topics on LPC11U2x/3x ROM-Driver are directly applied to LPC1347, too.

A custom EP0 handler for control transfer was discussed on this topic, which can exchange DATA stage of more than bMaxPacketSize0 (EP0 max packet size).

ReadEp does not work on custom USB class
http://www.lpcware.com/content/forum/readep-does-not-work-custom-usb-class

Also, beware of this bug, when the ROM-Driver is applied.

hw->Init and hw->GetMemSize return seemingly incorrect values
http://www.lpcware.com/content/forum/hw-init-and-hw-getmemsize-return-seemingly-incorrect-values

Tsuneo
0 Kudos

682 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by alesvicic on Tue Oct 22 08:28:08 MST 2013
Hi,

this is confusing.

I had an CDC RNDIS application running on LPC2368 and LPC1768 running as USB 1.1 with 8 bytes as USB_MAX_PACKET0.

I tried to convert it to LPC1347 ROM CDC driver but it seems that ROM driver it was not ment to handle control packets > USB_MAX_PACKET0 (in this case 64 bytes).

In RNDIS case the first packet you came across is CDC_GetEncpsResp with max. size of 136 bytes (IN direction).

If I look at the application for LPC23xx and LPC17xx it took care about this in DataInStage function.

Ales

0 Kudos

682 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rocketdawg on Tue Oct 22 08:11:20 MST 2013
USB 2.0 Full Speed can not have control packets > 64 bytes.
what are you trying to do?
0 Kudos