Menu

#16 Avarice dies with timeout upon memory read

open
nobody
None
5
2012-12-13
2012-11-16
svenq
No

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

Discussion

  • svenq

    svenq - 2012-11-16

    debug Output of GDB and avarice

     
  • svenq

    svenq - 2012-11-16

    USB traffic sniff of Atmel Studio 6 debug session

     
  • Joerg Wunsch

    Joerg Wunsch - 2012-11-16

    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).

     
  • svenq

    svenq - 2012-11-19

    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:
    - connect to target. This takes approx 5 seconds.
    - set Breakpoint at main
    - continue. Execution will be halted at the breakpoint. (another 5 seconds)
    - Reading registers and Memory works (no delay)
    - single step (takes up to one minute)
    - set breakpoint in main loop and continue
    - Breakpoint in main loop gets hit only once.
    - interrupting the program (ctrl-c) takes long (up to one minute) - alternatively avarice quits with a timeout.

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

     
  • svenq

    svenq - 2012-11-19

    Debug output of avarice with JTAG_RESPONSE_TIMOUT=5 seconds

     

Log in to post a comment.