avrdude-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avrdude-dev] ATMega2560 and stk500


From: Alan Horstmann
Subject: Re: [avrdude-dev] ATMega2560 and stk500
Date: Tue, 21 Jan 2014 22:51:37 +0000
User-agent: KMail/1.9.1

Hello Joerg,

Thanks for looking at this; comments below...

On Tuesday 21 January 2014 22:02, Joerg Wunsch wrote:

> 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

I think that is the first patch I posted - 'stk500-256K-fix1.patch' that has 6 
hunks - and is really just a hack to understand the problem.  Try 
-fix2.patch.

I was using v5.11.1 since 6.0.1 doesn't build due to an extra library 
requirement.  But the second patch 'stk500-256K-fix2.patch' in the second 
post does apply to 6.0.1 for me - or are there more recent changes?:

patch -p0 -i stk500-256K-fix2.patch
patching file stk500.c
Hunk #1 succeeded at 46 with fuzz 2 (offset 1 line).
Hunk #2 succeeded at 433 (offset 4 lines).
Hunk #3 succeeded at 699 (offset 7 lines).
Hunk #4 succeeded at 815 (offset -26 lines).
Hunk #5 succeeded at 904 (offset -54 lines).

> 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).

Is that since 6.0.1 then?

> 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.)

Well I can try that also; my tests were programming the bootloader, so it is 
just a small amount of code, but placed at the top of the flash area.

Regards

Alan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]