Problem beim Bootloader brennen Atmega4809

OP #6276428
Lesenswert?

auf die Platine Beitrag "Atmega4809nano" soll ein 
Bootloader.

als UPDI Programmer wird ein Atmega328 mit der Software von ElTangas 
verwendet. Atmega328 Pin D6 ist über 4.7k mit dem UPDI-Pin des 
Atmega4809 verbunden und Pin RST des Atmega328 ist über 470nF mit VCC 
verbunden, so wie ElTangas das zeigt.

Atmega328 und Atmega4809 sind über VCC, GND miteinander verbunden. Die 
Spannung über USB beträgt laut Oszi ~4.5V.

Der Atmega328 Programmer meldet sich als USB-SERIAL CH340 (COM4).

In der Arduino-Umgebung 1.8.9 ist eingestellt:
1
"Werkzeuge", "Board", "MegaCoreX" Atmega4809
2
Bootloader: "Optiboot (UART3 default pins)"
3
Clock: "Internal 16 MHz"
4
Pinout: "48 pin standard"
5
Reset pin: "Reset"
6
Programmer: "JTAG2UPDI"
7
Port COM4

Bei "Bootloader brennen" Bootloader erscheint "Fehler beim Brennen des 
Bootloaders" und diese Ausgabe:
1
Arduino: 1.8.9 (Windows 7), Board: "ATmega4809, 48 pin standard, Reset, BOD 
2
2.6V, Internal 16 MHz, Optiboot (UART3 default pins)"
3

4
avrdude: Version 6.3-20171130
5
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
6
         Copyright (c) 2007-2014 Joerg Wunsch
7

8
         System wide configuration file is "C:\Program Files (x86)\Arduino
9
\hardware\MegaCoreX-master\megaavr/avrdude.conf"
10

11
         Using Port                    : COM4
12
         Using Programmer              : jtag2updi
13
JTAG ICE mkII sign-on message:
14
Communications protocol version: 1
15
M_MCU:
16
  boot-loader FW version:        1
17
  firmware version:              6.00
18
  hardware version:              1
19
S_MCU:
20
  boot-loader FW version:        1
21
  firmware version:              6.00
22
  hardware version:              1
23
Serial number:                   00:00:00:00:00:00
24
Device ID:                       JTAGICE mkII
25
         AVR Part                      : ATmega4809
26
         Chip Erase delay              : 0 us
27
         PAGEL                         : P00
28
         BS2                           : P00
29
         RESET disposition             : dedicated
30
         RETRY pulse                   : SCK
31
         serial program mode           : yes
32
         parallel program mode         : yes
33
         Timeout                       : 0
34
         StabDelay                     : 0
35
         CmdexeDelay                   : 0
36
         SyncLoops                     : 0
37
         ByteDelay                     : 0
38
         PollIndex                     : 0
39
         PollValue                     : 0x00
40
         Memory Detail                 :
41

42
                                  Block Poll               Page                 
43
      Polled
44
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  
45
MaxW   ReadBack
46
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- 
47
----- ---------
48
           signature      0     0     0    0 no          3    0      0     0    
49
 0 0x00 0x00
50
           prodsig        0     0     0    0 no         61   61      0     0    
51
 0 0x00 0x00
52
           fuses          0     0     0    0 no          9    0      0     0    
53
 0 0x00 0x00
54
           fuse0          0     0     0    0 no          1    0      0     0    
55
 0 0x00 0x00
56
           fuse1          0     0     0    0 no          1    0      0     0    
57
 0 0x00 0x00
58
           fuse2          0     0     0    0 no          1    0      0     0    
59
 0 0x00 0x00
60
           fuse4          0     0     0    0 no          1    0      0     0    
61
 0 0x00 0x00
62
           fuse5          0     0     0    0 no          1    0      0     0    
63
 0 0x00 0x00
64
           fuse6          0     0     0    0 no          1    0      0     0    
65
 0 0x00 0x00
66
           fuse7          0     0     0    0 no          1    0      0     0    
67
 0 0x00 0x00
68
           fuse8          0     0     0    0 no          1    0      0     0    
69
 0 0x00 0x00
70
           lock           0     0     0    0 no          1    0      0     0    
71
 0 0x00 0x00
72
           data           0     0     0    0 no          0    0      0     0    
73
 0 0x00 0x00
74
           usersig        0     0     0    0 no         64   64      0     0    
75
 0 0x00 0x00
76
           flash          0     0     0    0 no      49152  128      0     0    
77
 0 0x00 0x00
78
           eeprom         0     0     0    0 no        256   64      0     0    
79
 0 0x00 0x00
80

81
         Programmer Type : JTAGMKII_PDI
82
         Description     : JTAGv2 to UPDI bridge
83
         M_MCU hardware version: 1
84
         M_MCU firmware version: 6.00
85
         S_MCU hardware version: 1
86
         S_MCU firmware version: 6.00
87
         Serial number:          00:00:00:00:00:00
88
Fehler beim Brennen des Bootloaders.
89
         Vtarget         : 5.0 V
90

91
avrdude: jtagmkII_initialize(): part ATmega4809 has no PDI interface
92
avrdude: initialization failed, rc=-1
93
         Double check connections and try again, or use -F to override
94
         this check.
95

96
avrdude: jtagmkII_close(): bad response to sign-off command: 
97
RSP_ILLEGAL_MCU_STATE
98

99
avrdude done.  Thank you.

die Verbindungen erscheinen ok. Auf der UPDI-Leitung kann ich ein paar 
Pulse sehen die der Atmega328 sendet. AVRDUDE scheint auch aktuell. Bei 
der 2. Platine kommt dieselbe Meldung.

woran kann das Problem liegen?
hat jemand Lust ein Leerboard zu bestücken und testen?

Gruss
Matthias
Gast #6276483
Lesenswert?

> avrdude: jtagmkII_initialize(): part ATmega4809 has no PDI interface

Warum PDI? Es müsste doch UPDI sein!

Im der Konfigurationsdatei die dem offiziellen Download von avrdude 6.3 
(aus dem Jahr 2016!) beiliegt, gibt es es aber weder "udpi" noch "4809". 
Auch im Quelltext kommt das Wort "updi" nicht vor.

Aber in der Version, die in Debian 10 und Arduino enthalten ist, gibt es 
"updi" sowohl in der Konfigurationsdatei als auch im Quelltext. Der 
m4809 gehört zur avr8x Familie und die hat dort "has_updi = true".

Offenbar hat jemand fehlerhaft gepatchte Versionen des Programms in 
Umlauf gebracht, die inzwischen sogar in Debian enthalten sind.

Jörg, sage mal was dazu.
OP #6276726
Lesenswert?

laut Beispiel klappt es mit avrdude -c jtag2updi -P COM15 -p m4809 -U 
flash:w:4809_Blinky.hex einen 4809 zu programmieren.

das Blink-Beispiel mit avrdude -v -v -p atmega4809 -c jtag2updi -P COM7 
-U flash:w:Blink.ino.hex bringt auf dem anderen Laptop die 
Fehlermeldung: avrdude: Can't find programmer id "jtag2updi".

in avrdude.conf ist kein Eintrag zu jtag2updi. Es gibt jedoch 
"jtag2pdi".

welches avrdude.conf soll ich nehmen?

Gruss
Matthias
OP #6276756
Lesenswert?

Elektor muss auch etwas Funktionierendes gehabt haben:
https://www.elektormagazine.com/labs/arduino-for-updi-programming-for-atmega4809-and-tiny816817-with-jtag2updi

"For the ATMega48090 to give an example, we assume a 4809_Blinky.hex and 
also COM15 as the programmers port. In this case the command would be:
avrdude -c jtag2updi -P COM15 -p m4809 -U flash:w:4809_Blinky.hex"

daran hatte ich mich angelehnt - nur klappt es bei mir so eben nicht.
OP #6276808
Lesenswert?

wenn ich http://download.savannah.gnu.org/releases/avrdude/ anschaue, so 
scheint dies 2016: avrdude-6.3-mingw32.zip 17-Feb-2016 10:03.

meines ist neuer, 6.3-20171130.

hier wird behauptet dass AVRDUDE 6.3 jtag2updi kann:
https://www.avrfreaks.net/forum/atmega4809-pf-programming-avrdude
"But Avrdude v6.3 can use: -c jtag2updi"
"And if I ask for -c? I get:
jtag2updi        = JTAGv2 to UPDI bridge"

es gibt offenbar mehrere builds:
"I suspect that there are several "v6.3" builds on the Internet."

wo finde ich den richtigen Build?

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