**** Advance Notice ****

This site will be closed on 31 December 2015,

Important Information for users of NXP LPCXpresso

This site is for users of Code Red branded products.

NXP LPCXpresso users should visit the LPCXpresso FAQ's for up-to-date information relevant to that product.

Multiple devices on a JTAG scan chain

Version 4 of the Code Red IDE provides support for handling multiple devices on a JTAG scan chain. The contrasts with earlier versions of the tools, where when connecting to a target over JTAG, the first device found would always be connected to.

Note: The scan chain order used by the Code Red tools is relative to TDI (i.e. the emulator side).

Targets which default to JTAG debug connections

MCU's based on ARM7 and ARM9 family processors will always connect using JTAG (as SWD is not available). The first time for a particular project that you connect to such a target, you will need to select which device on the JTAG scan chain you wish to connect to.

For ARM7 based parts, typically only the ARM7 processor will be visible.

For ARM9 based parts, typically the processor will be only one of the JTAG devices detected. In the below screenshot, we are connecting to a single NXP LPC2929 MCU, which has an ARM968E-S and an ARM9-ETB (Embedded Trace Buffer) on its scan chain...

jtag_lpc2929.jpg

Thus in this case, you would need to select the ARM968E-S as the device to connect to.

Once you have selected for a particular project the device to connect to, the tools will remember this for the next time that you connect, so that there is normally no need to reselect in future.

If your ARM7/ARM9 based system has two or more MCUs on the JTAG scan chain, then all of the processors will get picked up and displayed in the same way. In the below screenshot, we are connecting to a system containing an NXP LPC2929 MCU (ARM968E-S with ARM9-ETB) and an NXP LPC3250 (ARM926EJ-S with ARM9-ETB) on its scan chain...

jtag_arm9x2.jpg

Thus in this case, you would need to select either the ARM968E-S or the ARM926EJ-S as the device to connect to. Note that if you have a system containing multiple, but identical processors then there is no way for the tools to tell which device is which. Thus you will need to examine the documentation for the system to determine what order the devices are connected on the JTAG scan chain, and hence which device is the correct one to connect to.

Targets which default to SWD debug connections

MCU's based on Cortex-M family processors will typically default to debug connections over SWD. However in some circumstances it may be necessary to connect via JTAG instead. This would be the case, for example, where you are chaining multiple MCU's together.

[Note: Some Cortex-M based MCU's only provide SWD debug capability and do not support connect via JTAG. Check the documentation for the MCU that you are using for more details.]

In order to connect to an MCU which normally uses SWD using JTAG instead, we need to modify the way that the debug launch for the project is carried out. To do this:

  1. Create new launch configurations for the project, by right clicking on the project in the project explorer view and selecting Launch Configurations -> Create Launch Configurations. Note that this will do nothing if they already exist.

  2. Open the newly created launch configurations for the project (for the current build configuration), by right clicking on the project in the project explorer view and selecting Launch Configurations -> Open Current Launch Configuration.

  3. Click on the Debugger tab and in the 'Debugger configuration' drop down, select the configuration with (JTAG) at the end of its name. For example to connect to an LPC1768 via JTAG you need to select NXP LPC17xx (JTAG), then click Apply and then Close This will then switch the configuration options for this connection appropriately.

jtag_launch_config.jpg

After reconfiguring as above, the first time that you launch a debug session, the tools will prompt you as to which device on the JTAG scan chain you wish to connect to. In the below screenshot, we are connecting to system which contains two LPC1768 devices on the scan chain....

jtag_lpc17.jpg

Note that with Cortex-M based systems, the processors will all show up as Coresight JTAG debug ports, and there is no way for the tools to tell which device is which. Thus you will need to examine the documentation for the system to determine what order the devices are connected on the JTAG scan chain, and hence which device is the correct one to connect to.

Once you have selected for a particular project the device to connect to, the tools will remember this for the next time that you connect, so that there is normally no need to reselect in future.

IR Length = "?"

If one of the devices on the scan chain shows up as having an IR Length of "?", then the tools have been unable to identify the length of the scan chain. In order to be able to connect to the target, you will need to consult the documentation to find the correct value. You can then edit the "?" within the dialog and replace it with the correct value.

For example, we have seen this with trying to connect to the STM32L152VB MCU where STM32L1 Boundary Scan Tap 0 (0x06416041) shows up with IR Length = "?". To successfully connect to the STM32L1 itself, it is necessary to modify this to the correct length, which is "5".

Reducing wire speed

When connecting to a remote target , the Code Red IDE will determine what it believes is a safe speed to obtain stable communication at. The tools use a built in maximum value to start this "negotiation". The default frequencies are typically 3 MHz (CM0/CM3/CM4), 1 MHz (ARM9), and 250 KHz (ARM7) - though this may change between releases.

However these values can be tweaked by the user, as depending on their system it may be necessary to reduce the maximum speed. This is particularly the case when communicating over JTAG with multiple devices on the scan chain.

To do this, you can change the "Maximum wire speed" setting in the launch configuration(s) for a particular project from "default" to specific value (accessible via the debugger tab of Launch Configurations -> Open Current Launch Configuration).

Typically we would recommend starting with a low value (eg 250 KHz), and increasing this until you reach a point where communication with the target becomes unreliable.

Note : This above wire speed information only relates to connections using RedProbe(+). LPC-Link only supports fixed wire speeds.

Hardware considerations for chaining multiple MCUs together

  1. All targets should be operating at the same JTAG VTREF voltage which is typically true at 3v3.
  2. RTCK should not be connected from any target.
  3. Connect the control signals (TMS and TCLK) in parallel.
  4. Connect the data signals (TDI and TDO) in series. Thus the TDO output from one MCU should be the TDI input to the next MCU in the chain.

MultipleJtagDevices (last edited 2014-02-19 11:02:29 by DerekMorris)