[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avrdude-dev] [bug #38831] [PATCH] Fix avrftdi onchip-buffer overrun
From: |
Hannes Weisbach |
Subject: |
Re: [avrdude-dev] [bug #38831] [PATCH] Fix avrftdi onchip-buffer overrun |
Date: |
Fri, 26 Apr 2013 13:09:11 +0200 |
>
>
> Details:
>
> The FT2232 only has a 384 byte fifo, but avrftdi tries to send arbitrarily
> large packets. Reading flash memory with page_size > 380 (example: mega16 has
> 512) fails.
> The attached patch fixes this problem. It also makes sure the error code is
> checked.
>
Hello,
this is not an issue, because the FIFO is only of importance in UART mode.
avrftdi uses the MPSSE mode, in which packet sizes are handled by the USB spec
and subsystem of the operating system, specifically libusb. An excerpt from the
libusb doc:
<cite>
The USB specifications describe how data is transmitted in packets, with
constraints on packet size defined by endpoint descriptors. The host must
not send data payloads larger than the endpoint's maximum packet size.
libusb and the underlying OS abstract out the packet concept, allowing you
to request transfers of any size. Internally, the request will be divided
up into correctly-sized packets. You do not have to be concerned with
packet sizes, but there is one exception when considering overflows.
</cite>
As you can see, you are allowed to submit as much data as you want and libusb
will "do the right thing". This makes sense because anything else will make
development of user space USB drivers really hard and defy the purpose of
having a library in the first place, if you would have to handle packet sizes
yourself. The overflow situation libusb mentions pertains to receiving data
from the device. This, however, does not apply to avrftdi because we always
know how much data the chip is going to send and we can provide an
appropriately sized receive buffer.
Also, I don't see the connection to #38659. The TO of #38659 did not yet report
back if his issue was resolved or not.
If you experienced an error, please describe it in detail, along with the
operating system used, the call to invoke avrdude and - if applicable - a log
of avrdude output with "-vvvv"-flags.
Best regards,
Hannes
>
>
> _______________________________________________________
>
> File Attachments:
>
>
> -------------------------------------------------------
> Date: Fri 26 Apr 2013 01:03:20 AM GMT Name: fifo_overrun.patch Size: 4kB
> By: herm
>
> <http://savannah.nongnu.org/bugs/download.php?file_id=27942>
>
> _______________________________________________________
>
> Reply to this item at:
>
> <http://savannah.nongnu.org/bugs/?38831>
>
> _______________________________________________
> Message sent via/by Savannah
> http://savannah.nongnu.org/
>
>
> _______________________________________________
> avrdude-dev mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/avrdude-dev