AnsweredAssumed Answered

USB device driver development

Question asked by nagendra murthy on Sep 11, 2016
Latest reply on Sep 19, 2016 by nagendra murthy

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. 

Outcomes