Michael Biebl wrote:
> Luis M. Ruiz Rosado wrote:
>> Package: avrdude
>> Version: 5.5-4
>> Severity: grave
>>
>> Avrdude fails to complete a request to getting info, or to program a chip, 
>> through
>> USBTiny adapter (http://www.ladyada.net/make/usbtinyisp/).
>> The error message is:
>>     avrdude: error: usbtiny_receive: No error (expected 8, got 4)
>>
>> There is a patch  http://savannah.nongnu.org/patch/download.php?file_id=14754
>> discussed at http://savannah.nongnu.org/patch/?6233, that fixes this error
>> among others.
>>
>> The patch attached here, is built and verified,with the Debian source 
>> package.
>> The only changes are related to this fail.
> 
> Honestly, I can't see how this patch should help:
> 
> sizeof(unsigned char[4]) should be 4, no matter if you are using i386 or 
> amd64,
> and the patch does nothing else then replacinging those two.
> 
> Could you please pinpoint more exactly (e.g. via debug printfs), where the 
> code
> actually fails? I lack the hardware to do so.

Nevermind, found the bug myself:

static int usbtiny_cmd(PROGRAMMER * pgm, unsigned char cmd[4], unsigned char 
res[4])
...
sizeof(cmd)
...

We are passing a char pointer along, so cmd is *not* a char[4] array, and
pointers are 8 byte long on amd64.


Michael

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to