Author Topic: Which JTAG inteface? (JLINK EDU, ARM-USB-OCD-H, other?)  (Read 11716 times)

0 Members and 1 Guest are viewing this topic.

Offline hansanTopic starter

  • Newbie
  • Posts: 9
  • Country: de
Which JTAG inteface? (JLINK EDU, ARM-USB-OCD-H, other?)
« on: August 28, 2014, 08:40:25 pm »
Dear all,

I am looking for an cost effective and reasonable quality JTAG inteface for a debug project. I would like to debug a i.MX6 ARM Cortex-A9 (wandboard to be specific) with means of JTAG. My main operating system is linux, but that would be with OpenOCD and GDB not be a limitation for my purpose. Fancy windows software (IDE) are not needed / I can probably not use.

But which Jtag hardware is recommendable for hobby work on a linux platform?
I am mainly targeting ARM but other architectures should be nice to have as well. Voltage rage of the cores are 1.8V -- 5V. Price range <100 Euro.

I am looking into the Segger J-Link EDU or the Olimex ARM-USB-OCD-H. Both are supposed to be well supported by openOCD. The non-commercial usages of the Segger is for now not a problem.  I see on EBAY also a lot of U-link 2, which is as far as I know not so well supported by OpenOCD.
My feeling/impression is that the Segger one is the better one because to the internal processor / hardware jtag support compared with the Olimex FT2232H based one.  I am only afraid that this hardware jtag is not working with other architectures than with ARM. (with MIPS for instance) But I hope someone can comment on that.

Has someone a recommendation for a JTAG specific hardware interface that is fairly good supported under Linux and works well?

Greetings.   
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26906
  • Country: nl
    • NCT Developments
Re: Which JTAG inteface? (JLINK EDU, ARM-USB-OCD-H, other?)
« Reply #1 on: August 28, 2014, 10:53:21 pm »
An LPT port based JTAG interface?
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline legacy

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: Which JTAG inteface? (JLINK EDU, ARM-USB-OCD-H, other?)
« Reply #2 on: August 28, 2014, 11:39:42 pm »
I am only afraid that this hardware jtag is not working with other architectures than with ARM. (with MIPS for instance)

why ?
 

Offline tiltit

  • Regular Contributor
  • *
  • Posts: 56
  • Country: 00
Re: Which JTAG inteface? (JLINK EDU, ARM-USB-OCD-H, other?)
« Reply #3 on: August 29, 2014, 11:39:05 am »
I'm not sure if this helps but here is a picture from the guts of the Olimex ARM-USB-OCD-H.
You may also want to consider the Bus Blaster from Dangerous prototypes.
« Last Edit: August 29, 2014, 11:45:46 am by tiltit »
 

Offline legacy

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: Which JTAG inteface? (JLINK EDU, ARM-USB-OCD-H, other?)
« Reply #4 on: August 29, 2014, 03:07:36 pm »
Bus Blaster from Dangerous prototypes.

does anyone used this jtag ? it's in my wish list but i have no feedbacks about it
 

Offline hansanTopic starter

  • Newbie
  • Posts: 9
  • Country: de
Re: Which JTAG inteface? (JLINK EDU, ARM-USB-OCD-H, other?)
« Reply #5 on: August 31, 2014, 08:02:30 pm »
I am only afraid that this hardware jtag is not working with other architectures than with ARM. (with MIPS for instance)

why ?

As far as I understand is basic JTAG (the standard) is just a bunch of shift registers and a state machine. However the usage of JTAG to do something with a processor is not that well standardized; I am afraid that a solution that works very well on one platform (ARM in this case) is not working that well on a different platform (MIPS) due to the additional logic in the JTAG interface probe.  A parallel port interface or something based on a FTDI 2232 chip is more basic/low level, the higher level functionality (like setting breakpoints) is all done by the software on the host; which can work for any device.

But maybe is my concern wrong. It would be nice to hear of someone that has experience with a Segger J-link on a not ARM platform. Is there someone?

 
 

Offline hansanTopic starter

  • Newbie
  • Posts: 9
  • Country: de
Re: Which JTAG inteface? (JLINK EDU, ARM-USB-OCD-H, other?)
« Reply #6 on: August 31, 2014, 08:06:19 pm »
An LPT port based JTAG interface?

I use the LPT port already for other interfaces. And I have read that the bit-banging on the LPT port is rather slow; good enough the flash firmware to save a bricked router, but not nice as debug tool. That is why I am primary looking for USB based solutions.  However if you know or have good experience with a different tool then I am very much interested!
 

Offline hansanTopic starter

  • Newbie
  • Posts: 9
  • Country: de
Re: Which JTAG inteface? (JLINK EDU, ARM-USB-OCD-H, other?)
« Reply #7 on: August 31, 2014, 08:17:49 pm »
I'm not sure if this helps but here is a picture from the guts of the Olimex ARM-USB-OCD-H.
You may also want to consider the Bus Blaster from Dangerous prototypes.
The inside of the ARM-USB-OCD-H looks rather good. :-+
The bus blaster is indeed a good suggestion; nice hardware concept, only a bit basic so without housing.  I only have to look for a shop here in Europe.

 

Offline legacy

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: Which JTAG inteface? (JLINK EDU, ARM-USB-OCD-H, other?)
« Reply #8 on: August 31, 2014, 08:27:42 pm »
As far as I understand is basic JTAG (the standard) is just a bunch of shift registers and a state machine. However the usage of JTAG to do something with a processor is not that well standardized;

What you can do is specified with the BSDL file, i mean which registers and resources you can access inside the CPU

I am afraid that a solution that works very well on one platform (ARM in this case) is not working that well on a different platform (MIPS) due to the additional logic in the JTAG interface probe

While most of modern SOCs support JTAG (IEEE 1149.1), MIPS goes for "ejtag" which is a proprietary extension which utilizes widely used IEEE JTAG pins for debug functions in order to provide a standard debug I/O interface, enabling the use of traditional MIPS debug facilities on system-on-a-chip components with new capabilities for software and system debug.


EJTAG provides:
- run control
- single-step execution
- breakpoints on both data and instructions
- real-time trace (optional)
- direct memory access
- Debug Exception & Debug Mode (EJTAG-SPC-03-10)
- Memory-Mapped EJTAG Registers (EJTAG-SPC-03-10)
- Off-board EJTAG Memory (EJTAG-SPC-03-10)
- Debug Breakpoint Instruction (EJTAG-SPC-03-10/SDBBP)
- EJTAG Processor Core Extensions (EJTAG-SPC-03-10)
- Hardware Breakpoint Unit (EJTAG-SPC-03-10)

EJTAG utilizes a 5-pin interface defined in IEEE 1149.1. The basic Test Access Port (TAP) is composed by  {TDI, TDO, TMS, TCK, nTRST}

This is the common EJTAG pinout

Code: [Select]
nTRST  1  2 GND
TDI    3  4 GND
TDO    5  6 GND
TMS    7  8 GND
TCK    9 10 GND
nSRST 11 12 -key
DINT  13 14 VCC


You can see additional pins:
* DINT pin is used to raise Debug Interrupt. Many chips has no this pin.
* nSRST pin is a "system reset" signal and acts like conventional "Reset' button (1)



(1) While nTRST is the "TAP Reset" signal, the nSRST signal does not reset TAP controller, often it resets the SoC peripherals


Debug Exception and Debug Mode

To allow inspection of the CPU state at any time in the execution flow, a debug exception with priority over all other exceptions is introduced. When a debug exception occurs, the CPU goes into Debug Mode, a special mode with no restrictions on access to coprocessors, memory areas, etc., and where usual exceptions like address error and interrupt are masked. The debug exception handler is executed in Debug Mode and provided by the debug system. It can be executed from the probe through a processor access, or may also reside in the application code if the developer chooses to use a debug task in the application. An overall requirement is that debugging be non-intrusive to the application so execution of the application can be continued after the needed debug operations. However, loss of real-time operation is inevitable when the debug exception handler is executed. The system designer may chose to indicate debug mode by a signal to certain hardware modules to freeze them when executing the debug exception handler.

Memory-Mapped EJTAG Registers

EJTAG provide memory-mapped registers, located in the debug register segment (drseg), which is a sub-segment of the debug segment (dseg). They are accessible by the debug software when the processor is executing in Debug Mode. These registers provide both miscellaneous debug control and control of hardware breakpoints

Off-board EJTAG Memory

EJTAG allows a MIPS processor in Debug Mode to reference instructions or data that are not resident on the system under test. This EJTAG memory is mapped to the processor as if it were virtual memory in the kseg3 segment, and references to it are converted into transactions on the TAP interface. Both instructions and data can be accessed in EJTAG memory, which allows debugging of systems without requiring the presence of a ROM monitor or debugger scratchpad RAM. It also provides a communications channel between debug software executing on the processor and an external debugging agent.

HW specific: the EJTAG probe polls the EJTAG Control Register through the TAP, and a bit in this register indicates when a processor access is pending. The physical address of the transaction is then available in the EJTAG Address Register, and the transaction size and read/write indication are available in the EJTAG Control Register. The EJTAG Data Register is then accessed either to get data from a write or to provide data for a read. Finally the EJTAG Control Register is updated to indicate that the processor access is done.

Debug Breakpoint Instruction

CPU-Specific: EJTAG introduces a new breakpoint instruction, SDBBP, which differs from the MIPS32 and MIPS64 BREAK

Hardware Breakpoints

EJTAG defines various types of hardware breakpoints for interrupting the CPU at certain transactions on the CPU buses. The debug exception happens before the bus transaction causing the exception alters any memory or CPU state. Hardware breaks on instructions have the advantage over software debug breaks in that it is possible to set them in any address area. Furthermore, if memory cannot be altered by inserting SDBBP codes, the hardware breaks can still be used. Hardware data breakpoints allow breaks on load/store operations.
EJTAG implements two kinds of breaks:
- Instruction breaks, in which a break may be set on an instruction fetch from a specific virtual address
- Data breaks, inwhichabreakmaybesetonaload/storereferencefromaspecificvirtualaddress,whichadditionally can be qualified by a data value.
There may be up to 15 break channels of each type implemented, and each break channel may be programmed with address, address mask, ASID, and reference type.

EJTAG Processor Core Extensions

A MIPS processor or core supporting EJTAG must support EJTAG-specific instructions, additional system coprocessor (CP0) registers and vectoring to Debug Exceptions, which puts the processor in a special Debug Mode of execution.
« Last Edit: August 31, 2014, 08:54:43 pm by legacy »
 

Offline legacy

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: Which JTAG inteface? (JLINK EDU, ARM-USB-OCD-H, other?)
« Reply #9 on: August 31, 2014, 08:38:17 pm »
In short, you could use a wiggle clone (parallel port jtag cable) for MIPS, too!
You have to use a software which is aligned with the EJTAG capabilities, more specifically you need
- the correct BSDL file
- Debug Exception & Debug Mode support
 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3785
  • Country: de
Re: Which JTAG inteface? (JLINK EDU, ARM-USB-OCD-H, other?)
« Reply #10 on: August 31, 2014, 09:08:20 pm »
Please, guys, everyone suggesting parallel port interfaces, let them die in peace! Those things are simple and cheap, but a royal PITA to use, especially in Windows, not to mention the chances of frying your motherboard should something go haywire. Moreover, dongles that bitbang JTAG are extremely slow for debugging (be it USB or parallel port based). You really really want something that has the JTAG implemented either in a microcontroller or at least a FT2232H.

There are plenty of good USB JTAG dongles - I have the Chinese OpenJTAG and the Dangerous Prototypes BusBlaster, the latter can be even re-programmed to emulate various other dongles (uses CPLD for the frontend). Both work fine.
 

Offline legacy

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: Which JTAG inteface? (JLINK EDU, ARM-USB-OCD-H, other?)
« Reply #11 on: August 31, 2014, 09:23:03 pm »
Please, guys, everyone suggesting parallel port interfaces, let them die in peace!

The problem with MIPS is related to the software side, i mean commercial debuggers are targeting for expensive EJTAG unit, for example the cheapest cable supported by OCD is the wiggle, which is parallel port.

We can go for OpenOCD but i do not know how good is the support for EJTAG: never tried.

Dangerous Prototypes BusBlaster

Dangerous Prototypes also sells FT2232H-breakout, BusBlaster adds a little CPLD, the breakout is missing. I have used their FT2232H-breakout in order to interface my blackfin BF537-stamp board with open sources tools (openOCD and gdb), unfortunately AnalogDevices VisualDSP++ is not supporting  FT2232H, so to use such a software i have bought a dedicated (and expensive, $200) usb-cable (called "adzs-ice-100b") targeted for blackfin BF5xx.

An example that can clarify the "software traps" is this:

AnalogDevices is also not supporting gnICE by their VisualDSP++. gnICE is a low cost usb-jtag cable with low performance ADI compatible designed according to Analog Devices' application note EE-68; i have written here something about it, and may be interesting to know that it is based on FT2232 so you can save you money (gnICE is sold at 150USD or more) building it by yourself with a FT2232 breakout.
« Last Edit: August 31, 2014, 09:46:28 pm by legacy »
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26906
  • Country: nl
    • NCT Developments
Re: Which JTAG inteface? (JLINK EDU, ARM-USB-OCD-H, other?)
« Reply #12 on: September 01, 2014, 10:59:35 am »
Please, guys, everyone suggesting parallel port interfaces, let them die in peace!

The problem with MIPS is related to the software side, i mean commercial debuggers are targeting for expensive EJTAG unit, for example the cheapest cable supported by OCD is the wiggle, which is parallel port.

We can go for OpenOCD but i do not know how good is the support for EJTAG: never tried.
OpenOCD works well with EJTAG. I revised most parts of it years ago.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline andersm

  • Super Contributor
  • ***
  • Posts: 1198
  • Country: fi
Re: Which JTAG inteface? (JLINK EDU, ARM-USB-OCD-H, other?)
« Reply #13 on: September 01, 2014, 11:44:32 am »
I am looking into the Segger J-Link EDU or the Olimex ARM-USB-OCD-H. Both are supposed to be well supported by openOCD. The non-commercial usages of the Segger is for now not a problem.
One thing to keep  in mind is that AFAIK the J-Link EDU is still on hardware revision 8, which will limit its lifespan if you want to use Segger's tools. PIC32 support for instance is only available on r9 and newer hardware.

Quote
I see on EBAY also a lot of U-link 2, which is as far as I know not so well supported by OpenOCD.
Those are almost all clones, which means they'll have compatibility problems with Keil's tools.

Offline ElektroQuark

  • Supporter
  • ****
  • Posts: 1244
  • Country: es
    • ElektroQuark
Re: Which JTAG inteface? (JLINK EDU, ARM-USB-OCD-H, other?)
« Reply #14 on: September 01, 2014, 12:43:51 pm »
Quote from: andersm on Today at 10:44:32 PM
One thing to keep  in mind is that AFAIK the J-Link EDU is still on hardware revision 8, which will limit its lifespan if you want to use Segger's tools. PIC32 support for instance is only available on r9 and newer hardware.
Quote




A couple month ago Mouser shipped to me a R9 J-Link EDU.

Offline JDubU

  • Frequent Contributor
  • **
  • Posts: 441
  • Country: us
Re: Which JTAG inteface? (JLINK EDU, ARM-USB-OCD-H, other?)
« Reply #15 on: September 01, 2014, 05:57:15 pm »
One thing to keep  in mind is that AFAIK the J-Link EDU is still on hardware revision 8, which will limit its lifespan if you want to use Segger's tools. PIC32 support for instance is only available on r9 and newer hardware.

Where did you see that limitation?
From what I can see from the Segger web site, J-Link EDU version 8 hardware should work with the latest firmware update.
 

Offline andersm

  • Super Contributor
  • ***
  • Posts: 1198
  • Country: fi
Re: Which JTAG inteface? (JLINK EDU, ARM-USB-OCD-H, other?)
« Reply #16 on: September 01, 2014, 06:02:10 pm »

Offline JDubU

  • Frequent Contributor
  • **
  • Posts: 441
  • Country: us
 

Offline andersm

  • Super Contributor
  • ***
  • Posts: 1198
  • Country: fi
Re: Which JTAG inteface? (JLINK EDU, ARM-USB-OCD-H, other?)
« Reply #18 on: September 01, 2014, 06:39:08 pm »
Speaking of Microchip and J-Link, they're currently having a $75 off sale. You can also save $100 on a RealICE.

Offline abyrvalg

  • Frequent Contributor
  • **
  • Posts: 824
  • Country: es
Re: Which JTAG inteface? (JLINK EDU, ARM-USB-OCD-H, other?)
« Reply #19 on: September 02, 2014, 08:22:02 pm »
AFAIK OpenOCD doesn't use J-Link's builtin high level functionality like "set breakpoint" etc, it uses lower level scan chain access APIs, so there will be no advantage over FT2232H-based interfaces in this mode, no reason to pay more.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf