Forum: Compiler & IDEs AVRDude upload Problem AVRISP MKII


von Mario W. (Firma: Privat) (wlfmario)


Lesenswert?

Hallo zusammen,

ich bin ganz frisch in Sachen Linux daher etwas Nachsicht !

Nun zu mein Problem:
Ich habe ein stk500 Board mit einem Atmega328P den ich über den AVRISP 
MK II beschreiben möchte.
Ich benutze Visual Studio Code mit PlatformIO auf Ubuntu 20.04.

Beim Upload bekomme ich immer folgende Fehlermeldung:
1
avrdude error: cannot find programmer id  avrispmkII

jetzt versuche ich schon seit Stunden die PlatformIO .ini Datei 
anzupassen, jedoch ohne Erfolg.

Hier mal die .ini
1
[env:ATmega328P]
2
platform = atmelavr
3
board = ATmega328P
4
framework = arduino
5
upload_port = usb
6
upload_protocol = custom
7
upload_flags =
8
    -c avrispmkII 
9
    -p m328P
10
11
upload_command = avrdude $UPLOAD_FLAGS -U flash:w:$SOURCE:i
Es scheint als würde es den Mk2 im System nicht zu geben oder ich 
verstehe die .ini nicht richtig.
Hardware Fehler können ausgeschlossen werden, da unter Windows mit 
Microchip Studio 7 alles funktioniert.
Evtl hat jemand einen Tipp, was ich machen muss, damit der Upload 
klappt.

von MaWin O. (mawin_original)


Lesenswert?

Mario W. schrieb:
> avrdude error: cannot find programmer id  avrispmkII

Versuch mal avrisp2

von Mario W. (Firma: Privat) (wlfmario)


Lesenswert?

MaWin O. schrieb:
> Mario W. schrieb:
>> avrdude error: cannot find programmer id  avrispmkII
>
> Versuch mal avrisp2

Leider der gleiche Fehler !

von Alexander S. (alesi)


Lesenswert?

Hallo,

Du könntest in einem xterm
1
avrdude -c avrispmkII -p m328P -P usb -n -vv
eingeben, um zu testen, ob es an avrdude liegt.
Mit -n (no-write) wird nichts geschrieben, -vv gibt etwas mehr aus als 
nur -v

von Mario W. (Firma: Privat) (wlfmario)


Lesenswert?

Alexander S. schrieb:
> Hallo,
>
> Du könntest in einem xterm
>
1
> avrdude -c avrispmkII -p m328P -P usb -n -vv
2
>
> eingeben, um zu testen, ob es an avrdude liegt.
> Mit -n (no-write) wird nichts geschrieben, -vv gibt etwas mehr aus als
> nur -v

Damit geht es ohne Fehler so wie ich das sehe !
1
avrdude: Version 6.3-20171130
2
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
3
         Copyright (c) 2007-2014 Joerg Wunsch
4
5
         System wide configuration file is "/etc/avrdude.conf"
6
         User configuration file is "/home/mario/.avrduderc"
7
         User configuration file does not exist or is not a regular file, skipping
8
9
         Using Port                    : usb
10
         Using Programmer              : avrispmkII
11
avrdude: usbdev_open(): Found AVRISP mkII, serno: 0000B3000305
12
         AVR Part                      : ATmega328P
13
         Chip Erase delay              : 9000 us
14
         PAGEL                         : PD7
15
         BS2                           : PC2
16
         RESET disposition             : dedicated
17
         RETRY pulse                   : SCK
18
         serial program mode           : yes
19
         parallel program mode         : yes
20
         Timeout                       : 200
21
         StabDelay                     : 100
22
         CmdexeDelay                   : 25
23
         SyncLoops                     : 32
24
         ByteDelay                     : 0
25
         PollIndex                     : 3
26
         PollValue                     : 0x53
27
         Memory Detail                 :
28
29
                                  Block Poll               Page                       Polled
30
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
31
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
32
           eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
33
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
34
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
35
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
36
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
37
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
38
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
39
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
40
41
         Programmer Type : STK500V2
42
         Description     : Atmel AVR ISP mkII
43
         Programmer Model: AVRISP mkII
44
         Hardware Version: 1
45
         Firmware Version Master : 1.24
46
         Vtarget         : 4.7 V
47
         SCK period      : 8.00 us
48
49
avrdude: AVR device initialized and ready to accept instructions
50
51
Reading |                                                    | 0% 0.00savrdude: stk500isp_read_byte(.., signature, 0x0, ...)
52
avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: stk500isp_read_byte(.., signature, 0x1, ...)
53
Reading | #################                                  | 33% 0.00savrdude: stk500isp_read_byte(.., signature, 0x2, ...)
54
Reading | ################################################## | 100% 0.00s
55
56
avrdude: Device signature = 0x1e950f (probably m328p)
57
avrdude: stk500isp_read_byte(.., lfuse, 0x0, ...)
58
avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: stk500isp_read_byte(.., lfuse, 0x0, ...)
59
avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: stk500isp_read_byte(.., lfuse, 0x0, ...)
60
avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: safemode: lfuse reads as FF
61
avrdude: stk500isp_read_byte(.., hfuse, 0x0, ...)
62
avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: stk500isp_read_byte(.., hfuse, 0x0, ...)
63
avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: stk500isp_read_byte(.., hfuse, 0x0, ...)
64
avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: safemode: hfuse reads as DE
65
avrdude: stk500isp_read_byte(.., efuse, 0x0, ...)
66
avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: stk500isp_read_byte(.., efuse, 0x0, ...)
67
avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: stk500isp_read_byte(.., efuse, 0x0, ...)
68
avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: safemode: efuse reads as FD
69
70
avrdude: stk500isp_read_byte(.., lfuse, 0x0, ...)
71
avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: stk500isp_read_byte(.., lfuse, 0x0, ...)
72
avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: stk500isp_read_byte(.., lfuse, 0x0, ...)
73
avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: safemode: lfuse reads as FF
74
avrdude: stk500isp_read_byte(.., hfuse, 0x0, ...)
75
avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: stk500isp_read_byte(.., hfuse, 0x0, ...)
76
avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: stk500isp_read_byte(.., hfuse, 0x0, ...)
77
avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: safemode: hfuse reads as DE
78
avrdude: stk500isp_read_byte(.., efuse, 0x0, ...)
79
avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: stk500isp_read_byte(.., efuse, 0x0, ...)
80
avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: stk500isp_read_byte(.., efuse, 0x0, ...)
81
avrdude: stk500isp_read_byte(): Sending read memory command: avrdude: safemode: efuse reads as FD
82
avrdude: safemode: Fuses OK (E:FD, H:DE, L:FF)
83
84
avrdude done.  Thank you.

von Frank L. (florenzen)


Lesenswert?

Mario W. schrieb:
> Hallo zusammen,

[...]
1
upload_port = usb
2
upload_protocol = custom
3
upload_flags =
4
    -c avrispmkII
5
    -p m328P
6
7
upload_command = avrdude $UPLOAD_FLAGS -U flash:w:$SOURCE:i
[...]

Bist du dir sicher daß '-P usb' in die Parameterliste übernommen wird?


Gruß,
f

von Jörg W. (dl8dtl) (Moderator) Benutzerseite


Lesenswert?

Mario W. schrieb:
> Damit geht es ohne Fehler so wie ich das sehe !

Dann sieht es so aus, als würden dein VScode irgendein anderes AVRDUDE 
benutzen, bei dem die Konfigurationsdatei nicht richtig dazu passt.

Musst du mal gucken, ob du da irgendwas einstellen kannst und das 
systemweite AVRDUDE benutzen kannst, welches ja offenbar geht.

von Jörg W. (dl8dtl) (Moderator) Benutzerseite


Lesenswert?

Frank L. schrieb:
> Bist du dir sicher daß '-P usb' in die Parameterliste übernommen wird?

Ist beim AVRISPmkII überflüssig, da es der Default ist. Das Ding kann 
man ja nur über USB ansprechen.

Außerdem passt die Fehlermeldung
1
cannot find programmer id  avrispmkII

nicht zu einer falsch konfigurierten Verbindung.

: Bearbeitet durch Moderator
von Mario W. (Firma: Privat) (wlfmario)


Lesenswert?

Ich habe jetzt viel gelesen und zum Schluss die Vorschläge von 
Platformio
übernommen und angepasst.
Warum auch immer funktioniert es jetzt.
Für alle die evtl. den Fehler auch einmal haben meine Einstellungen in 
der .ini.
Danke für eure Hilfe.
1
[env:program_via_AVRISP_mkII]
2
platform = atmelavr
3
framework = arduino
4
board = ATmega328P
5
upload_protocol = custom
6
upload_port = usb
7
upload_flags =
8
    -C
9
    ${platformio.packages_dir}/tool-avrdude/avrdude.conf
10
    -p
11
    $BOARD_MCU
12
    -P
13
    $UPLOAD_PORT
14
    -c
15
    avrispmkII
16
upload_command = avrdude $UPLOAD_FLAGS -U flash:w:$SOURCE:i

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.