USB Hid in LPC1769

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

USB Hid in LPC1769

1,689 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by koceila882 on Sat May 26 13:38:27 MST 2012
hello every body
I have a problem with USB Hid in LPC1769 exactly I don't know how can I read with USB Hid? and how can I use this command
(USBHwEPRead(U8 bEP, U8 *pbBuf, int iMaxLen))

is there anyone can help me ??

thank you
0 Kudos
Reply
8 Replies

1,600 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by marian99 on Wed Dec 05 11:59:03 MST 2012
Hi guys,

        I have the exact same issue. I'm using RDB1768cmsis2_usb_serial example. Everything works fine with terminal, but always in debug mode.

That's to say the debug cable connected to LPC-Stick for LPC1769 by Embedded Artist and also the USB cable connected to my hardware.

Any ideas??

BR,
0 Kudos
Reply

1,600 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by koceila882 on Mon May 28 14:28:25 MST 2012
thank you very much my friend thank you for your encouragement
the virtual com program works very well I deleted all the printf
thank you again
0 Kudos
Reply

1,600 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Sun May 27 22:51:38 MST 2012

Quote: koceila882

I do not know how to modify the discriptor I think it is not easy


Not easy but also not that difficult, there are enough samples in the USB specifications on how this is done. Together with the available examples this is not that impossible.

Quote: koceila882

I also used the virtual COM but it only works in debug. ie when I disconnected my device and I reconnect it does not work

what do you suggest me?


That's easy.
If you look at the code of the example you might discover that there is just one USB connect call in the program. What do you think would happen if you disconnect the USB stack and then reconnect again ?

Rob
0 Kudos
Reply

1,600 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by koceila882 on Sun May 27 12:20:40 MST 2012
thank you for your response
I do not know how to modify the discriptor I think it is not easy

I also used the virtual COM but it only works in debug. ie when I disconnected my device and I reconnect it does not work

what do you suggest me?
0 Kudos
Reply

1,600 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Sun May 27 05:29:39 MST 2012

Quote: gbm
The function in question is used in every example


Not in every example.
Looks like LPCUSB, see: bertrik.sikken.nl/lpcusb/usbapi_8h.html
and even in the LPCUSB stack it is not used in every example.

The HID example is an [I][B]i[/B][/I][B][I]nput[/I][/B] only example so it is used to send data from the device to the host. Hence you'll not see any calls to USBHwEPRead since from a device point of view we only write to endpoints.

The RDB1768cmsis2_usb_serial example shows the use of USBHwEPRead (in the BulkOut() function) and USBHwEPWrite is used in BulkIn().

If you want to create a full HID with output, you will need to change the device descriptors, interface descriptor, the HID descriptor and add the appropriate endpoints. Once this is all working you can start reading from the defined endpoints as also done in the usb_serial example.
Also, don't forget to add the appropriate device driver on the host.

Start by reading (and understanding...) the USB specifications, create the appropriate descriptors and the device driver (in that order) and use a USB analyzer to see that it works as expected.
This is not a simple task to do and also not something that we can help a lot with: you will need to have a fair bit of knowledge about USB before being able to get this working.

Alternatively, use the usb_serial example and develop your device using a virtual COM port. For this device drivers (windows, OS-X and linux) are available and the example is a very good starting point.

Rob
0 Kudos
Reply

1,600 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gbm on Sun May 27 03:22:38 MST 2012
The function in question is used in every example - look at the files implementing device classes.
0 Kudos
Reply

1,600 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by koceila882 on Sun May 27 02:04:09 MST 2012
I have seen every example, but there is not an example of how to read usb

I want to know how to use (USBHwEPRead(U8 bEP, U8 *pbBuf, int iMaxLen))
0 Kudos
Reply

1,600 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Sat May 26 23:44:28 MST 2012
Have you looked at the examples that come with the LPCXpresso tools?
Which stack are you trying to use (ROM version, Keil stack, USBLPC) ?

There are a number of USB device examples implementing different types of devices.
These should get you going fairly quickly.
0 Kudos
Reply