EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

VirtualCOM port Host side-Driver problem- PLPU-S2K

Started by Yusuf Husainy June 10, 2013
Hello all,

I am working on Virtual COM port driver for a LPC2148 based Board. I have a custom board, and have slightly modified the code for the VirtualCOM driver hosted on this mailing list for LPC2148.
1.
Now, when I connect my device, the Host driver install correctly, and creates two Virtual COM ports - COM9, COM10.

Initially, I have configured UART0(COM7) to 9600 for debug messages.

Then I connect COM9 with 9600 baud rate, so after this, COM9 is connected to COM7(UART0), but when I type anything on COM9, garbage data gets printed on COM7.

I thought this was a baudrate problem, so I changed the baudrate of COM9 to 38400, leaving the baudrate of COM7 at 9600 only.

After this, it worked like a charm, I was able to send and receive data simultaneously, on both sides.

So, my question is, why is this happening, why can't the COM9 operate at 9600 correctly.

2.
The other problem is, when I disconnect my device(plugging out the USB cable from my device), The host side VCOM driver does not get unloaded automatically. Due to this, If I try to connect the device again, Windows pops out a message, that the USB device is unrecognised and has malfunctioned. This does not go away until I restart my PC.

I had also thought an easier way way to solve this problem would be to just go to Device Manager and uninstall the driver, instead of restarting my PC. But, if I try to do this, i.e., Uninstall the driver for COM9, in device manager, Windows crashes, and reboots automatically, every single time.

I suspect this is a problem with the Windows side Host VCOM driver.

I am stuck with these two problems, I would appreciate any help.

Regards,
Yusuf Husainy.



An Engineer's Guide to the LPC2100 Series

Before you unplug the device you need to make sure that the virtual port is closed, in other words close your serial terminal program. My problem with almost all USB serial ports is that they fail when I forget to close the port before disconnecting them.

Although I can usually get it working again by closing my serial terminals and then unplugging the device again. Wait a while and then plug it in again.

--
Kevin
--- In l..., Yusuf Husainy wrote:
>
> Hello all,
>
> I am working on Virtual COM port driver for a LPC2148 based Board. I have a custom board, and have slightly modified the code for the VirtualCOM driver hosted on this mailing list for LPC2148.
>
>
> 1.
> Now, when I connect my device, the Host driver install correctly, and creates two Virtual COM ports - COM9, COM10.
>
> Initially, I have configured UART0(COM7) to 9600 for debug messages.
>
> Then I connect COM9 with 9600 baud rate, so after this, COM9 is connected to COM7(UART0), but when I type anything on COM9, garbage data gets printed on COM7.
>
> I thought this was a baudrate problem, so I changed the baudrate of COM9 to 38400, leaving the baudrate of COM7 at 9600 only.
>
> After this, it worked like a charm, I was able to send and receive data simultaneously, on both sides.
>
> So, my question is, why is this happening, why can't the COM9 operate at 9600 correctly.
>
> 2.
> The other problem is, when I disconnect my device(plugging out the USB cable from my device), The host side VCOM driver does not get unloaded automatically. Due to this, If I try to connect the device again, Windows pops out a message, that the USB device is unrecognised and has malfunctioned. This does not go away until I restart my PC.
>
> I had also thought an easier way way to solve this problem would be to just go to Device Manager and uninstall the driver, instead of restarting my PC. But, if I try to do this, i.e., Uninstall the driver for COM9, in device manager, Windows crashes, and reboots automatically, every single time.
>
> I suspect this is a problem with the Windows side Host VCOM driver.
>
> I am stuck with these two problems, I would appreciate any help.
>
> Regards,
> Yusuf Husainy.
>
>
>

Hi Kevin,

That worked for me. Windows does not crash now.

But, now, Windows does not recognise the device at all. Earlier, at the first time, it could detect it, now, that also does not happen.

I saw in the device manager, the entry for the unknown device is there under the USB controllers field, in the details tab, the vendor id and product shown is 0, however, the actual vendor id and product id in the PLPU-S2K.INI file, and in my device descriptor match. 

Maybe, the host is not able to read the descriptor correctly, so it shows a vendor id and product id of 0.

________________________________
From: Kevin
To: l...
Sent: Monday, 10 June 2013 5:29 PM
Subject: [lpc2000] Re: VirtualCOM port Host side-Driver problem- PLPU-S2K

 
Before you unplug the device you need to make sure that the virtual port is closed, in other words close your serial terminal program. My problem with almost all USB serial ports is that they fail when I forget to close the port before disconnecting them.

Although I can usually get it working again by closing my serial terminals and then unplugging the device again. Wait a while and then plug it in again.

--
Kevin

--- In l..., Yusuf Husainy wrote:
>
> Hello all,
>
> I am working on Virtual COM port driver for a LPC2148 based Board. I have a custom board, and have slightly modified the code for the VirtualCOM driver hosted on this mailing list for LPC2148.
>
>
> 1.
> Now, when I connect my device, the Host driver install correctly, and creates two Virtual COM ports - COM9, COM10. 
>
> Initially, I have configured UART0(COM7) to 9600 for debug messages. 
>
> Then I connect COM9 with 9600 baud rate, so after this, COM9 is connected to COM7(UART0), but when I type anything on COM9, garbage data gets printed on COM7.
>
> I thought this was a baudrate problem, so I changed the baudrate of COM9 to 38400, leaving the baudrate of COM7 at 9600 only.
>
> After this, it worked like a charm, I was able to send and receive data simultaneously, on both sides.
>
> So, my question is, why is this happening, why can't the COM9 operate at 9600 correctly.
>
> 2.
> The other problem is, when I disconnect my device(plugging out the USB cable from my device), The host side VCOM driver does not get unloaded automatically. Due to this, If I try to connect the device again, Windows pops out a message, that the USB device is unrecognised and has malfunctioned. This does not go away until I restart my PC.
>
> I had also thought an easier way way to solve this problem would be to just go to Device Manager and uninstall the driver, instead of restarting my PC. But, if I try to do this, i.e., Uninstall the driver for COM9, in device manager, Windows crashes, and reboots automatically, every single time.
>
> I suspect this is a problem with the Windows side Host VCOM driver.
>
> I am stuck with these two problems, I would appreciate any help.
>
> Regards,
> Yusuf Husainy.
>
>
>




I'm not familiar with the example you used, i used an example from IAR which worked reasonably well. Although I had to convert it from IAR to GCC and get it to work with FreeRTOS.

Make sure that your soft-connect, the switchable pullup on the D+ line, works.

If you have a USB-analyzer i suggest you use it, or see if you can borrow one. It helped me a lot to get it working.

If your device is self-powered you could try restarting your device after disconnecting it from the pc. If that works, than you might have a problem with your disconnect/connect routines.

--
Kevin
--- In l..., Yusuf Husainy wrote:
>
> Hi Kevin,
>
> That worked for me. Windows does not crash now.
>
> But, now, Windows does not recognise the device at all. Earlier, at the first time, it could detect it, now, that also does not happen.
>
> I saw in the device manager, the entry for the unknown device is there under the USB controllers field, in the details tab, the vendor id and product shown is 0, however, the actual vendor id and product id in the PLPU-S2K.INI file, and in my device descriptor match. 
>
> Maybe, the host is not able to read the descriptor correctly, so it shows a vendor id and product id of 0.
>
>
>
>
> ________________________________
> From: Kevin
> To: l...
> Sent: Monday, 10 June 2013 5:29 PM
> Subject: [lpc2000] Re: VirtualCOM port Host side-Driver problem- PLPU-S2K
>
>
>
>  
> Before you unplug the device you need to make sure that the virtual port is closed, in other words close your serial terminal program. My problem with almost all USB serial ports is that they fail when I forget to close the port before disconnecting them.
>
> Although I can usually get it working again by closing my serial terminals and then unplugging the device again. Wait a while and then plug it in again.
>
> --
> Kevin
>
> --- In l..., Yusuf Husainy wrote:
> >
> > Hello all,
> >
> > I am working on Virtual COM port driver for a LPC2148 based Board. I have a custom board, and have slightly modified the code for the VirtualCOM driver hosted on this mailing list for LPC2148.
> >
> >
> > 1.
> > Now, when I connect my device, the Host driver install correctly, and creates two Virtual COM ports - COM9, COM10. 
> >
> > Initially, I have configured UART0(COM7) to 9600 for debug messages. 
> >
> > Then I connect COM9 with 9600 baud rate, so after this, COM9 is connected to COM7(UART0), but when I type anything on COM9, garbage data gets printed on COM7.
> >
> > I thought this was a baudrate problem, so I changed the baudrate of COM9 to 38400, leaving the baudrate of COM7 at 9600 only.
> >
> > After this, it worked like a charm, I was able to send and receive data simultaneously, on both sides.
> >
> > So, my question is, why is this happening, why can't the COM9 operate at 9600 correctly.
> >
> > 2.
> > The other problem is, when I disconnect my device(plugging out the USB cable from my device), The host side VCOM driver does not get unloaded automatically. Due to this, If I try to connect the device again, Windows pops out a message, that the USB device is unrecognised and has malfunctioned. This does not go away until I restart my PC.
> >
> > I had also thought an easier way way to solve this problem would be to just go to Device Manager and uninstall the driver, instead of restarting my PC. But, if I try to do this, i.e., Uninstall the driver for COM9, in device manager, Windows crashes, and reboots automatically, every single time.
> >
> > I suspect this is a problem with the Windows side Host VCOM driver.
> >
> > I am stuck with these two problems, I would appreciate any help.
> >
> > Regards,
> > Yusuf Husainy.
> >
> >
> >
>
>
>
>
>
>

Hi Kevin,

You were right, I consulted with the hardware engineers, and found out, that the pull ups(D+ and D-) were connected to +Vcc simultaneously(I was using a switch to switch between full-speed and low-speed). I am using the Keil IDE and the example Philips had given..

I can connect and then disconnect the device. But if I try to connect it again, without resetting my board, windows does not recognise it. I have to reset the board, and then reconnection will take place successfully. 

Now, when the device is connected, I can communicate between the VCOM and UART0. I configure VCOM(COM9) to 9600, and then UART0(COM7) to 9600. 

If It try to communicate, garbage values are displayed on both the COM ports.

However, If I set the baudrate of COM9 to 38400, leaving COM7 unchanged, communication takes place flawlessly. 

What I don't understand is How the Host side VirtualCOM driver of Philips works, I mean, If I set COM9 to a particular Baudrate(say 9600), then this is communicated as a Vendor request to the device, and I presume, this request calls a function which actually sets the baudrate of the LPC2148's UART0 to 9600. So, If I have the COM7(connected to UART0) set at 9600, no change should take place. So, what does actually happen if I set the baudrate of the COM9 to a particular value?(I mean, down below, the physical link is USB FullSpeed, at 12Mbps max, and the VCOM Bulk transfer would get a part of it.)
________________________________
From: Kevin
To: l...
Sent: Tuesday, 11 June 2013 12:46 PM
Subject: [lpc2000] Re: VirtualCOM port Host side-Driver problem- PLPU-S2K

 
I'm not familiar with the example you used, i used an example from IAR which worked reasonably well. Although I had to convert it from IAR to GCC and get it to work with FreeRTOS.

Make sure that your soft-connect, the switchable pullup on the D+ line, works.

If you have a USB-analyzer i suggest you use it, or see if you can borrow one. It helped me a lot to get it working.

If your device is self-powered you could try restarting your device after disconnecting it from the pc. If that works, than you might have a problem with your disconnect/connect routines.

--
Kevin

--- In l..., Yusuf Husainy wrote:
>
> Hi Kevin,
>
> That worked for me. Windows does not crash now.
>
> But, now, Windows does not recognise the device at all. Earlier, at the first time, it could detect it, now, that also does not happen.
>
> I saw in the device manager, the entry for the unknown device is there under the USB controllers field, in the details tab, the vendor id and product shown is 0, however, the actual vendor id and product id in the PLPU-S2K.INI file, and in my device descriptor match. 
>
> Maybe, the host is not able to read the descriptor correctly, so it shows a vendor id and product id of 0.
>
>
>
>
> ________________________________
> From: Kevin
> To: l...
> Sent: Monday, 10 June 2013 5:29 PM
> Subject: [lpc2000] Re: VirtualCOM port Host side-Driver problem- PLPU-S2K
>
>
>
>  
> Before you unplug the device you need to make sure that the virtual port is closed, in other words close your serial terminal program. My problem with almost all USB serial ports is that they fail when I forget to close the port before disconnecting them.
>
> Although I can usually get it working again by closing my serial terminals and then unplugging the device again. Wait a while and then plug it in again.
>
> --
> Kevin
>
> --- In l..., Yusuf Husainy wrote:
> >
> > Hello all,
> >
> > I am working on Virtual COM port driver for a LPC2148 based Board. I have a custom board, and have slightly modified the code for the VirtualCOM driver hosted on this mailing list for LPC2148.
> >
> >
> > 1.
> > Now, when I connect my device, the Host driver install correctly, and creates two Virtual COM ports - COM9, COM10. 
> >
> > Initially, I have configured UART0(COM7) to 9600 for debug messages. 
> >
> > Then I connect COM9 with 9600 baud rate, so after this, COM9 is connected to COM7(UART0), but when I type anything on COM9, garbage data gets printed on COM7.
> >
> > I thought this was a baudrate problem, so I changed the baudrate of COM9 to 38400, leaving the baudrate of COM7 at 9600 only.
> >
> > After this, it worked like a charm, I was able to send and receive data simultaneously, on both sides.
> >
> > So, my question is, why is this happening, why can't the COM9 operate at 9600 correctly.
> >
> > 2.
> > The other problem is, when I disconnect my device(plugging out the USB cable from my device), The host side VCOM driver does not get unloaded automatically. Due to this, If I try to connect the device again, Windows pops out a message, that the USB device is unrecognised and has malfunctioned. This does not go away until I restart my PC.
> >
> > I had also thought an easier way way to solve this problem would be to just go to Device Manager and uninstall the driver, instead of restarting my PC. But, if I try to do this, i.e., Uninstall the driver for COM9, in device manager, Windows crashes, and reboots automatically, every single time.
> >
> > I suspect this is a problem with the Windows side Host VCOM driver.
> >
> > I am stuck with these two problems, I would appreciate any help.
> >
> > Regards,
> > Yusuf Husainy.
> >
> >
> >
>
>
>
>
>
>




Kevin, 

Thanks for all your replies.

I have done furthur work, and aI have found out that in the PLPU-S2K driver, the file ioctl.c, gets IRP packets from the user, which contain the values regarding the COM9 parameters. IOCTL requests issued by the application using the VirtualCOM port(In this case the hyper terminal) control the UART0 parameters of the LPC2148 device(COM7). Now, I also analysed the USB requests from the host, I found out, it issues requests for data bits of 7 bits in length and a Baudrate value of 0x60, which maps to no known values in the device firmware of LPC, given in the VirtualCOM.zip file hosted here: http://tech.groups.yahoo.com/group/lpc2000/files/ It is at the bottom of the page, maybe you can have a look at it. I an using this excat firmware. 

Any help from anyone would be helpful.
________________________________
From: Yusuf Husainy
To: "l..."
Sent: Tuesday, 11 June 2013 2:06 PM
Subject: Re: [lpc2000] Re: VirtualCOM port Host side-Driver problem- PLPU-S2K

 
Hi Kevin,

You were right, I consulted with the hardware engineers, and found out, that the pull ups(D+ and D-) were connected to +Vcc simultaneously(I was using a switch to switch between full-speed and low-speed). I am using the Keil IDE and the example Philips had given..

I can connect and then disconnect the device. But if I try to connect it again, without resetting my board, windows does not recognise it. I have to reset the board, and then reconnection will take place successfully. 

Now, when the device is connected, I can communicate between the VCOM and UART0. I configure VCOM(COM9) to 9600, and then UART0(COM7) to 9600. 

If It try to communicate, garbage values are displayed on both the COM ports.

However, If I set the baudrate of COM9 to 38400, leaving COM7 unchanged, communication takes place flawlessly. 

What I don't understand is How the Host side VirtualCOM driver of Philips works, I mean, If I set COM9 to a particular Baudrate(say 9600), then this is communicated as a Vendor request to the device, and I presume, this request calls a function which actually sets the baudrate of the LPC2148's UART0 to 9600. So, If I have the COM7(connected to UART0) set at 9600, no change should take place. So, what does actually happen if I set the baudrate of the COM9 to a particular value?(I mean, down below, the physical link is USB FullSpeed, at 12Mbps max, and the VCOM Bulk transfer would get a part of it.)

________________________________
From: Kevin
To: l...
Sent: Tuesday, 11 June 2013 12:46 PM
Subject: [lpc2000] Re: VirtualCOM port Host side-Driver problem- PLPU-S2K
 
I'm not familiar with the example you used, i used an example from IAR which worked reasonably well. Although I had to convert it from IAR to GCC and get it to work with FreeRTOS.

Make sure that your soft-connect, the switchable pullup on the D+ line, works.

If you have a USB-analyzer i suggest you use it, or see if you can borrow one. It helped me a lot to get it working.

If your device is self-powered you could try restarting your device after disconnecting it from the pc. If that works, than you might have a problem with your disconnect/connect routines.

--
Kevin

--- In l..., Yusuf Husainy wrote:
>
> Hi Kevin,
>
> That worked for me. Windows does not crash now.
>
> But, now, Windows does not recognise the device at all. Earlier, at the first time, it could detect it, now, that also does not happen.
>
> I saw in the device manager, the entry for the unknown device is there under the USB controllers field, in the details tab, the vendor id and product shown is 0, however, the actual vendor id and product id in the PLPU-S2K.INI file, and in my device descriptor match. 
>
> Maybe, the host is not able to read the descriptor correctly, so it shows a vendor id and product id of 0.
>
>
>
>
> ________________________________
> From: Kevin
> To: l...
> Sent: Monday, 10 June 2013 5:29 PM
> Subject: [lpc2000] Re: VirtualCOM port Host side-Driver problem- PLPU-S2K
>
>
>
>  
> Before you unplug the device you need to make sure that the virtual port is closed, in other words close your serial terminal program. My problem with almost all USB serial ports is that they fail when I forget to close the port before disconnecting them.
>
> Although I can usually get it working again by closing my serial terminals and then unplugging the device again. Wait a while and then plug it in again.
>
> --
> Kevin
>
> --- In l..., Yusuf Husainy wrote:
> >
> > Hello all,
> >
> > I am working on Virtual COM port driver for a LPC2148 based Board. I have a custom board, and have slightly modified the code for the VirtualCOM driver hosted on this mailing list for LPC2148.
> >
> >
> > 1.
> > Now, when I connect my device, the Host driver install correctly, and creates two Virtual COM ports - COM9, COM10. 
> >
> > Initially, I have configured UART0(COM7) to 9600 for debug messages. 
> >
> > Then I connect COM9 with 9600 baud rate, so after this, COM9 is connected to COM7(UART0), but when I type anything on COM9, garbage data gets printed on COM7.
> >
> > I thought this was a baudrate problem, so I changed the baudrate of COM9 to 38400, leaving the baudrate of COM7 at 9600 only.
> >
> > After this, it worked like a charm, I was able to send and receive data simultaneously, on both sides.
> >
> > So, my question is, why is this happening, why can't the COM9 operate at 9600 correctly.
> >
> > 2.
> > The other problem is, when I disconnect my device(plugging out the USB cable from my device), The host side VCOM driver does not get unloaded automatically. Due to this, If I try to connect the device again, Windows pops out a message, that the USB device is unrecognised and has malfunctioned. This does not go away until I restart my PC.
> >
> > I had also thought an easier way way to solve this problem would be to just go to Device Manager and uninstall the driver, instead of restarting my PC. But, if I try to do this, i.e., Uninstall the driver for COM9, in device manager, Windows crashes, and reboots automatically, every single time.
> >
> > I suspect this is a problem with the Windows side Host VCOM driver.
> >
> > I am stuck with these two problems, I would appreciate any help.
> >
> > Regards,
> > Yusuf Husainy.
> >
> >
> >
>
>
>
>
>
>






I didn't think that changing the baud rate in windows for a virtual com port did anything at all.

As far as how windows USB drivers work and integrate together, I believe that all engineers and programmers that know about how this all works are either retired or dead.

BTW, we find that windows 8 works much better overall with our LPCUSB implementation of CDC virtual com ports than other versions of windoze for some unknown reason.

boB

--- In l..., Yusuf Husainy wrote:
>
> Kevin, 
>
> Thanks for all your replies.
>
> I have done furthur work, and aI have found out that in the PLPU-S2K driver, the file ioctl.c, gets IRP packets from the user, which contain the values regarding the COM9 parameters. IOCTL requests issued by the application using the VirtualCOM port(In this case the hyper terminal) control the UART0 parameters of the LPC2148 device(COM7). Now, I also analysed the USB requests from the host, I found out, it issues requests for data bits of 7 bits in length and a Baudrate value of 0x60, which maps to no known values in the device firmware of LPC, given in the VirtualCOM.zip file hosted here: http://tech.groups.yahoo.com/group/lpc2000/files/ It is at the bottom of the page, maybe you can have a look at it. I an using this excat firmware. 
>
> Any help from anyone would be helpful.
>
>
> ________________________________
> From: Yusuf Husainy
> To: "l..."
> Sent: Tuesday, 11 June 2013 2:06 PM
> Subject: Re: [lpc2000] Re: VirtualCOM port Host side-Driver problem- PLPU-S2K
>
>
>
>  
> Hi Kevin,
>
> You were right, I consulted with the hardware engineers, and found out, that the pull ups(D+ and D-) were connected to +Vcc simultaneously(I was using a switch to switch between full-speed and low-speed). I am using the Keil IDE and the example Philips had given..
>
> I can connect and then disconnect the device. But if I try to connect it again, without resetting my board, windows does not recognise it. I have to reset the board, and then reconnection will take place successfully. 
>
> Now, when the device is connected, I can communicate between the VCOM and UART0. I configure VCOM(COM9) to 9600, and then UART0(COM7) to 9600. 
>
> If It try to communicate, garbage values are displayed on both the COM ports.
>
> However, If I set the baudrate of COM9 to 38400, leaving COM7 unchanged, communication takes place flawlessly. 
>
> What I don't understand is How the Host side VirtualCOM driver of Philips works, I mean, If I set COM9 to a particular Baudrate(say 9600), then this is communicated as a Vendor request to the device, and I presume, this request calls a function which actually sets the baudrate of the LPC2148's UART0 to 9600. So, If I have the COM7(connected to UART0) set at 9600, no change should take place. So, what does actually happen if I set the baudrate of the COM9 to a particular value?(I mean, down below, the physical link is USB FullSpeed, at 12Mbps max, and the VCOM Bulk transfer would get a part of it.)
>
> ________________________________
> From: Kevin
> To: l...
> Sent: Tuesday, 11 June 2013 12:46 PM
> Subject: [lpc2000] Re: VirtualCOM port Host side-Driver problem- PLPU-S2K
>
>
>  
> I'm not familiar with the example you used, i used an example from IAR which worked reasonably well. Although I had to convert it from IAR to GCC and get it to work with FreeRTOS.
>
> Make sure that your soft-connect, the switchable pullup on the D+ line, works.
>
> If you have a USB-analyzer i suggest you use it, or see if you can borrow one. It helped me a lot to get it working.
>
> If your device is self-powered you could try restarting your device after disconnecting it from the pc. If that works, than you might have a problem with your disconnect/connect routines.
>
> --
> Kevin
>
> --- In l..., Yusuf Husainy wrote:
> >
> > Hi Kevin,
> >
> > That worked for me. Windows does not crash now.
> >
> > But, now, Windows does not recognise the device at all. Earlier, at the first time, it could detect it, now, that also does not happen.
> >
> > I saw in the device manager, the entry for the unknown device is there under the USB controllers field, in the details tab, the vendor id and product shown is 0, however, the actual vendor id and product id in the PLPU-S2K.INI file, and in my device descriptor match. 
> >
> > Maybe, the host is not able to read the descriptor correctly, so it shows a vendor id and product id of 0.
> >
> >
> >
> >
> > ________________________________
> > From: Kevin
> > To: l...
> > Sent: Monday, 10 June 2013 5:29 PM
> > Subject: [lpc2000] Re: VirtualCOM port Host side-Driver problem- PLPU-S2K
> >
> >
> >
> >  
> > Before you unplug the device you need to make sure that the virtual port is closed, in other words close your serial terminal program. My problem with almost all USB serial ports is that they fail when I forget to close the port before disconnecting them.
> >
> > Although I can usually get it working again by closing my serial terminals and then unplugging the device again. Wait a while and then plug it in again.
> >
> > --
> > Kevin
> >
> > --- In l..., Yusuf Husainy wrote:
> > >
> > > Hello all,
> > >
> > > I am working on Virtual COM port driver for a LPC2148 based Board. I have a custom board, and have slightly modified the code for the VirtualCOM driver hosted on this mailing list for LPC2148.
> > >
> > >
> > > 1.
> > > Now, when I connect my device, the Host driver install correctly, and creates two Virtual COM ports - COM9, COM10. 
> > >
> > > Initially, I have configured UART0(COM7) to 9600 for debug messages. 
> > >
> > > Then I connect COM9 with 9600 baud rate, so after this, COM9 is connected to COM7(UART0), but when I type anything on COM9, garbage data gets printed on COM7.
> > >
> > > I thought this was a baudrate problem, so I changed the baudrate of COM9 to 38400, leaving the baudrate of COM7 at 9600 only.
> > >
> > > After this, it worked like a charm, I was able to send and receive data simultaneously, on both sides.
> > >
> > > So, my question is, why is this happening, why can't the COM9 operate at 9600 correctly.
> > >
> > > 2.
> > > The other problem is, when I disconnect my device(plugging out the USB cable from my device), The host side VCOM driver does not get unloaded automatically. Due to this, If I try to connect the device again, Windows pops out a message, that the USB device is unrecognised and has malfunctioned. This does not go away until I restart my PC.
> > >
> > > I had also thought an easier way way to solve this problem would be to just go to Device Manager and uninstall the driver, instead of restarting my PC. But, if I try to do this, i.e., Uninstall the driver for COM9, in device manager, Windows crashes, and reboots automatically, every single time.
> > >
> > > I suspect this is a problem with the Windows side Host VCOM driver.
> > >
> > > I am stuck with these two problems, I would appreciate any help.
> > >
> > > Regards,
> > > Yusuf Husainy.
> > >
> > > [Non-text portions of this message have been removed]
> > >
> >
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
> [Non-text portions of this message have been removed]
>
>
>
>
> [Non-text portions of this message have been removed]
>

On Wed, Jun 12, 2013 at 8:40 AM, boB G wrote:
> I didn't think that changing the baud rate in windows for
> a virtual com port did anything at all.

If it is pure virtual com port, then that is true. If there is a
real serial port after, then it can use useful. You may want
to read the spec for USB CDC class from usb.org.

> As far as how windows USB drivers work and integrate together, I
> believe that all engineers and programmers that know about how
> this all works are either retired or dead.

That is certainly not true. If you head to the ntdev mailing list,
then you will know quite a few experts there, one of them
is Tim Roberts.
http://www.osronline.com/showlists.cfm?list=ntdev

> BTW, we find that windows 8 works much better overall with our
> LPCUSB implementation of CDC virtual com ports than other
> versions of windoze for some unknown reason.
>

--
Xiaofan
Hi,

I have solved my problem.

I did not look closely at the LPC VCOM code provided by Philips. There were errors in the BaudRate calculation, when a Vendor request was received to change the baud rate.

Everything is working great now. 

Thanks to everyone who repled to my post, it gave me insights and solutions.

Regards,
Yusuf Husainy.
________________________________
From: Xiaofan Chen
To: l...
Sent: Wednesday, 12 June 2013 6:43 AM
Subject: Re: [lpc2000] Re: VirtualCOM port Host side-Driver problem- PLPU-S2K

 
On Wed, Jun 12, 2013 at 8:40 AM, boB G wrote:
> I didn't think that changing the baud rate in windows for
> a virtual com port did anything at all.

If it is pure virtual com port, then that is true. If there is a
real serial port after, then it can use useful. You may want
to read the spec for USB CDC class from usb.org.

> As far as how windows USB drivers work and integrate together, I
> believe that all engineers and programmers that know about how
> this all works are either retired or dead.

That is certainly not true. If you head to the ntdev mailing list,
then you will know quite a few experts there, one of them
is Tim Roberts.
http://www.osronline.com/showlists.cfm?list=ntdev

> BTW, we find that windows 8 works much better overall with our
> LPCUSB implementation of CDC virtual com ports than other
> versions of windoze for some unknown reason.
>

--
Xiaofan



[Non-text portions of this message have been removed]

Hi Yusuf,

Can you share working code of virtual com? I also want to implement it.
On Jun 13, 2013 10:54 AM, "Yusuf Husainy" wrote:

> **
> Hi,
>
> I have solved my problem.
>
> I did not look closely at the LPC VCOM code provided by Philips. There
> were errors in the BaudRate calculation, when a Vendor request was received
> to change the baud rate.
>
> Everything is working great now.
>
> Thanks to everyone who repled to my post, it gave me insights and
> solutions.
>
> Regards,
> Yusuf Husainy.
>
> ________________________________
> From: Xiaofan Chen
> To: l...
> Sent: Wednesday, 12 June 2013 6:43 AM
> Subject: Re: [lpc2000] Re: VirtualCOM port Host side-Driver problem-
> PLPU-S2K
>
> On Wed, Jun 12, 2013 at 8:40 AM, boB G wrote:
> > I didn't think that changing the baud rate in windows for
> > a virtual com port did anything at all.
>
> If it is pure virtual com port, then that is true. If there is a
> real serial port after, then it can use useful. You may want
> to read the spec for USB CDC class from usb.org.
>
> > As far as how windows USB drivers work and integrate together, I
> > believe that all engineers and programmers that know about how
> > this all works are either retired or dead.
>
> That is certainly not true. If you head to the ntdev mailing list,
> then you will know quite a few experts there, one of them
> is Tim Roberts.
> http://www.osronline.com/showlists.cfm?list=ntdev
>
> > BTW, we find that windows 8 works much better overall with our
> > LPCUSB implementation of CDC virtual com ports than other
> > versions of windoze for some unknown reason.
> > --
> Xiaofan
>
> [Non-text portions of this message have been removed]
>
>
>
[Non-text portions of this message have been removed]


The 2024 Embedded Online Conference