avrdudes / avarice

AVaRICE is a program for interfacing the Atmel JTAG ICE to GDB to allow users to debug their embedded AVR target.
GNU General Public License v2.0
35 stars 11 forks source link

[bug #16] Avarice dies with timeout upon memory read #16

Open avrs-admin opened 2 years ago

avrs-admin commented 2 years ago

svenq 2012-11-16 09:57:50

Avarice dies with a receive timeout when reading memory from an ATMega32u4 via JTAG, after apparently correct initialization.

MCU: ATMEGA32U4 Tools: AVR JTAG ICE mkII, FW 7.28 or FW 6.x Avarice 2.10, 2.12 or 2.13 on Gentoo Linux or Debian Linux avr-gdb 7.2 or 7.6

Same setup works with AVR Studio 6

avarice-debugging.txt atmelstudio6-debug-dump.pcapng.gz avarice-debugging-02.txt

This issue was migrated from https://sourceforge.net/p/avarice/bugs/16/

avrs-admin commented 2 years ago

svenq 2012-11-16 09:57:50

debug Output of GDB and avarice

avrs-admin commented 2 years ago

svenq 2012-11-16 10:35:35

USB traffic sniff of Atmel Studio 6 debug session

avrs-admin commented 2 years ago

joerg_wunsch 2012-11-16 17:18:14

The main difference between both appears to be the use of the undocumented command 0x36, rather than the old CMND_SET_DEVICE_DESCRIPTOR. So far, I assumed command 0x36 is only used for Xmega device, but perhaps it is to be used in general now.

In addition to the already known usage (with a 0x0002 as the initial value of the configuration record), it seems the IO register bitmaps are also configured through command 0x36, but with initial values 0x0080, 0x0081, 0x0088, 0x0089.

This configuration method looks very similar to what the JTAGICE3 uses (see the respective feature request and attached USB trace).

avrs-admin commented 2 years ago

svenq 2012-11-19 20:12:34

When starting debugging with Atmel Studio, i noticed a quite long delay. Thus i tried to increase the JTAG_RESPONSE_TIMEOUT in jtag.h to 5 seconds. This makes some basic things possible. The following steps have been done in GDB. The corresponding avarice log is attached as "avarice-debugging-02.txt".

in GDB:

I'm not sure if this information is useful, it's just for completenes.

avrs-admin commented 2 years ago

svenq 2012-11-19 20:13:39

Debug output of avarice with JTAG_RESPONSE_TIMOUT=5 seconds