Rene, That's a great idea. I simply went with least intrusive change in the code to get done what I needed to do but what you propose is a much better approach that could be extended to other programmers. Simply define whatever is needed to identify a programmer in the config file. For usbasp that would require extensive rewrite of code which is not for me to do. I'll leave that to avdude developers.
________________________________ From: René Liebscher <[email protected]> To: 'Artur J' <[email protected]>; [email protected] Sent: Friday, January 13, 2012 1:31 AM Subject: AW: [avrdude-dev] avrdude and usbasp Hi, I think the patch should be modified not to include the usb ids in the c-code. You could modify usbasp.c to check if any of the usbvid, usbpid fields is set in the pgm data structure and use this to find the programmer. So you could specify the programmer as: programmer id = "xwopen"; desc = "XWOpen"; type = usbasp; usbvid = 0x16C0; # VOTI usbpid = 0x05DC; # Obdev's free shared PID #usbvendor = ""; #usbproduct = ""; #usbsn = ""; ; (Your kkmulticopter flash tool must be able to provide the different programmer id to avrdude to use it this way.) I think for the programmer id "usbasp" the old behaviour should be used to look for one of the already defined usbasp variants. But for any new usbasp clone one just need to add a new config entry and does not need to change the code anymore. (In current svn you could just append this single entry on command line by specifying -C +xwopen.conf.) It would also be possible to put some generic entry in avrdude.conf as: programmer id = "usbasp-clone"; desc = "Any usbasp clone with correct VID/PID "; type = usbasp; usbvid = 0x16C0; # VOTI usbpid = 0x05DC; # Obdev's free shared PID #usbvendor = ""; #usbproduct = ""; #usbsn = ""; ; Kind regards René Liebscher -----Ursprüngliche Nachricht----- Von: [email protected] [mailto:[email protected]] Im Auftrag von Artur J Gesendet: Donnerstag, 12. Januar 2012 23:56 An: [email protected] Betreff: [avrdude-dev] avrdude and usbasp I was trying to use kkmulticopter flash tool to program my Atmel 168P based kkblackboard. Kkmulticopter flash tool calls avrdude to do the actual programming. Turned out that the USB programmer that was supplied with my kk board was not compatible with avrdude. It is a usbasp clone called XWOpen that apparently does not provide vendor name and device name strings as expected by avrdude. With Christian Moll's help I altered usbasp.c to not require expected text strings as long as VID and PID match. There may be a good reason why your original code expects those to match, but if you incorporate my change into your code, you'll probably make many owners of XWOpen boards happy. Artur _______________________________________________ avrdude-dev mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/avrdude-dev
