I m writing program for USB host Virtual com port(LPC1768). May be this question found silly but this is confusing me.
Im getting frames correctly upto get line coding After that host is not responding to the device.I m continously getting NACK after every IN after get line coding.
Second issue is i can see the comp port in com port list. I installed drivers through inf file. But when i tried to open the comp port it shows "error: unable to open the com port".reasone for this is the code issue or the drivers issue.
I m bit confuse with the flow of frames in the virtual com port. can any one tell me the flow of frames.which will be the next frame after get line coding.what happened when this frame comes in a picture in hardware point of view.
Maybe see this: www.onarm.com/.../
Hii John
Thank you so much for reply. I read the link you posted in the last reply. I understood resone of getting NACK after IN. But I m not cleared with the same question i asked before. Why i m unable to open the com port.
One more thing i wanted to discuss when i tried to debug code i fund that i m not acheieving the satisfactory conditions for code to process get line coding. That is before we look for get line coding as keil example tested index (16 bit wide) of control request is not equal to control interface number ( 8 bit wide).if those are not equal it will give error.And my processing will be stopped.
if (USB_ControlRequest.wIndex != CDCInterfaceInfo->Config.ControlInterfaceNumber) return;
as interface number is not matched i m not able to ON the com port. May i get the reasone for this.
When i asked for Get_IN_line coding what happens at device.i understand that after i ask for get line coding device reply ack to host then host send IN packet.As device dont have data to send to the device it sends NACK right? But what exactly the reasone device dont have data to send. Is it possible that com port is not properly set ? because of that I m unable to open com port.
I don't know much about USB and USBCDC. I had some experience in USBCDC development, but it was long ago (2010). And during that period, I had access to an TotalPhase Beagle USB 480 Protocol Analyzer; now I have nothing.
I would suggest you to use a working well USBCDC device, and an USB Analyzer, study how it works by looking at the class level communication monitored by USB Analyzer. Comparing the difference between the working well device and your device.
What code are you using is it Keil USB CDC, if so which version, if not using Kiel what are you using?
Anyways, If device is not properly enumerated you will not see it as COM port on your Host PC.
Hiii John
This is for the first time i m looking for USB.I m using nxpUSBlib v0.98 for reference.
www.lpcware.com/.../nxpusblib-v098
U can check the condition in .zip\libraries\LPCUSBLib\Drivers\USB\Class\Device\CDCClassDevice.c line number 47.
When host ask for get line coding device should response host with the settings of com port.This sholud happen right? I tried above code it is working fine but i didnt get these comp port settings anywhere in the program. Actually the program contains lib. We have to go through C files and decode what exactly is happenning.
nxpUSBlib v0.98 is not recommended.
http://www.keil.com/forum/24814/ www.lpcware.com/.../lpc1347-virtual-com-port-questions
Maybe it is designed to not work for LPC1768. If you insist to use NXP Library, try newer version of LPCOpen.
Try this: www.lpcware.com/.../lpcopen-software-development-platform-lpc17xx-packages www.lpcware.com/.../lpcopen
Use this example: \lpcopen_2_10_keil_iar_nxp_lpcxpresso_1769\applications\lpc17xx_40xx\keil_uvision_projects\nxp_lpcxpresso_1769\nxp_lpcxpresso_1769_usbd_lib_examples.uvmpw
thanx john for your help. I m looking for this. Will let u know.
Hi john thanx for number of replies. Today i finished with USB CDC i was mistaken in end point write.That is the main reason i didnt get the answer for get line coding and other silly reasons.Any ways thanx for help. My next work is USB mass storage device(LPC1768 as a mass storage device).If u have already worked on that i need your help.