AVRdude und hex mit allen Datenbereichen?

Gast #1866097
Lesenswert?

Ich versuche gerade Elm ChaNs sd WAV player zu flashen, auf einen neuen 
t85:
1
avrdude -p t85 -c avrispv2 -P COM5 -U flash:w:sd8p_mo.hex
2

3
avrdude: AVR device initialized and ready to accept instructions
4

5
Reading | ################################################## | 100% 0.02s
6

7
avrdude: Device signature = 0x1e930b
8
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
9

10
         To disable this feature, specify the -D option.
11
avrdude: erasing chip
12
avrdude: reading input file "sd8p_mo.hex"
13
avrdude: input file sd8p_mo.hex auto detected as Intel Hex
14
avrdude: ERROR: address 0x820003 out of range at line 378 of sd8p_mo.hex
15
avrdude: write to file 'sd8p_mo.hex' failed
16

17
avrdude: safemode: Fuses OK
18

19
avrdude done.  Thank you.


Die Fuse Bytes sind wohl mit im HEX
1
/* This is the fuse settings for each operating mode. The fuse data will be
2
   included in an output hex file with program code. However some flash programmers
3
   may not support this sort of hex files. If it is the case, use these values
4
   to program the fuse bits.
5
*/
6
#if   MODE == 0
7
FUSES = {0xE1, 0xDD, 0x01};  /* Mono: Low, High and Extended */
8
#elif MODE >= 1
9
FUSES = {0xE1, 0x7D, 0x01};  /* Stereo/Hi-Fi: Low, High and Extended (*HVS mode only*) */
10
#endif


Was läuft da schief? Wieso will er überhaupt in eine Datei schreiben?

http://elm-chan.org/works/sd8p/report.html
http://www.nongnu.org/avrdude/user-manual/avrdude_4.html#Option-Descriptions
Moderator Persönliche Seite #1866138
Lesenswert?

Du versuchst, die Fuses mitsamt Offset in den Flash zu schreiben.
Das geht nicht.

AVRDUDE unterstützt derzeit nur das Schreiben eines Speicherbereichs
pro -U-Option, du musst also dein ELF-File in ein Hex-File pro
Speicherbereich aufteilen (aber nicht vergessen, dass der Flash
nicht nur .text bekommt, sondern auch .data, wegen der Initialisierung
der Variablen).  Den ELF-internen Offset musst du dabei außerdem von
avr-objcopy rausrechnen lassen (mit --change-section-address).
Gast #1866265
Lesenswert?

Gut, ich habe die fuses section in der letzten Zeile des Makefile_mo 
entfernt, deine Tips sind etwas zu hoch für mich (danke trotzdem).
1
$(OBJCOPY) -j .text -j .data -O ihex $< $@

Bei der extended fuse bekomme ich leider einen Fehler:
1
avrdude -p t85 -P C
2
OM5 -c AVRISPv2 -U flash:w:sd8p_mo.hex -U lfuse:w:0xe1:m -U hfuse:w:0xdd:m -U ef
3
use:w:0x01:m
4

5
avrdude: AVR device initialized and ready to accept instructions
6

7
Reading | ################################################## | 100% 0.03s
8

9
avrdude: Device signature = 0x1e930b
10
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
11

12
         To disable this feature, specify the -D option.
13
avrdude: erasing chip
14
avrdude: reading input file "sd8p_mo.hex"
15
avrdude: input file sd8p_mo.hex auto detected as Intel Hex
16
avrdude: writing flash (5994 bytes):
17

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

20
avrdude: 5994 bytes of flash written
21
avrdude: verifying flash memory against sd8p_mo.hex:
22
avrdude: load data flash data from input file sd8p_mo.hex:
23
avrdude: input file sd8p_mo.hex auto detected as Intel Hex
24
avrdude: input file sd8p_mo.hex contains 5994 bytes
25
avrdude: reading on-chip flash data:
26

27
Reading | ################################################## | 100% 1.37s
28

29
avrdude: verifying ...
30
avrdude: 5994 bytes of flash verified
31
avrdude: reading input file "0xe1"
32
avrdude: writing lfuse (1 bytes):
33

34
Writing | ################################################## | 100% 0.02s
35

36
avrdude: 1 bytes of lfuse written
37
avrdude: verifying lfuse memory against 0xe1:
38
avrdude: load data lfuse data from input file 0xe1:
39
avrdude: input file 0xe1 contains 1 bytes
40
avrdude: reading on-chip lfuse data:
41

42
Reading | ################################################## | 100% 0.00s
43

44
avrdude: verifying ...
45
avrdude: 1 bytes of lfuse verified
46
avrdude: reading input file "0xdd"
47
avrdude: writing hfuse (1 bytes):
48

49
Writing | ################################################## | 100% 0.00s
50

51
avrdude: 1 bytes of hfuse written
52
avrdude: verifying hfuse memory against 0xdd:
53
avrdude: load data hfuse data from input file 0xdd:
54
avrdude: input file 0xdd contains 1 bytes
55
avrdude: reading on-chip hfuse data:
56

57
Reading | ################################################## | 100% 0.00s
58

59
avrdude: verifying ...
60
avrdude: 1 bytes of hfuse verified
61
avrdude: reading input file "0x01"
62
avrdude: writing efuse (1 bytes):
63

64
Writing |                                                    | 0% 0.00s ***faile
65
d;
66
Writing | ################################################## | 100% 0.09s
67

68
avrdude: 1 bytes of efuse written
69
avrdude: verifying efuse memory against 0x01:
70
avrdude: load data efuse data from input file 0x01:
71
avrdude: input file 0x01 contains 1 bytes
72
avrdude: reading on-chip efuse data:
73

74
Reading | ################################################## | 100% 0.00s
75

76
avrdude: verifying ...
77
avrdude: verification error, first mismatch at byte 0x0000
78
         0x01 != 0x00
79
avrdude: verification error; content mismatch
80

81
avrdude: safemode: lfuse changed! Was e1, and is now 0
82
Would you like this fuse to be changed back? [y/n] n
83
avrdude: safemode: hfuse changed! Was dd, and is now 0
84
Would you like this fuse to be changed back? [y/n] n
85
avrdude: safemode: efuse changed! Was 1, and is now 0
86
Would you like this fuse to be changed back? [y/n] n
87
avrdude: safemode: Fuses OK
88

89
avrdude done.  Thank you.


Als ich eben mal yes angegeben habe, erschien der erste BSOD seit 
Jahren: DRIVER_IRQL_NOT_LESS_OR_EQUAL

AVRISP blieb dann bei roter oder oranger LED hängen, während ich Win7 
neustartete.
1
avrdude
2
Usage: avrdude [options]
3
Options:
4
  -p <partno>                Required. Specify AVR device.
5
  -b <baudrate>              Override RS-232 baud rate.
6
  -B <bitclock>              Specify JTAG/STK500v2 bit clock period (us).
7
  -C <config-file>           Specify location of configuration file.
8
  -c <programmer>            Specify programmer type.
9
  -D                         Disable auto erase for flash memory
10
  -i <delay>                 ISP Clock Delay [in microseconds]
11
  -P <port>                  Specify connection port.
12
  -F                         Override invalid signature check.
13
  -e                         Perform a chip erase.
14
  -O                         Perform RC oscillator calibration (see AVR053).
15
  -U <memtype>:r|w|v:<filename>[:format]
16
                             Memory operation specification.
17
                             Multiple -U options are allowed, each request
18
                             is performed in the order specified.
19
  -n                         Do not write anything to the device.
20
  -V                         Do not verify.
21
  -u                         Disable safemode, default when running from a scrip
22
t.
23
  -s                         Silent safemode operation, will not ask you if
24
                             fuses should be changed back.
25
  -t                         Enter terminal mode.
26
  -E <exitspec>[,<exitspec>] List programmer exit specifications.
27
  -x <extended_param>        Pass <extended_param> to programmer.
28
  -y                         Count # erase cycles in EEPROM.
29
  -Y <number>                Initialize erase cycle # in EEPROM.
30
  -v                         Verbose output. -v -v for more.
31
  -q                         Quell progress output. -q -q for less.
32
  -?                         Display this usage.
33

34
avrdude version 5.10, URL: <http://savannah.nongnu.org/projects/avrdude/>

Mhh, eigentlich sollte es ein 5-Minuten-Projekt werden :-)

Aber vielleicht kannst du mir noch weiterhelfen?

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