Sat 07 Jan 2012 10:21:55 AM UTC, original submission:
The avrftdi uses the old interface without the base address.
This results at reading in not reading the last page and extreme read times. (1000s for 32KByte flash)
It used the old interface.
static int avrftdi_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, int page_size, int n_bytes)
But it should use:
static int avrftdi_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, unsigned int page_size, unsigned int addr, unsigned int n_bytes)
So it interprets the addr as length. As the pages are read sequentially, the address is incremented with page_size and the current implementation always read all already read pages again (as it see incrementing n_bytes values)
For m pages it reads here the first page (m-1) times, the second (m-2) times, and so on. The last page is not read at all.
The attached patch tries to fix this. It reads now all memory and with the original speed (3s for 32 KByte).
But on my Windows XP I get now a segmentation fault at exit (in avrftdi_close at ftdi_deinit). I'm not sure if this comes from the patch. So better someone else have a look at it.
|