Forums

USB Class Suggestion

Started by Sachin Tiwari February 3, 2011
Hello

I am using LPC1768 and have successfully tested code for USB end device. I am able to access the USB as a COM from the PC.

I want to access it as any other USB device now. example like a mouse, this means that the device should infact be read as the USB and not as a virtual COM. The way we have interface, HID, Endpoint, report descriptor etc for mouse, may be i would be able to do something like this for my device.

I would be using class 255 for RS232 and since the device we are developing is a test equipment, something like communication class could be used (class 2). I am not quite sure if something like this can be done.

Having a vendor class and defining would have cost involved. so probably this will not be a option.

Is using current ready classes for our applications feasible and is it ethical or for that matter, can we actually do something of that sort.

I am extremely sorry if the mail seems confusing. Afterall USB is confusing :)

Your suggestions would be very helpful.

Regards
Sachin

I guess i probably need to change descriptor configuration.

An Engineer's Guide to the LPC2100 Series

Hello,

Do you need support for multiple functions in one device (USB composite device), or you want to reuse PID for multiple devices?

Look here:
http://en.wikipedia.org/wiki/USB_Implementers_Forum#Obtaining_a_vendor_ID

And also look here (that book is much simpler and easier to read than USB standard):
http://www.lvr.com/usbc.htm

--
shameless self-promotion:
http://dimkoelectronics.wordpress.com

> I want to access it as any other USB device now.

USB-UART chip vendors provide "direct" PC drivers, other than virtual COM port drivers. FTDI - D2XX, SiLabs - USBXpress, etc. These drivers directly expose the chips to application (actually, over DLL), without changing USB configuration on the chip. No COM port appears.

If you want to do similar way for your CDC device, generic drivers are available. WinUSB, libusb, etc. Just assigning the device VID/PID to these drivers on an INF file, your device is driven by these drivers, without any change on your firmware.

The major difference of generic drivers and CDC driver lies in the bulk endpoint. CDC driver always polls the CDC bulk endpoint, and it stores data from the device in a RX buffer, which sits on the driver. Generic drivers access to the bulk endpoint, just when your PC application reads the endpoint. Therefore, to run the bulk endpoint in similar way, your application has to issue read call one after another.

[References]
WinUSB on Jan Axelson's site
http://www.lvr.com/winusb.htm

Wrapper library for .NET
- WinUSBNet
http://code.google.com/p/winusbnet/
- LibUsbDotNet
http://sourceforge.net/projects/libusbdotnet/

Tsuneo

--- In l..., "t_chinzei" wrote:
>
> > I want to access it as any other USB device now.
>
> USB-UART chip vendors provide "direct" PC drivers, other than virtual COM port drivers. FTDI - D2XX, SiLabs - USBXpress, etc. These drivers directly expose the chips to application (actually, over DLL), without changing USB configuration on the chip. No COM port appears.
>
> If you want to do similar way for your CDC device, generic drivers are available. WinUSB, libusb, etc. Just assigning the device VID/PID to these drivers on an INF file, your device is driven by these drivers, without any change on your firmware.
>
> The major difference of generic drivers and CDC driver lies in the bulk endpoint. CDC driver always polls the CDC bulk endpoint, and it stores data from the device in a RX buffer, which sits on the driver. Generic drivers access to the bulk endpoint, just when your PC application reads the endpoint. Therefore, to run the bulk endpoint in similar way, your application has to issue read call one after another.
>
> [References]
> WinUSB on Jan Axelson's site
> http://www.lvr.com/winusb.htm
>
This might just be of help to me...

My problem lately has been that the old CDC virtual comm drivers,
usbser.sys do not appear to work on Windows 7

Has anybody successfully gotten LPCUSB to work with win 7 ??
Works great with win XP for me.

boB

> Wrapper library for .NET
> - WinUSBNet
> http://code.google.com/p/winusbnet/
> - LibUsbDotNet
> http://sourceforge.net/projects/libusbdotnet/
>
> Tsuneo
>

On Mon, Feb 14, 2011 at 6:17 AM, boB G wrote:
>
> This might just be of help to me...
>
> My problem lately has been that the old CDC virtual comm drivers,
> usbser.sys do not appear to work on Windows 7
>
> Has anybody successfully gotten LPCUSB to work with win 7 ??
> Works great with win XP for me.
>

JCWren's example works fine under Windows 7 (tested under
32bit and 64bit). It uses lpcusb for the USB part and it is
CDC. Last time I could not get it work under Vista 32bit,
in the end I found it is a setting problem for the terminal
program.
http://www.jcwren.com/arm/

--
Xiaofan
--- In l..., Xiaofan Chen wrote:
>
> On Mon, Feb 14, 2011 at 6:17 AM, boB G wrote:
> >
> > This might just be of help to me...
> >
> > My problem lately has been that the old CDC virtual comm drivers,
> > usbser.sys do not appear to work on Windows 7
> >
> > Has anybody successfully gotten LPCUSB to work with win 7 ??
> > Works great with win XP for me.
> >
>
> JCWren's example works fine under Windows 7 (tested under
> 32bit and 64bit). It uses lpcusb for the USB part and it is
> CDC. Last time I could not get it work under Vista 32bit,
> in the end I found it is a setting problem for the terminal
> program.
> http://www.jcwren.com/arm/
>
So, from XP to Windows 7 and vista, not changes to the .inf file or anything ?? I didn't see anything on JC Wren's site about the PC side although I and others can always use my USB installation methods on XP with little or no problems.

I have them install usbser.inf, usbser.sys and I think they need MFC42D.DLL, MFCO42D.DLL and MSVCRTD.DLL I can't remember which .DLL files were needed for XP.

You sure there isn't some other file they may need for win 7 and/or Vista ??

Thanks a bunch.

boB

>
>

> --
> Xiaofan
>

--- In l..., Xiaofan Chen wrote:
>
> On Mon, Feb 14, 2011 at 6:17 AM, boB G wrote:
> >
> > This might just be of help to me...
> >
> > My problem lately has been that the old CDC virtual comm drivers,
> > usbser.sys do not appear to work on Windows 7
> >
> > Has anybody successfully gotten LPCUSB to work with win 7 ??
> > Works great with win XP for me.
> >
>
> JCWren's example works fine under Windows 7 (tested under
> 32bit and 64bit). It uses lpcusb for the USB part and it is
> CDC. Last time I could not get it work under Vista 32bit,
> in the end I found it is a setting problem for the terminal
> program.
> http://www.jcwren.com/arm/
>
>
Now I am seeing that on...

http://msdn.microsoft.com/en-us/library/ff538820.aspx

That the CDC class driver for Vista, server 2008 and Windows 7 is Usb8023.sys

That is different than usbser.sys for xp that I use.

I could not find an exact example on JCW's site, but that doesn't
mean it isn't there. Also went to the LPCUSB forum and noticed a couple newer posts, but it doesn't look like many ppl use this system ? Those posts are far and few between which is why I came here.

Thank you,
boB

>
> --
> Xiaofan
>

On Mon, Feb 14, 2011 at 8:53 AM, boB G wrote:
>> JCWren's example works fine under Windows 7 (tested under
>> 32bit and 64bit). It uses lpcusb for the USB part and it is
>> CDC. Last time I could not get it work under Vista 32bit,
>> in the end I found it is a setting problem for the terminal
>> program.
>> http://www.jcwren.com/arm/
>
> So, from XP to Windows 7 and vista, not changes to the .inf file or
> anything ?? I didn't see anything on JC Wren's site about the
> PC side although I and others can always use my USB installation
> methods on XP with little or no problems.

I have to check, I may not use the stock inf file from JCWren.
But yes you can use the same inf file for XP/Vista/Win7
(32bit and 64bit) to install the driver.

> I have them install usbser.inf, usbser.sys and I think they need
> MFC42D.DLL, MFCO42D.DLL and MSVCRTD.DLL I can't
> remember which .DLL files were needed for XP.

Those three DLLs has nothing to do with usbser.sys,
and they are not redistributable (debugging dlls), I think
you are using a non-release version of some program.

> You sure there isn't some other file they may need for win 7
> and/or Vista ??

You need a terminal program.
I used mtty (from Microsoft) and Bray Terminal for the tests
under Win7 64bit. I could not find the original download source
from Microsoft. But you can download a version from Netburner.
http://www.netburner.com/support/public_downloads.html

Bray Terminal: https://sites.google.com/site/terminalbpp/
(I need to check the DTR/RTS on the transmit side)

Of course there are many other terminal programs,
like Tera Term and RealTerm.

--
Xiaofan
On Mon, Feb 14, 2011 at 9:06 AM, boB G wrote:

> Now I am seeing that on...
>
> http://msdn.microsoft.com/en-us/library/ff538820.aspx
>
> That the CDC class driver for Vista, server 2008 and Windows 7 is Usb8023.sys

That one is for different CDC sub-class. There are many sub-classes
within the CDC class.

> That is different than usbser.sys for xp that I use.

usbser.sys is for CDC-ACM. It is in Win2k/XP/Vista/7. It is
actually available for Win98SE/ME as well. But there are
quite some problems associated with the driver so that
USB to Serial Converter IC vendors like FTDI/Prolific/Silabs
do not use CDC-ACM class but use a custom class
and develop their own drivers.
--
Xiaofan
--- In l..., Xiaofan Chen wrote:
>
> On Mon, Feb 14, 2011 at 9:06 AM, boB G wrote:
>
> > Now I am seeing that on...
> >
> > http://msdn.microsoft.com/en-us/library/ff538820.aspx
> >
> > That the CDC class driver for Vista, server 2008 and Windows 7 is Usb8023.sys
>
> That one is for different CDC sub-class. There are many sub-classes
> within the CDC class.
>
> > That is different than usbser.sys for xp that I use.
>
> usbser.sys is for CDC-ACM. It is in Win2k/XP/Vista/7. It is
> actually available for Win98SE/ME as well. But there are
> quite some problems associated with the driver so that
> USB to Serial Converter IC vendors like FTDI/Prolific/Silabs
> do not use CDC-ACM class but use a custom class
> and develop their own drivers.
>

OK, so Bertik's LPCUSB must technically be called CDC-ACM which I have seen before... BTW, In XP, I can talk to my product using either terminal software or my application that is used for field upgrades of firmware of LPC2366 parts through the virtual comm port.

I just need to get it to work with Windows 7 now. So, I will just tray harder, but I had heard of problems that others had with CDC-ATM (I'm pretty sure theirs was -ACM as well) and some kind of "patch" was mentioned

The chat about this stuff is very cryptic to me for some reason. There is a LOT about windows drivers and communications I don't understand.... Obviously.

I am surprised that I got the XP stuff to work so well.

Thanks, Xiaofan !!

boB

>
> --
> Xiaofan
>