Forum: Compiler & IDEs Eclipse, GDB, avarice, JTAGICE_mkII - Debuggen funktioniert nicht


von marsbotschafter (Gast)


Lesenswert?

Ich lese hier im Forum einiges über die oben genannten Tools. Trotzdem 
mache ich einen eigenen Thread auf, weil meine Fehler doch spezifischer 
zu sein scheinen.
Zur Vorgeschichte: Ich programmiere einen ATmega128 mit WinAVR-20100110 
unter avr-g++ (C++). Als IDE kommt Eclipse zum Einsatz. Bisher hab ich 
das generierte elf-File mit AVR-Studio 4 geladen und versucht zu 
debuggen. Das hat zwar funktioniert, AVR-Studio hatte allerdings seine 
Probleme damit. Ich bin nun auf AVR-Studio 5 umgestiegen um 
festzustellen das das debuggen nun gar nicht mehr funktioniert.
Bei der Programmierung von ARM-Controllern setzte ich schon seit 
längerem Eclipse mit GDB ein und das funktioniert eigentlich gut und 
stabil, warum also nicht auch bei den 8-Bitern einsetzen. Aber hier 
beginnen nun die Probleme, ich bekomme es nämlich nicht zu laufen.

Als Betriebssystem kommt Windows zum Einsatz. Dabei hab ich es unter 
Windows XP, als auch mit Windows 7 (64-Bit) probiert, mit dem gleichen 
Ergebnis und dem gleichen Verhalten.
Die Konfiguration von Eclipse (Indigo), GDB und avarice (Version 2.9 von 
WinAVR) ist meiner Meinung nach o.k. und wurde mehrfach verifiziert.
Wenn im JTAGICE_mkII die Firmware V6.07 geflasht ist kommt seitens 
AVARICE folgende Meldung, ich brauche mit dem Debuggen gar nicht erst 
anzufangen:

C:\WinAVR-20100110\bin>avarice -2 -I -d --jtag usb --jtag-bitrate 22 
:4242
AVaRICE version 2.9, Jan  7 2010 22:42:57

Found JTAG ICE, serno: 00A0000016EF
JTAG config starting.
Attempting synchronisation at bitrate 19200

command[0x01, 1]: 01
recv: 0x1b
recv: 0x00
recv: 0x00
recv: 0x1c
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 28 bytes
read:  86 01 ff 07 06 00 ff 07 06 00 00 a0 00 00 16 ef 4a 54 41 47 49 43 
45 6d 6
b 49 49 00
recv: 0x4c
recv: 0x82
CRC OK
Got message seqno 0 (command_sequence == 0)
response: 86 01 FF 07 06 00 FF 07 06 00 00 A0 00 00 16 EF 4A 54 41 47 49 
43 45 6
D 6B 49 49 00
Found a device: JTAGICEmkII
Serial number:  00:a0:00:00:16:ef
JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:        255
  firmware version:              6.07
  hardware version:              0
S_MCU:
  boot-loader FW version:        255
  firmware version:              6.07
  hardware version:              0

command[0x02, 1]: 02 03 01
recv: 0x1b
recv: 0x01
recv: 0x00
recv: 0x01
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 1 bytes
read:  ab
recv: 0x1c
recv: 0x1c
CRC OK
Got message seqno 1 (command_sequence == 1)
response: AB
set paramater command failed



Ist im JTAGICE_mkII die Firmware von AVRstudio5 installiert schaut es 
erst mal besser aus, aber beim starten des Debuggers kann dann trotzdem 
kein File geflasht werden. Hier ein kleiner Ausschnitt des Logs (der 
ganze Log ist mir leider verloren gegangen):

Got message seqno 10 (command_sequence == 10)
response: 80
Waiting for input.
recv: 0x1b
recv: 0xff
recv: 0xff
recv: 0x06
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 6 bytes
read:  e0 00 00 00 00 00
recv: 0x4e
recv: 0x2d
CRC OK
command[0x02, 1]: 02 09 00
recv: 0x1b
recv: 0x0b
recv: 0x00
recv: 0x01
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 1 bytes
read:  80
recv: 0x1e
recv: 0xa5
CRC OK
Got message seqno 11 (command_sequence == 11)
response: 80

command[0x0b, 1]: 0B 01
recv: 0x1b
recv: 0x0c
recv: 0x00
recv: 0x01
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 1 bytes
read:  80
recv: 0x10
recv: 0x39
CRC OK
Got message seqno 12 (command_sequence == 12)
response: 80
Waiting for input.
recv: 0x1b
recv: 0xff
recv: 0xff
recv: 0x06
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 6 bytes
read:  e0 00 00 00 00 00
recv: 0x4e
recv: 0x2d
CRC OKWaiting for connection on port 4242.
Connection opened by host 127.0.0.1, port 1105.
GDB: <qSupported>
->GDB:
GDB: <?>
->GDB: S05
GDB: <Hc-1>
->GDB:
GDB: <qC>
->GDB:
GDB: <qOffsets>
->GDB:
GDB: <Hg0>
->GDB:
GDB: <g>

GDB: (Registers)Read 32 bytes from 0x800000
jtagRead
command[0x05, 1]: 05 20 20 00 00 00 00 00 00 00
recv: timeout

command[0x05, 2]: 05 20 20 00 00 00 00 00 00 00
recv: timeout

command[0x05, 3]: 05 20 20 00 00 00 00 00 00 00
recv: timeout

command[0x05, 4]: 05 20 20 00 00 00 00 00 00 00
recv: 0x1b
recv: 0x0d
recv: 0x00
recv: 0x21
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 33 bytes
read:  82 95 00 90 00 00 21 dd 04 c0 a8 73 01 c0 a8 73 48 00 03 ab 0d 27 
01 2c 0
0 ab 03 00 00 e5 10 95 03
recv: 0x2b
recv: 0xdf
CRC OK
Got message seqno 13 (command_sequence == 13)
response: 82 95 00 90 00 00 21 DD 04 C0 A8 73 01 C0 A8 73 48 00 03 AB 0D 
27 01 2
C 00 AB 03 00 00 E5 10 95 03
jtagRead
command[0x05, 1]: 05 20 03 00 00 00 5D 00 00 00
recv: 0x1b
recv: 0x0d
recv: 0x00
recv: 0x21
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 33 bytes
read:  82 95 00 90 00 00 21 dd 04 c0 a8 73 01 c0 a8 73 48 00 03 ab 0d 27 
01 2c 0
0 ab 03 00 00 e5 10 95 03
recv: 0x2b
recv: 0xdf
CRC OK
Got message seqno 13 (command_sequence == 14)

got wrong sequence number, 13 != 14
recv: 0x1b
recv: 0x0e
recv: 0x00
recv: 0x04
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 4 bytes
read:  82 00 00 00
recv: 0x63
recv: 0x04
CRC OK
Got message seqno 14 (command_sequence == 14)
response: 82 00 00 00

command[0x07, 1]: 07
recv: 0x1b
recv: 0x0f
recv: 0x00
recv: 0x05
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 5 bytes
read:  84 00 00 00 00
recv: 0x73
recv: 0xc3
CRC OK
Got message seqno 15 (command_sequence == 15)
response: 84 00 00 00 00
PC = 0
->GDB: 
950090000021dd04c0a87301c0a873480003ab0d27012c00ab030000e510950300000000 
0
00000
GDB: <X0,0:>
->GDB:
GDB: 
<M0,20:0c94c6000c94080c0c94cb0b0c94e5000c94e5000c94e5000c94e5000c94e500>

GDB: Write 32 bytes to 0x0
jtagWrite Detected GDB "load" command, erasing flash.

command[0x13, 1]: 13
recv: 0x1b
recv: 0x10
recv: 0x00
recv: 0x01
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 1 bytes
read:  80
recv: 0x0a
recv: 0x59
CRC OK
Got message seqno 16 (command_sequence == 16)
response: 80

command[0x04, 1]: 04 A0 20 00 00 00 00 00 00 00 0C 94 C6 00 0C 94 08 0C 
0C 94 CB
 0B 0C 94 E5 00 0C 94 E5 00 0C 94 E5 00 0C 94 E5 00 0C 94 E5 00
recv: timeout

command[0x04, 2]: 04 A0 20 00 00 00 00 00 00 00 0C 94 C6 00 0C 94 08 0C 
0C 94 CB
 0B 0C 94 E5 00 0C 94 E5 00 0C 94 E5 00 0C 94 E5 00 0C 94 E5 00
recv: timeout

command[0x04, 3]: 04 A0 20 00 00 00 00 00 00 00 0C 94 C6 00 0C 94 08 0C 
0C 94 CB
 0B 0C 94 E5 00 0C 94 E5 00 0C 94 E5 00 0C 94 E5 00 0C 94 E5 00
recv: timeout

command[0x04, 4]: 04 A0 20 00 00 00 00 00 00 00 0C 94 C6 00 0C 94 08 0C 
0C 94 CB
 0B 0C 94 E5 00 0C 94 E5 00 0C 94 E5 00 0C 94 E5 00 0C 94 E5 00
recv: timeout
Resetting EPs...

command[0x04, 5]: 04 A0 20 00 00 00 00 00 00 00 0C 94 C6 00 0C 94 08 0C 
0C 94 CB
 0B 0C 94 E5 00 0C 94 E5 00 0C 94 E5 00 0C 94 E5 00 0C 94 E5 00
recv: timeout
Resetting EPs...

command[0x04, 6]: 04 A0 20 00 00 00 00 00 00 00 0C 94 C6 00 0C 94 08 0C 
0C 94 CB
 0B 0C 94 E5 00 0C 94 E5 00 0C 94 E5 00 0C 94 E5 00 0C 94 E5 00
recv: timeout
Resetting EPs...

command[0x04, 7]: 04 A0 20 00 00 00 00 00 00 00 0C 94 C6 00 0C 94 08 0C 
0C 94 CB
 0B 0C 94 E5 00 0C 94 E5 00 0C 94 E5 00 0C 94 E5 00 0C 94 E5 00
recv: timeout
Resetting EPs...

command[0x04, 8]: 04 A0 20 00 00 00 00 00 00 00 0C 94 C6 00 0C 94 08 0C 
0C 94 CB
 0B 0C 94 E5 00 0C 94 E5 00 0C 94 E5 00 0C 94 E5 00 0C 94 E5 00
recv: timeout
Resetting EPs...

command[0x04, 9]: 04 A0 20 00 00 00 00 00 00 00 0C 94 C6 00 0C 94 08 0C 
0C 94 CB
 0B 0C 94 E5 00 0C 94 E5 00 0C 94 E5 00 0C 94 E5 00 0C 94 E5 00
recv: timeout
Resetting EPs...

command[0x04, 10]: 04 A0 20 00 00 00 00 00 00 00 0C 94 C6 00 0C 94 08 0C 
0C 94 C
B 0B 0C 94 E5 00 0C 94 E5 00 0C 94 E5 00 0C 94 E5 00 0C 94 E5 00
recv: timeout
Resetting EPs...
JTAG ICE: Cannot synchronise

Übrigens habe ich auch verschiedene Bitraten etc. benutzt, hat aber 
leider alles keinen Erfolg gebracht.

Ich wollte es auch noch mit avarice 2.12 probieren, leider hat dieses 
aber leider ein Problem mit CygWin 1.7.9-1. Ein weiteres Problem.

Hat jemand ähnliche Probleme oder noch besser eine Lösung oder zumindest 
Vorschläge?

Danke und VG
Harry

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.