1
\$\begingroup\$

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.

\$\endgroup\$
  • \$\begingroup\$ The hardware should be compatible. But if your device isn't on the programmer's list of supported device IDs you may have a software problem. I'd be (pleasantly) surprised if you can use ST-Link with TI or NXP's ARM processors, let alone non-ARM devices. \$\endgroup\$ – Brian Drummond Nov 21 at 17:44
1
\$\begingroup\$

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.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ So I cannot even use it to program the MCU? If no, is it possible to write the required program myself, if I am not an expert in the subject? Thanks. \$\endgroup\$ – Alithewise Nov 22 at 5:54
  • \$\begingroup\$ @Alithewise see my updated answer \$\endgroup\$ – Neil_UK Nov 22 at 9:38
0
\$\begingroup\$

In theory, yes. In practice, the JTAG extensions to support debugging are device-specific, and even in some cases need local hardware acceleration (like ARM fast trace.)

MIPS platforms have long used a standard extension called E-JTAG. Some others followed that basic E-JTAG definition as a starting point for their proprietary debuggers.

One thing to watch for: many JTAG solutions use a popular USB interface IC, the FTDI FT232C. This chip is used in the Digilent adapters for example. If your toolchain supports this IC it's likely you could use a third party adapter, or even design the chip right in to your board (like some FPGA boards do.)

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ What about programming the MCU? If I only want to program the MCU (not debug), can I use the programmer? Since the toolchain does not support the programmer, I was thinking I could use another software that gets the hex file and programs the MCU with it. Is this not possible? Thanks. \$\endgroup\$ – Alithewise Nov 22 at 5:57
  • 1
    \$\begingroup\$ Again, in theory it’s possible. In practice, it depends on what the software supports. I actually developed such a system for a custom ASIC that did E-JTAG debugging and also allowed reflashing the system boot device. But it was custom and didn’t support anything else. \$\endgroup\$ – hacktastical Nov 22 at 16:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.