ATmega32U4 JTAG debug?

Go To Last Post
10 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello :-)

I am used to ARM7 and ARM9 JTAG debugging using cheap and Open JTAG dongles. I do debug on GNU/Linux using OpenOCD and Eclipse.

Does anyone knows if I can do JTAG debug using the same tools on GNU/Linux, for the ATmega32U4?

I am looking for using this dev. board:

http://code.google.com/p/avropen...

Thank you.

JPCasainho,
www.Casainho.net
.Portugal

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Does anyone knows if I can do JTAG debug using the same tools on GNU/Linux, for the ATmega32U4?

No you cannot. At a minimum you need a $50 AVR Dragon. You then use 'avarice' as the interface between gdb and the Dragon (it's like openOCD for AVR)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
Quote:

Does anyone knows if I can do JTAG debug using the same tools on GNU/Linux, for the ATmega32U4?

No you cannot. At a minimum you need a $50 AVR Dragon. You then use 'avarice' as the interface between gdb and the Dragon (it's like openOCD for AVR)

Thank you :-)

So, the problem is just the hardware JTAG dongle?

What is the big difference on JTAG hardware and AVR Dragon so we can't use the many Open Hardware JTAG dongles?

(I hate closed hardware as that AVR Dragon).

JPCasainho,
www.Casainho.net
.Portugal

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

(I hate closed hardware as that AVR Dragon).

Then take it up with Atmel.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
Quote:

(I hate closed hardware as that AVR Dragon).

Then take it up with Atmel.

Sorry.

I would like to know why usual JTAG dongle can not be used... is because of Avarice don't know how to talk to it or is hardware limitations?

JPCasainho,
www.Casainho.net
.Portugal

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
What is the big difference on JTAG hardware and AVR Dragon so we can't use the many Open Hardware JTAG dongles?

The big difference is that Atmel has not publicly documented their debugging extensions to the JTAG interface. The mandatory boundary scan portion of their JTAG interface works as defined in IEEE 1149.1. As well, Atmel's custom Flash programming JTAG commands are fully documented. But their custom JTAG commands for debugging the software running in CPU itself are considered a trade secret.

Instead, Atmel uses a proprietary device such as a JTAGICE mkII or AVR Dragon as a layer of abstraction between the PC and the actual JTAG communication link.

The PC <-> JTAGICEmkII/Dragon communication layer is fully documented, so it is possible to write your own software on the PC, such as avarice, that uses the documented protocol to communicate with the JTAGICEmkII/Dragon. Then the JATGICEmkII/Dragon translates that protocol into JTAG commands on the fly. But the PC software doesn't know anything at all about the actual JTAG commands themselves. Atmel has designed this system in an attempt to force you to use Atmel-manufactured debugging hardware.

IF you could reverse engineer the proprietary debugging JTAG commands, then in theory it would be possible to extend avarice (or maybe OpenOCD) to work with AVRs using any generic JTAG adaptor.

Last Edited: Thu. May 28, 2009 - 11:33 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

mistake message - to delete.

JPCasainho,
www.Casainho.net
.Portugal

Last Edited: Thu. May 28, 2009 - 12:15 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

lfmorrison wrote:
Quote:
What is the big difference on JTAG hardware and AVR Dragon so we can't use the many Open Hardware JTAG dongles?

The big difference is that Atmel has not publicly documented their debugging extensions to the JTAG interface. The mandatory boundary scan portion of their JTAG interface works as defined in IEEE 1149.1. As well, Atmel's custom Flash programming JTAG commands are fully documented. But their custom JTAG commands for debugging the software running in CPU itself are considered a trade secret.

Instead, Atmel uses a proprietary device such as a JTAGICE mkII or AVR Dragon as a layer of abstraction between the PC and the actual JTAG communication link. The PC <-> JTAGICEmkII/Dragon communication layer, unlike the JTAG commands it abstracts, is fully documented.

IF you could reverse engineer the proprietary debugging JTAG commands, then in theory it would be possible to extend avarice (or maybe OpenOCD) to work with AVRs using any generic JTAG adaptor.


Many thanks for the clear explanations :-)

Before I were looking on the AT90USBxxx devices but but debug is only possible with the proprietary DebugWire from Atmel :-( -- I was hopping that this ATmega USB devices uses JTAG and they could be open for debug.

Ok, then I will not use this AVR USB. I will continue to use ARM USB for my Open Source projects. (Open Source really make my life easy).

JPCasainho,
www.Casainho.net
.Portugal

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Suit yourself. I personally haven't used any form of JTAG debugging at all for the most recent 3 or 4 AVR projects I've brought from the ground up, so the presence of JTAG dongles (regardless of whether or not it's open-hardware) hasn't even entered into the equation for me recently.

In situations where I have needed to do JTAG debugging, I found the AVR Dragon was adequately inexpensive. (I suspect if you built one for yourself, you could barely cover the cost of the hardware alone for $50 at which Atmel sells the fully assembled kit.) And I have the option of using open source solutions for all the software I actually run on my PC while performing the debugging, so I don't feel philosophically challenged.

But like I said, suit yourself.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

lfmorrison wrote:
(I suspect if you built one for yourself, you could barely cover the cost of the hardware alone for $50 at which Atmel sells the fully assembled kit.)

I am sure we can DIY one JTAG cable for less than $5. See here.

Even there is ARM7 USB boards already assembled for $25 that could be used for this device.

Another problem is that I can't reuse the same hardware, that could do debug, work also as USB<->RS232, USB<->SPI, USB<->I2S, etc, and I could repair for myself.

JPCasainho,
www.Casainho.net
.Portugal