Electronic – Is a JTAG programmer capable of any microcontroller which supports JTAG

armjtagmicrocontrollerprogrammerprogramming

Sorry if my question is very basic, but I couldn't find the answer by searching the internet.

I want to buy a JTAG programmer, but in the datasheet of this programmer there is a list of "supported MCUs". Does this mean that this programmer cannot program other MCUs which support JTAG?

As an example, ST Link V2 says that it is for STM8 and STM32 MCUs. Does this mean it cannot be used to program other MCUs?

What about JTAG programmers which are for ARM MCUs? Does this mean they cannot be used for non-ARM MCUs (even thought they support JTAG)?

If a JTAG programmer could be used to program any MCU which supports JTAG, then what is the difference between these programmers that makes them specific to a specific microcontroller?

I am mainly concerned with programming the MCU, although having debugging capability would be a nice addition.

Any help would be welcome.
Thank you in advance.

Best Answer

JTAG is the interface, the voltages, the max clock speeds, that make up the physical connection.

To interface to a particular device, the programmer needs to know its specific commands, its registers, that is the device API (Application Programmer Interface).

A JTAG was originally designed as a test standard, it only supports a small set of test-related functions as standard, for instance boundary scan. However, the general idea of connecting a PC and a target system together with a simple interface is so appealing, that many vendors have added their own extensions, for programming, breakpoints, and all sorts of other useful things. These extensions are not standardised.

While JTAG can be 'bit-banged' from a PC, this is very slow, and most 'JTAG Programmers' incorporate a local MCU which speeds up the process, connectced to the target by a short JTAG lead, and commonly to the PC by USB or ethernet. The PC to programmer communications are often proprietary, and unlikely to be available to amateurs. The programmer will have embedded firmware to control the target's JTAG extension protocols, you may have more luck finding these available publicly from the likes of ARM etc.

This means if you want to go outside the published 'this programmer works with this MCU', you're more likely to be able to hack the target's JTAG directly from a PC, than to hack a commercial programmer to work with a target not claimed to work with it. Get the API from the target MCU manufacturer, use an Arduino as the physical JTAG interface, and write C or python or something to control the Arduino over its USB interface, putting the low level tasks on the Arduino and the high level control on the PC as required.