USB device driver development

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

USB device driver development

1,269 Views
nagendramurthy
Contributor II

Hello Everyone,

I need to develop a USB device driver. this is first time i'm working on USB protocol.

Hardware information: this is a customized board using LPC1837 controller, which two USB ports. but we are using only one USB. i'm using CMSIS USB driver to develop the code.

Compiler information: keil 5 vision 

Software Information: i'm using CMSIS USB driver to develop the code.

the problem what i'm facing is when i connect my device to PC it display a message saying unknown device connected. can anyone help me out to resolve this problem.

little information about the steps or procedure i have followed.   

i have gone through the USB protocol. the protocol has 4 types of packets. 

 1. Token 

 2. Data

 3. Handshake

 4. SOF(start of frame). 

 

i have been sending the information of DEVICE_DESCRIPTOR which contains PID and VID data, by setting the 

below is the Token struct which is sending the data to PC 

usb_Token.sync = 0x55;
usb_Token.pid=0x1E;
usb_Token.Addr = 0x01;
usb_Token.endpoint=0x01;
usb_Token.CRC5 =0x05;
usb_Token.EOP=00;

below is the data struct which is sending the data of device descriptor
usb_data.sync=0x55;
usb_data.pid=0xB4;
usb_data.Data = (uint8_t *)device0_dev_desc;
usb_data.CRC16 = 0x12;
usb_data.EOP=0x00;

both the above struct was send one after the other using CMSIS API called endpoint Transfer.

USBDDrv->EndpointTransfer(0x80,(uint8_t *)&usb_Token,6);

USBDDrv->EndpointTransfer(0x80,(uint8_t *)&usb_data,22);

if anyone need i can provide the code. 

Labels (4)
0 Kudos
Reply
2 Replies

837 Views
vicentegomez
NXP TechSupport
NXP TechSupport

Hi you can check the examples from the LPCOpen, normally this examples are installed on the following folder

C:\NXP\LPCXpresso_8.2.0_647\lpcxpresso\Examples\LPCOpen\lpcopen_2_18_lpcxpresso_nxp_lpcxpresso_1837.zip\LPCUSBlib_MassStorageHost

regards

Vicente Gomez

0 Kudos
Reply

837 Views
nagendramurthy
Contributor II

Hi Vicente, 

I have gone through that example code. but my not getting when the data (packet) which contains PID and VID information should be sent. 

0 Kudos
Reply