Bug in avrdude 5.8?

OP #2909788
Lesenswert?

Hallo!

Ich habe hier ein Problem, das ich mir nur mit einem Bug im AVRDude 
erklären kann.
Folgendes: ein Bootloader soll in ein Mega2560. Die Startadresse ist 
0x3E000.

Das erzeugte HEX-File sieht gut aus:

:020000023000CC
:10E000000D9472F00D9493F00D9493F00D9493F0A1
:10E010000D9493F00D9493F00D9493F00D9493F070
.
.
.

Für mich heisst es: Segmentadresse 0x30000 (0x3000 * 16), Ladeadresse 
0xE000 bzw. 0xE010. Geodert ergibt es die gewünschten 0x3E000 bzw. 
0x3E010 in der 2. Zeile.

Wird das HEX-File nun mit AVR-Dude hochgeladen, kommt folgende 
Fehlermeldung:

avrdude: ERROR: address 0x30e010 out of range at line 2 of EvoV_BL.hex
avrdude: write to file 'EvoV_BL.hex' failed

Die monierte Adresse ist für mich falsch! Wie kommt AVRDude auf 
0x30e010???

Die komplette Avrdude-Zeile ist:
avrdude -pm2560 -cavrisp2 -Pusb -u -B 1 -Uflash:w:EvoV_BL.hex:a 
-Ulfuse:w:0xf7:m -Uhfuse:w:0xd8:m -Uefuse:w:0xff:m -Ulock:w:0xcc:m

Bin für jeden Hinweis dankbar!

Grüße
Thomas
Moderator Persönliche Seite #2909805
Lesenswert?

Thomas K. schrieb:
> avrdude: ERROR: address 0x30e010 out of range at line 2 of EvoV_BL.hex

Kann ich mit dem Schnipsel Hexfile nicht reproduzieren:
1
% avrdude -c jtag2 -P usb -p m2560 -U /tmp/foo.hex
2

3
avrdude: jtagmkII_initialize(): warning: OCDEN fuse not programmed, single-byte EEPROM updates not possible
4
avrdude: AVR device initialized and ready to accept instructions
5

6
Reading | ################################################## | 100% 0.01s
7

8
avrdude: Device signature = 0x1e9801
9
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
10
         To disable this feature, specify the -D option.
11
avrdude: erasing chip
12
avrdude: jtagmkII_initialize(): warning: OCDEN fuse not programmed, single-byte EEPROM updates not possible
13
avrdude: reading input file "/tmp/foo.hex"
14
avrdude: input file /tmp/foo.hex auto detected as Intel Hex
15
avrdude: WARNING: no end of file record found for Intel Hex file "/tmp/foo.hex"
16
avrdude: writing flash (253984 bytes):
17

18
Writing | ################################################## | 100% 17.14s
19

20
avrdude: 253984 bytes of flash written
21
avrdude: verifying flash memory against /tmp/foo.hex:
22
avrdude: load data flash data from input file /tmp/foo.hex:
23
avrdude: input file /tmp/foo.hex auto detected as Intel Hex
24
avrdude: WARNING: no end of file record found for Intel Hex file "/tmp/foo.hex"
25
avrdude: input file /tmp/foo.hex contains 253984 bytes
26
avrdude: reading on-chip flash data:
27

28
Reading | ################################################## | 100% 22.85s
29

30
avrdude: verifying ...
31
avrdude: 253984 bytes of flash verified
32

33
avrdude: safemode: Fuses OK
34

35
avrdude done.  Thank you.

Mit der SVN-Version gänge alles viel schneller:
1
% ~/src/avrdude/avrdude -C ~/src/avrdude/avrdude.conf -c jtag2 -P usb -p m2560 -U /tmp/foo.hex
2

3
avrdude: jtagmkII_initialize(): warning: OCDEN fuse not programmed, single-byte EEPROM updates not possible
4
avrdude: AVR device initialized and ready to accept instructions
5

6
Reading | ################################################## | 100% 0.01s
7

8
avrdude: Device signature = 0x1e9801
9
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
10
         To disable this feature, specify the -D option.
11
avrdude: erasing chip
12
avrdude: jtagmkII_initialize(): warning: OCDEN fuse not programmed, single-byte EEPROM updates not possible
13
avrdude: reading input file "/tmp/foo.hex"
14
avrdude: input file /tmp/foo.hex auto detected as Intel Hex
15
avrdude: WARNING: no end of file record found for Intel Hex file "/tmp/foo.hex"
16
avrdude: writing flash (253984 bytes):
17

18
Writing | ################################################## | 100% 0.03s
19

20
avrdude: 253984 bytes of flash written
21
avrdude: verifying flash memory against /tmp/foo.hex:
22
avrdude: load data flash data from input file /tmp/foo.hex:
23
avrdude: input file /tmp/foo.hex auto detected as Intel Hex
24
avrdude: WARNING: no end of file record found for Intel Hex file "/tmp/foo.hex"
25
avrdude: input file /tmp/foo.hex contains 253984 bytes
26
avrdude: reading on-chip flash data:
27

28
Reading | ################################################## | 100% 0.03s
29

30
avrdude: verifying ...
31
avrdude: 253984 bytes of flash verified
32

33
avrdude: safemode: Fuses OK
34

35
avrdude done.  Thank you.

Wenn du wirklich denkst, dass da was buggy wäre, dann schreib' bitte
einen AVRDUDE-Bugreport und häng die Datei mit an, um die es geht.

Hint: die Adressen im Hexfile kann man sich auch mit objdump ganz gut
ansehen:
1
% avr-objdump -h /tmp/foo.hex
2

3
/tmp/foo.hex:     file format ihex
4

5
Sections:
6
Idx Name          Size      VMA       LMA       File off  Algn
7
  0 .sec1         00000020  0003e000  0003e000  00000010  2**0
8
                  CONTENTS, ALLOC, LOAD
Moderator Persönliche Seite #2909823
Lesenswert?

Thomas K. schrieb:
> Welche Version hast du?

Das erste war eine von "kurz vor 5.11", das zweite die aus dem SVN.

Thomas K. schrieb:
> die 5.8 ist auf dem Mac

Hmm, ob's da ein 64-bit-Problem geben könnte?

Nö, habe eben mal die SVN-Version auf einem Mac getestet:
1
% ./avrdude -C avrdude.conf -c jtag2 -p m2560 -U /tmp/foo.hex 
2

3
avrdude: jtagmkII_initialize(): warning: OCDEN fuse not programmed, single-byte EEPROM updates not possible
4
avrdude: AVR device initialized and ready to accept instructions
5

6
Reading | ################################################## | 100% 0.00s
7

8
avrdude: Device signature = 0x1e9801
9
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
10
         To disable this feature, specify the -D option.
11
avrdude: erasing chip
12
avrdude: jtagmkII_initialize(): warning: OCDEN fuse not programmed, single-byte EEPROM updates not possible
13
avrdude: reading input file "/tmp/foo.hex"
14
avrdude: input file /tmp/foo.hex auto detected as Intel Hex
15
avrdude: WARNING: no end of file record found for Intel Hex file "/tmp/foo.hex"
16
avrdude: writing flash (253984 bytes):
17

18
Writing | ################################################## | 100% 0.02s
19

20
avrdude: 253984 bytes of flash written
21
avrdude: verifying flash memory against /tmp/foo.hex:
22
avrdude: load data flash data from input file /tmp/foo.hex:
23
avrdude: input file /tmp/foo.hex auto detected as Intel Hex
24
avrdude: WARNING: no end of file record found for Intel Hex file "/tmp/foo.hex"
25
avrdude: input file /tmp/foo.hex contains 253984 bytes
26
avrdude: reading on-chip flash data:
27

28
Reading | ################################################## | 100% 0.02s
29

30
avrdude: verifying ...
31
avrdude: 253984 bytes of flash verified
32

33
avrdude: safemode: Fuses OK
34

35
avrdude done.  Thank you.

Kann mir auch nicht vorstellen, dass da in Version 5.8 ein Bug
gewesen wäre.  Am Hexfile-Parser ist seit Jahr und Tag nichts
mehr geändert worden.  Das stammt zum allergrößten Teil noch von
Brian Dean selbst (SVN-Revisions < 100; aktuell sind wir bei 1103).

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren