I use winxp inside a virtualbox with host as ubuntu. The usb programmer connected to host is routed to the guest. I use WinAVR which uses avrdude; the relevant fields in makefile are given as Atmega32 for processor, port as usb and programmer as stk200. Still it says cannot find device "usb". Please help.
-
Why aren't you just using avrdude from the Linux side?Ignacio Vazquez-Abrams– Ignacio Vazquez-Abrams2014-08-13 02:42:48 +00:00Commented Aug 13, 2014 at 2:42
-
Yes, I tried. Actually I could not get the type of programmer that I got from the vendor. It seems to be created by him. Its a usb to serial converter with vid/pid : 0x16C0/0x05DF.Quest– Quest2014-08-13 03:49:14 +00:00Commented Aug 13, 2014 at 3:49
-
1That's sort of a "catch-all" USB ID; don't depend on it to find out what it actually is.Ignacio Vazquez-Abrams– Ignacio Vazquez-Abrams2014-08-13 03:53:21 +00:00Commented Aug 13, 2014 at 3:53
-
Ok, thanks. So am exploring the ideal -c parameters in avrdude now. If you have some pointers pls share.Quest– Quest2014-08-13 04:14:34 +00:00Commented Aug 13, 2014 at 4:14
-
Do you have a link to the programmer?Ignacio Vazquez-Abrams– Ignacio Vazquez-Abrams2014-08-13 04:15:10 +00:00Commented Aug 13, 2014 at 4:15
1 Answer
Your error results from the mistaken -P usb in your command:
avrdude -p atmega32 -P usb -c stk500v2 -U flash:w:main.hex
Do not specity "usb" as a port when using a USB-serial connected programmer or bootloader, because downstream of the operating system driver, these are not treated as USB devices but rather as serial ports.
When you use such a device, determine the com port or device node it is connected to (perhaps by seeing which one appears/disappears when you connect and disconnect it), find out the baud rate required by your programmer, and issue a command such as
COM1 or whatever on Windows
avrdude -p atmega32 -P COM1 -b115200 -c stk500v2 -U flash:w:main.hex
Linux or OSX
avrdude -p atmega32 -P /dev/whatever -b115200 -c stk500v2 -U flash:w:main.hex
The device file on Linux would be something like /dev/ttyUSB0 or /dev/ttyACM0, while on OSX it tends to be /dev/tty.usbmodem or similar.
The alternate solution you propose in comments, of using -P avrdoper leverages the fact that your specific programmer offers an alternate interface which is not a USB-serial device in the eyes of the host operating system, but instead a custom USB protocol which at least some versions of avrdude know how to talk.