How to use driver, please help

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
kennethone
Posts: 2
Joined: Tue Aug 18, 2009 9:02 pm

How to use driver, please help

Post by kennethone » Tue Aug 18, 2009 9:23 pm

Hi I just built the USB servo project and it is recognized by my computer (win XP) as USB servo, not "unknown device" when I plug it in, but I don't get where I can find the driver, is libusb the driver? I need the dll and the inf file right? I want to communicate with it using a C# program. Do I need to compile what's in the usbdrv folder? If so do I just compile it as a dll? Then where would I get the inf file? Also It says I need to create some file as well. Please help me, its not extremely confusing but when I'm trying to get something to work I need some step by step instructions and I cannot find any of those in any VUSB project. When I tried compiling the usbdrv I received a lot of errors from the io.h and stdnt.h and inttypes.h pertaining to the type definitions used in those files. Because I'm pretty sure they are meant only for the AVR compiled not windows compiler. So when I tried to compile usbdrv.c to make a win32 dll I got 65 errors such as this one
Error 1 error C2061: syntax error : identifier '__attribute__' "..."/stdint.h 121 usbdrv
for the line of code
typedef int int8_t __attribute__((__mode__(__QI__)));

also when I plugged my USB-Servo circuit into a vista PC it was not visible or recognized at all, whereas on an XP PC it shows up as USB-Servo but it cannot find the driver. What am I doing wrong? Is there anybody who has had this problem or who can post a compiled driver?
And my last question is
is the driver the same for all these projects? Can I use the driver that can with V-USB for the USB-Servo project?
Thank you for the help,

jackthomas
Posts: 1
Joined: Wed Aug 19, 2009 5:00 am

Re: How to use driver, please help

Post by jackthomas » Wed Aug 19, 2009 5:54 am

In future will there be available any drivers for Windows 7?

maxi
Rank 3
Rank 3
Posts: 122
Joined: Fri Jul 24, 2009 6:13 pm

Re: How to use driver, please help

Post by maxi » Wed Aug 19, 2009 8:49 pm

I have not built this project myself but it sounds like what you are missing is libusb-win32. Download and install that, then in the /bin folder you will find inf-wizard.exe, ths will create the neccessary driver files for you.

Hope it helps.

kennethone
Posts: 2
Joined: Tue Aug 18, 2009 9:02 pm

Re: How to use driver, please help

Post by kennethone » Thu Aug 20, 2009 1:27 am

How do I do that? There's no documentation for libusb, do I need to download microsoft Driver development Kit (which has been replaced by WDK and I'm pretty sure will no longer work for libusb) then replace some file in the libusb src folder with usbdrv.c and usbdrv.h from the v-usb usbdrv folder and then run make_all in the LibUSB-Win32\src\ddk_make folder to get the driver?

What I am most confused about is why no one else has a problem with obtaining a driver so that their device can install on a computer, or why no one else has asked about the driver on the forums, or why these drivers weren't included in any download or anywhere on the website. I understand that these drivers are not needed for HID devices such as keyboard or joystick emulators. But for the majority of projects like powerswitch they are needed. Am I right?

maxi
Rank 3
Rank 3
Posts: 122
Joined: Fri Jul 24, 2009 6:13 pm

Re: How to use driver, please help

Post by maxi » Thu Aug 20, 2009 3:05 pm

No, usbdrv.c is the source for the firmware driver. I am assuming you must have programmed your AVR with the pre-compiled .hex or you would know this.

You can still download the MS DDK however I do not think it is needed here. For a custom class device you should only need libusb-win32. Like I said if you install that then run inf-wizard.exe you should be able to create a windows driver for your device.

I suggest you try some of the example projects that ship with V-USB, read the documentation carefully and you should get a much better feel for what you are doing.

NB: If you do find you need the DDK you're better off downloading MinGW as it ships with a free version.

kennethon

Re: How to use driver, please help

Post by kennethon » Wed Aug 26, 2009 7:37 pm

So what I need to do is plug in the USB device and open this inf-wizard.exe
then it will compile the inf file
but where do I get the .sys file and the .dll files? will these also be created by the inf wizard?

maxi
Rank 3
Rank 3
Posts: 122
Joined: Fri Jul 24, 2009 6:13 pm

Re: How to use driver, please help

Post by maxi » Wed Aug 26, 2009 9:58 pm

inf-wizard will generate a .inf and a .cat file. libusb0.dll & libusb0.sys can be found in the same folder as inf-wizard use these with your .inf & .cat files.

If you want to make an installer then check out driver_installer_template.iss in the libusb examples folder. You will need Inno Setup to open it:

http://www.jrsoftware.org/isinfo.php

Post Reply