Forum: Mikrocontroller und Digitale Elektronik Anfänger; Pollin v2.01· µCs lassen sich scheinbar nicht flashen


von Andi M. (rootsquash)


Angehängte Dateien:

Lesenswert?

Hi.

Ich hab im Juni(?) angefangen mit Mikrocontrollerprogrammierung, gesehen 
dass es klappt und erstmal Pause gemacht, da ich anderes zu tun hatte.

Jetzt wollte ich weitermachen und musste feststellen, dass ich plötzlich 
zu blöd zum Flashen bin:

Der Tiny2313 von "damals" macht noch immer das Gleiche, auch wenn ich 
versuche andere Programme aufzuspielen und auch mit einem neuen Mega8 
komme ich nicht vorwärts, der tut einfach garnichts.
Zum Mega8-Versuch sind main.c und Makefile im Anhang:
1
user@host ~/Projekte/µC/Programme/firststeps/1st $ make clean
2
3
-------- begin --------
4
5
Cleaning project:
6
rm -f main.hex
7
rm -f main.eep
8
rm -f main.obj
9
rm -f main.cof
10
rm -f main.elf
11
rm -f main.map
12
rm -f main.obj
13
rm -f main.a90
14
rm -f main.sym
15
rm -f main.lnk
16
rm -f main.lss
17
rm -f main.o  
18
rm -f  main.lst
19
rm -f main.s
20
rm -f main.d
21
rm -f .dep/*
22
Errors: none
23
-------- end --------
24
25
user@host ~/Projekte/µC/Programme/firststeps/1st $ make all
26
27
-------- begin --------
28
avr-gcc (Gentoo 4.5.3-r1 p1.0, pie-0.4.5) 4.5.3
29
Copyright (C) 2010 Free Software Foundation, Inc.
30
This is free software; see the source for copying conditions.  There is NO
31
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
32
33
34
Compiling: main.c
35
avr-gcc -c -mmcu=atmega8 -I. -gdwarf-2   -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=main.lst  -std=gnu99 -DF_OSC=3686400 -MD -MP -MF .dep/main.o.d main.c -o main.o 
36
37
Linking: main.elf
38
avr-gcc -mmcu=atmega8 -I. -gdwarf-2   -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=main.o  -std=gnu99 -DF_OSC=3686400 -MD -MP -MF .dep/main.elf.d main.o   --output main.elf -Wl,-Map=main.map,--cref    -lm
39
40
Creating load file for Flash: main.hex
41
avr-objcopy -O ihex -R .eeprom main.elf main.hex
42
43
Creating load file for EEPROM: main.eep
44
avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \
45
--change-section-lma .eeprom=0 -O ihex main.elf main.eep
46
avr-objcopy: --change-section-lma .eeprom=0x0000000000000000 never used
47
48
Creating Extended Listing: main.lss
49
avr-objdump -h -S main.elf > main.lss
50
51
Creating Symbol Table: main.sym
52
avr-nm -n main.elf > main.sym
53
54
Size after:
55
main.elf  :
56
section           size   addr
57
.text              110      0
58
.debug_aranges      32      0
59
.debug_pubnames     27      0
60
.debug_info        130      0
61
.debug_abbrev       78      0
62
.debug_line        129      0
63
.debug_frame        32      0
64
.debug_str         132      0
65
.debug_pubtypes     30      0
66
Total              700
67
68
69
70
Errors: none
71
-------- end --------
72
73
user@host ~/Projekte/µC/Programme/firststeps/1st $ avrdude -p m8 -c ponyser -P /dev/ttyS0 main.hex  -v
74
75
avrdude: Version 5.11, compiled on Sep 20 2011 at 17:46:23
76
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
77
         Copyright (c) 2007-2009 Joerg Wunsch
78
79
         System wide configuration file is "/etc/avrdude.conf"
80
         User configuration file is "/home/user/.avrduderc"
81
         User configuration file does not exist or is not a regular file, skipping
82
83
         Using Port                    : /dev/ttyS0
84
         Using Programmer              : ponyser
85
         AVR Part                      : ATMEGA8
86
         Chip Erase delay              : 10000 us
87
         PAGEL                         : PD7
88
         BS2                           : PC2
89
         RESET disposition             : dedicated
90
         RETRY pulse                   : SCK
91
         serial program mode           : yes
92
         parallel program mode         : yes
93
         Timeout                       : 200
94
         StabDelay                     : 100
95
         CmdexeDelay                   : 25
96
         SyncLoops                     : 32
97
         ByteDelay                     : 0
98
         PollIndex                     : 3
99
         PollValue                     : 0x53
100
         Memory Detail                 :
101
102
                                  Block Poll               Page                       Polled
103
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
104
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
105
           eeprom         4    20   128    0 no        512    4      0  9000  9000 0xff 0xff
106
           flash         33    10    64    0 yes      8192   64    128  4500  4500 0xff 0x00
107
           lfuse          0     0     0    0 no          1    0      0  2000  2000 0x00 0x00
108
           hfuse          0     0     0    0 no          1    0      0  2000  2000 0x00 0x00
109
           lock           0     0     0    0 no          1    0      0  2000  2000 0x00 0x00
110
           calibration    0     0     0    0 no          4    0      0     0     0 0x00 0x00
111
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
112
113
         Programmer Type : SERBB
114
         Description     : design ponyprog serial, reset=!txd sck=rts mosi=dtr miso=cts
115
116
avrdude: AVR device initialized and ready to accept instructions
117
118
Reading | ################################################## | 100% 0.00s
119
120
avrdude: Device signature = 0x1e9307
121
avrdude: safemode: lfuse reads as E1
122
avrdude: safemode: hfuse reads as D9
123
124
avrdude: safemode: lfuse reads as E1
125
avrdude: safemode: hfuse reads as D9
126
avrdude: safemode: Fuses OK
127
128
avrdude done.  Thank you.

Ich würde erwarten dass da eine LED aufleuchtet (idealerweise sogar 2 
LEDs), tut sie aber nicht.

Habe ich irgendwas vergessen?
Board hängt an 9 Volt und die serielle Verbindung an "ISP", aber das 
wird wohl passen, sonst wäre ja der AVRDUDE unzufriedener...

von Dominik S. (dasd)


Lesenswert?

Ich kenn mich mit AVRdude jetzt mal gar nicht aus, aber rein von dem Log 
her sieht es für mich so aus als ob du garnichts auf den Controller 
schreiben würdest (sondern nur die Fuses auslesen).

Kann es sein, dass deine Optionen für den AVRdude nicht passen?
Müsste das ganze nicht eher wie hier 
(http://www.ladyada.net/images/avrtutorial/testledshexprog.jpg) 
aussehen?

Edit:
Eindeutig... schau mal hier: 
http://wiki.ctbot.de/index.php/AVR_ISP_Programmer#BlueMP3_bzw._STK200_kompatible_Flasher
Dier fehlt zumindest ein -U vor dem Dateinamen.

von Andi M. (rootsquash)


Lesenswert?

Ich hoffe dass es sowas in der Art ist....

rumprobier

von Andi M. (rootsquash)


Lesenswert?

Dominik S. schrieb:

> Edit:
> Eindeutig... schau mal hier:
> 
http://wiki.ctbot.de/index.php/AVR_ISP_Programmer#BlueMP3_bzw._STK200_kompatible_Flasher
> Dier fehlt zumindest ein -U vor dem Dateinamen.

avrdude -p m8 -c ponyser -P /dev/ttyS0 -U flash:w:main.hex

Ha, genau das wars, danke.
Da hat mich mein Gedächtnis ja mal ordentlich im Stich gelassen..

Ich kann mich aber einfach nicht erinnern diesen "umständlichen" 
Parameter benutzt zu haben... komisch...

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.