OK, I decided to try a newer driver, to see if it would fit in the bootloader section. Turns out it is actually considerably smaller (about 100 bytes) than the one included in the AvrUsbBoot archive. I ported each of the options from the old usbconfig.h, but I am not really sure what VID/PID the old one used, since that part of the config was commented out. I assume this means to use ObDev's VID/PID pair, but when I try doing the same with the newer driver, I get warnings about needing to define it anyway.
Turns out that if I ignore the warnings and compile anyway, I actually get a working bootloader. At least to the point where the device is detected as AVRUSBoot. Perhaps the old driver which needed special alignment was indeed the culprit.
Now, the problem is getting further away from the avr-usb stack, and I might be getting off-topic in this forum, but my observation is this: When I try to use the avrusbboot application, I get this error:
Code: Select all
C:\avr\SpiffChorder>avrusbboot main.hex
Pagesize: -128
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
I assume this is some signed/unsigned stuff in the application, but I haven't looked into it yet. Also, I don't remember if I compiled the avrusbboot application on Windows myself, or if I found a prebuilt binary. In any case I guess the best option would be to get in touch with Thomas Fischl and ask him if he will include my patches into his version.
One more question: I got confused about the device asking for a driver when I plugged it in. Turns out that this happens if i use a different USB port on my computer than what I have normally used with AVRUSBBoot. Do I need to re-install the driver for every port, and what driver is it exactly? I must have installed it for one port a long time ago (about a year ago, when I first looked at AVRUSBBoot), but I have forgotten what I did.
EDIT: I just found the driver in the AVRUSBBoot distribution.