JTAG Debugging

I am very excited to finally see the Due in the wild. I am eagerly looking for its soulmate, the JTAG debugger. What are our options for debugging 96kb of code? Can we use low-cost debuggers like the LPC-LINKs or are Atmel's programmers like the JTAGICE II our only choice?

The LPC-LINK is great, the 10-pin header on the Due looks like it has the same pinout, I doubt the LPC debugger would work but something similar would be nice.

Arduino really has to enter the world of real debuggers now, Serial.print()ing is for the birds.


Rob

Arduino really has to enter the world of real debuggers now, Serial.print()ing is for the birds.

Well stood me in good stead for over 40 years, but then if you don't understand what you are doing then JTAG might be the answer. :slight_smile:

Well stood me in good stead for over 40 years,

Likewise (well more like 30 years), but lately I've been using the LPC Xpressos and having a real debugger has been fantastic. I still use their equivalent of Serial.print() but being able to stop and view array contents, control registers etc is great.


Rob

there is a JTAG connector (unpopulated) and an SWD connector.

Anything that does SWD and supports the SAM3X will work.
I tested (albeit not fully) the http://www.blacksphere.co.nz/main/blackmagic the author added support for the SAM3X
as soon as we have finished testing we'll report back.

or you can solder a JTAG connector on the PCB and use the atmel dongle

m

Thanks Massimo, sounds good.


Rob

If I understand correctly, to use the JTAGICE II or up, you have to use it through Atmel Studio and there are no cheap clones available. What application would we use with our own JTAG debugger to debug with the Arduino IDE? And you need all source code in order to debug, correct?

For other ARM devices there is the possibility to use a OpenOCD compatible jtag adapter, and then use a gdb client to step the code.
I'm not sure what jtag device would work on this Atmel device thou.

I am interested in an ftdi ft2232H based dongle using openocd. These ftdi chips have an hw usb to jtag/swd converter, I expect this approach to be very simple and robust.

It is however not clear to me how stable openocd's swd support is. But there is always the alternative of using the due's full jtag connector.

I consider this one Bus Blaster - DP. If someone has experience with this dongle or succeeds to use it (or another ftdi based dongle) with the due I'd be happy to know about it.

Did someone tested this one?

Hi Massimo,
Have you had a chance to get the BMPM working with the Due yet?

Thanks,
Greg

I have a question for Massimo (or anyone who knows the answer I guess)
-just got my Arduino Due today, and I'm wondering if anyone can suggest some good HW and SW that will allow me to debug with JTAG?
for example, would the Black Magic probe and OpenOCD work with the Due?

Hello eriknyquist,

I got one SAM-ICE JTAG directly from Atmel for debugging Due (after Atmel tech. support recommendation).

http://store.atmel.com/PartDetail.aspx?q=p:10500253#tc:description

I haven't used recently but I debugged a couple of sample projects in my Due with Atmel Studio 6 IDE, and it worked OK. I also ran the diagnostics tools J-Flash ARM v4.56d and J-Link ARM v4.56, and also ran OK. I even made debugging tests on my SAM3X-EK and no problem. The only problem is that SAMICE is very expensive (~$100) and you will need the cable ARM-JTAG-20-10 (~$7) for the 0.05" connector.

If you are lucky, you can buy one cheaper on Ebay. If you are a developer, it worth the price.

I think is good for you to know that SAM3X8E (Due) doesn't have instruction trace capability (I mean, it doesn't handle the debugging instruction trace module: Embedded Trace Macrocell (ETM) available in its Cortex-M3 core, but it does fully support all other ARM CoreSight features through Serial Wire Viewer.

There is a second option: J-Link by Segger. It costs a bit less (~$63).

Regarding Massimo's solution, I don't know but it seems to be less expensive. Good luck!

So? Have you finished testing?
Can you please post results?

Does this black magic probe works with atmel studio or with eclipse based ocd?