Hello Alan,
thanks for your effort in improving AVRDUDE. It is welcome, even
though STK500v1 certainly belongs to the rather archaic parts of the
code base.
> > With this patch applied, programming either half of the Mega2560 256K flash
> > works correctly with an stk500 (v1) ISP.
> Is it possible/likely this could be looked at? Whilst working on
> other things, I have kept the logic analyser setup/connected in
> order to re-test alternatives if needed. However, soon I will need
> to strip that down for other uses.
I dug up a genuine STK500, flashed a version 1.x firmware (1.14
decimally, probably the last official Atmel V1.x firmware they ever
made), and tried connecting it to an ATmega2560 piggyback board on an
STK600.
First, I had to connect my logic analyzer, too :), until I realized
the firmware simply refused to do *anything* without first assigning
an stk500_devcode in avrdude.conf. (I wonder how you managed to get
around without it.) I picked devcode 0xB1 (as it's already in the
comment in avrdude.conf.in).
So now, I can connect to the device, and it responds to me. Time to
shutdown the noisy LA again...
Then tried to apply your patch. Unfortunately, I get two rejected
hunks:
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- stk500-orig.c 2011-09-15 15:37:04.000000000 +0100
|+++ stk500.c 2013-12-06 22:45:30.000000000 +0000
--------------------------
Patching file stk500.c using Plan A...
Hunk #1 succeeded at 696 (offset 7 lines).
Hunk #2 failed at 775.
Hunk #3 failed at 790.
Hunk #4 succeeded at 810 (offset -33 lines).
Hunk #5 succeeded at 908 (offset -8 lines).
Hunk #6 succeeded at 918 (offset -46 lines).
2 out of 6 hunks failed--saving rejects to stk500.c.rej
done
Apparently, you've been working against an outdated version of the
file (on 2013-09-03, in rev 1200, I removed all unused variable the
compiler warned about).
Now, all I need is a firmware file large enough to demonstrate the
issue ... OK, created one (using large progmem arrays).
OK, without your patch, it fails miserably (not unexpected, of
course).
But oh well, *with* your patch, I still get:
avrdude: verifying flash memory against foo.elf:
avrdude: load data flash data from input file foo.elf:
avrdude: input file foo.elf auto detected as ELF
avrdude: input file foo.elf contains 164038 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 48.95s
avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
0x04 != 0x0d
avrdude: verification error; content mismatch
avrdude done. Thank you.
Hmm. I think there's still some problem ... The 0x04 is the
result out of byte 0x0d @ address 0, and 0xa6 @ 0x20000.
(I can send you the ELF file I've been using if you want.)
--
cheers, Joerg .-.-. --... ...-- -.. . DL8DTL
http://www.sax.de/~joerg/
Never trust an operating system you don't have sources for. ;-)
_______________________________________________
avrdude-dev mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev