Note on modifying avrdude to support igor-usb

2008-02-27T12:05:04

Avrdude can talk to the `butterfly' bootloader code running on an Atmega processor through the serial port. The relevant code is in `butterfly.c'. Here is how we can add support for the firmware igor-usb usb-to-serial converter in avrdude: In the butterfly_open function, check whether the port specified in the commandline is `igorusb':

if(strncmp(port, "igorusb", strlen("igorusb")) == 0)
		serdev = &igorusb_serdev;
We make `serdev' point to a structure which holds igor-usb specific routines. This structure, and the related routines, are specified in `ser-igorusb.c':
struct serial_device igorusb_serdev =
{
  .open = igorusb_open,
  .setspeed = igorusb_setspeed,
  .close = igorusb_close,
  .send = igorusb_send,
  .recv = igorusb_recv,
  .drain = igorusb_drain,
};
When `butterfly.c' wants to send some data to the uC, it calls `serial_send' which is simply a macro (defined in serial.h) which expands to serdev->send; `serdev' is pointing to our `igorusb' structure - so the usb specific routine gets called. Avrdude should be invoked like this: /usr/local/src/avrdude-5.5/avrdude -p m16 -c butterfly -V -P igorusb -u -U flash:w:$1.hex The -V option says `dont verify the code' and -P sets the port. `ser_igorusb.h' contains some constants - including vendor/product id. There seems to be some problem with the files which `autoconf' etc generates on my system. So after running `./configure' on your machine, you will have to delete 3 lines from the Makefile containing the word `WINDOWS_DIRS'. Down load the source: avrdude-usb.tgz

Edwin

Fri Jun 20 09:28:55 2008

I tried installing as per your instructions,and i got the same problem that you mentioned and deleted those 3 lines before hitting make again.But this time it reported -./ylwrap:No such file or directory-When i checked in the folder,i saw ylwrap file but it was given -link(broken)-??So,I'm stuck now.

[Subscribe to our Newsletter] [Go to pramode.net home] [Courses at Recursive Labs] [Connect with me on Twitter/Facebook]