0

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.

Quest
  • 129
  • 1
  • 1
  • 8
  • Why aren't you just using avrdude from the Linux side? – Ignacio Vazquez-Abrams Aug 13 '14 at 02: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 Aug 13 '14 at 03:49
  • 1
    That's sort of a "catch-all" USB ID; don't depend on it to find out what it actually is. – Ignacio Vazquez-Abrams Aug 13 '14 at 03:53
  • Ok, thanks. So am exploring the ideal -c parameters in avrdude now. If you have some pointers pls share. – Quest Aug 13 '14 at 04:14
  • Do you have a link to the programmer? – Ignacio Vazquez-Abrams Aug 13 '14 at 04:15
  • http://quest.ksetindia.com/product_info.php/Product/KSET_Embedded_AVR_USB_Programmer – Quest Aug 13 '14 at 04:22
  • Do you have USB bus shared to the guest virtual machine? When you connect your - does WinXP show it is connected, did it install proper drivers previously? Did you check the device seemed all right in device manager, when plugged in? – Ruslan Gerasimov Aug 13 '14 at 09:02
  • Yes. It does enumerate properly and shows up healthy in USBView. – Quest Aug 13 '14 at 12:08
  • Post the actual command line you used. Typically, that error message comes when you have not specified the port/device file to which the programmer is connected. Note that if you are talking via a USB-serial converter to a bootloader or serial ISP programmer, as far as avrdude is concerned **this is not a USB programmer** but rather a serial one, so a USB error message from avrdude means you have mis-instructed the program. – Chris Stratton Aug 13 '14 at 16:40
  • avrdude -p atmega32 -P usb -c stk500v2 -U flash:w:main.hex avrdude: usbdev_open(): did not find any USB device "usb" make.exe: *** [program] Error 1 – Quest Aug 13 '14 at 18:28

1 Answers1

1

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.

Chris Stratton
  • 39,853
  • 6
  • 84
  • 117
  • It worked with avrdude -p atmega32 -P avrdoper -c stk500 -U flash:w:main.hex; There was no mention on how to use this with our own makefile (actually I did not install their packages and go through the master makefile provided). I went to the webt site of avr-doper and found this relevant info which worked for me. Thanks all for the info. – Quest Aug 14 '14 at 03:50
  • Am giving Chris my vote for hinting that the problem could be around -P arg. – Quest Aug 14 '14 at 04:18