ULINK-ME User's Guide: ULINK-ME User's Guide

Keil, An ARM® Company ULINK-ME User's Guide

The Keil ULINK®-ME USB-JTAG Interface Adapter is a small hardware adapter that connects the USB port of your PC to the JTAG or OCDS debugging port of your target hardware. ULINK-ME is kin to the original ULINK USB-JTAG Adapter but has been updated and enhanced in many ways. You may use ULINK-ME to:

  • Download programs and test them on your target hardware.
  • Program the on-chip FLASH memory of many devices.
  • Program external FLASH memory of many target systems.

The ULINK-ME User's Guide describes the ULINK-ME Adapter and contains detailed operating instructions for the hardware.

  • Introduction gives an overview of the ULINK-ME USB-JTAG Adapter, features, where to find Technical Support, and a reference of supported devices.
  • Hardware Description explains the components of the ULINK-ME Adapter in detail.
  • Setup shows the ULINK-ME Adapter components, how to connect and use the board, and describes the drivers and target cables.

Revision History

  • January 2018: Updated for Vers. 5 board. Added Cortex-M board documentation.
  • August 2015: Real-Time Agent obsolete; Documentation removed.
  • September 2007: Initial revision.

Copyright © Keil, An ARM Company. All rights reserved.


ULINK-ME User's Guide: Microchip AT91SAM3 Devices

Microchip AT91SAM3 Devices

Microchip AT91SAM3 devices support all standard CoreSight features. ETM trace is not included. No additional target resources are needed for debugging. By default, AT91SAM3 devices debug in JTAG mode, and can be switched to Serial Wire mode. AT91SAM3 devices offer ITM and DWT trace data.

To use the CoreSight trace functionalities, the debugger adapter and connector, as well as µVision have to be configured properly:

  • Enable Serial Wire Trace

For additional information, refer to the AT91 ARM Cortex-M3 based Microcontrollers - SAM3U Series manual.


ULINK-ME User's Guide: Enable Serial Wire Trace

Enable Serial Wire Trace

To enable Serial Wire Trace on Atmel AT91SAM3 devices:

  • Use a ULINK-ME connector interface that supports Serial Wire, and connect ULINK-ME to the board and to the host computer.
  • Configure µVision to capture Serial Wire Trace data.

Configure µVision to capture Serial Wire Trace data

  1. Open the dialog Options for Target — Debug.

    Select the debugger adapter

  2. Enable Use, select ULINK Cortex Debugger, and click Settings to open the Target Driver Setup dialog.

    Configure the Serial Wire Debug mode

  3. Enable SWJ and select SW.
  4. Click the Trace tab.

    Configure Atmel SAM3x devices for Serial Wire Trace

  5. Set Trace Enable and Autodetect.
  6. The Core Clock must correspond to the device configuration.

Start the debugging session and verify the captured trace data with a µVision window described in the ULINK2 User's Guide.


ULINK-ME User's Guide: Configure Cortex-M Devices for Tracing

Configure Cortex-M Devices for Tracing

The examples below explain trace configuration options for selected device families using a Debug Initialization File.

  • Cortex-M0+ and Cortex-M23 MTB Devices
  • NXP MKL25Z Devices
  • NXP LPC17xx Devices
  • STMicroelectronics STM32F10xxx Devices
  • Microchip AT91SAM3 Devices
  • Texas Instruments LM3S Devices
  • Toshiba TMPM330 Devices

Note:

  • Trace Configuration in the ULINK2 User's Guide explains the options to control trace output.
  • If the dialog Options for Target — Debug — Settings shows the Pack tab, then enable the trace as explained in Trace Configuration for ULINK2.


ULINK-ME User's Guide: Cortex-M0+/M23 MTB Devices

Cortex-M0+/M23 MTB Devices

Many Cortex-M0+ and Cortex-M23-based devices provide simple instruction trace support by integrating Arm© CoreSightTM Micro Trace Buffer (MTB) technology.

When MTB is enabled, the trace data is stored in a user-configurable circular on-chip trace buffer that is located in device RAM and shares it with the executed application. It is crucial to ensure that MTB area in RAM is not used for the application variables, stack, and heap. Once the program is stopped, the debugger transfers the trace frames currently in the RAM to the Trace Instruction window on the host computer.

The device, the debugger adapter, and µVision have to be configured properly to capture MTB trace on such targets:

  • Enable MTB Trace

Note

  • If an Microcontroller Prototyping System (MPS) is used, then the Cortex-M0 MTB IP image has to be programmed into this unit.
  • Application examples are located in the folder \ARM\Boards\ARM\MPS_CM0MTB. The examples are configured to be used with an MPS.


ULINK-ME User's Guide: Enable MTB Trace

Enable MTB Trace

To enable Micro Trace Buffer (MTB) instruction tracing for Cortex-M0+/M23 processor-based devices:

  • Configure µVision project to capture MTB trace data as described below.
  • Make sure that ULINK-ME debug unit is connected to the target board and PC, and is properly configured in µVision.
  • Restart the debug session and observe the captured trace in µVision Trace Data Window.

Note:

  • Due to its intrinsic simplicity, MTB doesn't support advanced, trace-based features available in µVision, such as Performance Analyzer, Execution Profiler, Code Coverage, Logic Analyzer.
  • MTB tracing works on all supported debug probes in Serial Wire Debug (SWD) as well as in JTAG Debug modes.

Configure µVision project to capture MTB trace data

µVision uses a debug initialization file that configures and enables the MTB in application projects before the debug session starts. MTB configuration steps described below apply to all supported debug probes.

  1. Create a text *.ini file and enter the code that configures the MTB on the target device.

    Many MDK example applications already contain in the root folder a pre-configured initialization file for MTB setup (DBG_MTB.ini).

    The initialization code is typically annotated for µVision Configuration Wizard support and looks like below:

    /******************************************************************************/
/* DBG_MTB.ini: Initialization Script for Cortex-M0+ MTB(Micro Trace Buffer)  */
/******************************************************************************/
// <<< Use Configuration Wizard in Context Menu >>>                           //
/******************************************************************************/

/*-------------------------------------------------------------------
** Define the function to enable the trace port
**-----------------------------------------------------------------*/
FUNC void MTB_Setup (void) {
  unsigned long position;
  unsigned long master;
  unsigned long watermark;
  unsigned long _flow;
  unsigned long positionRegAddr;

// <e0.31> Trace: MTB (Micro Trace Buffer)
//    <o0.0..4> Buffer Size
//      <4=> 256B
//      <5=> 512B
//      <6=> 1kB
//      <7=> 2kB
//      <8=> 4kB
//      <9=> 8kB
//      <i> Trace buffer size in device RAM. MTB memory shall not be used by application.
//   <o1> Buffer Position
//     <i> Starting address of the trace buffer in RAM. MTB memory shall not be used by application.
//   <o2.0> Stop Trace when buffer is full
//   <o2.1> Stop Target when buffer is full
//   <o3> MTB register address
//     <i> Device-specific address of the MTB position register.
// </e>

/* Parameters linked to the Configuration Wizard */
  master     = 0x80000006;
  position   = 0x20000000;
  _flow      = 0x00000000;
  positionRegAddr = 0x41006000;

/* Preparing values for MTB register */
  position  &= 0xFFFFFFF8; // Mask POSITION.POINTER field
  watermark  = position + ((16 << (master & 0x1F)) - 32);
  _flow     |= watermark;

/* Writing values to the MTB registers on the device */
  _WDWORD(positionRegAddr+4, 0x00000000); // Clear MTB MASTER register
  _WDWORD(positionRegAddr, position);     // Write to MTB POSITION register
  _WDWORD(positionRegAddr+8, _flow);      // Write to MTB FLOW register
  _WDWORD(positionRegAddr+4, master);     // Write to MTB MASTER register to enable MTB
}

/*-------------------------------------------------------------------
** Invoke the function at debugger startup
**-----------------------------------------------------------------*/
MTB_Setup();

    To adapt this code to a custom application project, open the .ini file in µVision and specify following parameters using Configuration Wizard as shown on the figure below:

    • Trace buffer position and size in device RAM. For proper operation, it is critical to ensure that MTB is located in the RAM area that is not used by the executed firmware.

    • Stop Trace and Stop Target flags when trace buffer is full. As MTB is a circular buffer that gets read only when debug is paused, these flags help to ensure that trace data can be read before it gets overwritten.

    • Device-specific address of the MTB position register according to the device datasheet.

    Config Wizard for DBG_MTB.ini file

  2. Open the dialog Options for Target, go to the Debug tab and provide the path to the DBG_MTB.ini file in the Initialization File field.

  3. Enable MTB trace

After restarting the debug session the captured trace data can be now observed in µVision Trace Data Window.

Note:

  • Please also see an example of MTB configuration for Cortex-M0+ based NXP MKL25Z Devices.
    Application Note 237 further explores MTB configuration and operation on NXP LPC800 devices.


ULINK-ME User's Guide: NXP MKL25Z Devices

NXP MKL25Z Devices

NXP MKL25Z devices support MTB tracing. No additional target resources are needed for debugging. By default, MKL25Z devices debug in JTAG mode and can be switched to Serial Wire Debug mode.

To use the trace functionalities configure the device, the debugger adapter, and µVision:

  • Enable Micro Trace Buffer (MTB)


ULINK-ME User's Guide: Hardware Description

Hardware Description

The following illustration shows the important interface and hardware components of the ULINK-ME Adapter.

ULINK-ME Adapter Components

ULINK-ME Adapter


ULINK-ME User's Guide: Target Connectors

Target Connectors

ULINK-ME provides two JTAG connectors which are used for debugging different targets. The connectors provided are:

  • A standard (2.54mm/0.1") 20-pin connector for ARM targets. The 20-pin connector, mounted on the ULINK-ME board, may be plugged directly into the target board.
  • A 10-pin connector for ARM targets (Mfgr: Don Connex P/N: C42 or Samtec P/N: SHF-105-01-L-D-TH). The Samtec part is available with different options for plating, tail, shroud, and lead style. A 10-pin to 10-pin ribbon cable is included with your ULINK-ME.

ULINK-ME Adapter Connectors

ULINK-ME supports both JTAG and Serial Wire Mode interfaces. Refer to the appropriate pinout diagram for the ULINK-ME adapter connectors to make sure they match your target hardware.

JTAG Interface

ULINK-ME JTAG Pinout Diagrams

Signal | Connects to...
TMS | Test Mode State pin — Use 100K Ohm pull-up resistor to VCC.
TDO | Test Data Out pin.
RTCK | JTAG Return Test ClocK. (see Note below)
TDI | Test Data In pin — Use 100K Ohm pull-up resistor to VCC.
TRST | Test ReSeT/ pin — Use 100K Ohm pull-up resistor to VCC. TRST is optional and not available on some devices. You may leave it unconnected. This is an open-collector/open-drain output.
TCLK | Test CLocK pin — Use 100K Ohm pull-down resistor to GND.
VCC | Positive Supply Voltage — Power supply for JTAG interface drivers.
GND | Digital ground.
RESET | RSTIN/ pin — Connect this pin to the (active low) reset input of the target CPU. This is an open-collector/open-drain output.
CPUCLK | CPU clock (according IEEE Standard 1149.1).
OCDSE | Enable/Disable OCDS interface (Infineon-specific).
TRAP | Trap condition (Infineon-specific).
BRKIN | Hardware break in (Infineon-specific).
BRKOUT | Hardware break out (Infineon-specific).
/JEN | JTAG Enable (STMicroelectronics specific).
TSTAT | JTAG ISP Status (STMicroelectronics specific) (optional).
/RST | Chip reset (STMicroelectronics specific).
/TERR | JTAG ISP Error (STMicroelectronics specific) (optional).

Serial Wire Mode Interface

The Serial Wire (SW) mode is a different operating mode for the JTAG port where only two pins, TCLK and TMS, are used for the communication. A third pin can be use optionally to trace data. JTAG pins and SW pins are shared.

  • TCLK is SWCLK (Serial Wire Clock)
  • TMS is SWDIO (Serial Wire debug Data Input/Output)
  • TDO is SWO (Serial Wire trace Output)

ULINK2 Serial Wire Mode Pinouts

Signal | Connects to...
SWDIO | Data I/O pin. Use 100K Ohm pull-up resistor to VCC.
SWO | Optional trace output pin.
SWCLK | Clock pin. Use 100K Ohm pull-down resistor to GND.
VCC | Positive Supply Voltage — Power supply for JTAG interface drivers.
GND | Digital ground.
RESET | RSTIN/ pin — Connect this pin to the (active low) reset input of the target CPU. This is an open-collector/open-drain output.

Additional ARM 10-pin cables with connectors are available directly from Samtec:

  • 6" Cable (Samtec P/N: FFSD-05-D-06.00-01-N)
  • 12" Cable (Samtec P/N: FFSD-05-D-12.00-01-N)

Note

  • ULINK-ME is powered through the USB connection.
  • ULINK-ME operates at 3.3V. All JTAG pins are 5V tolerant.
  • Usually, devices do not include pull-up or pull-down resistors on JTAG nor SW pins. Resistors should be added externally onto the board. However, do not add resistors when the device includes them already.
  • Some NXP LPC2000 Devices have special pins (RTCK, DBGSEL) that enable the JTAG interface. For example, on the NXP LPC2129 the signal RTCK must be driven low during RESET to enable the JTAG interface. You may want to add jumpers to your hardware to accomplish this.


ULINK-ME User's Guide: LED Indicator

LED Indicator

The ULINK-ME Adapter has one LED that indicates connection status in the following ways:

  • Slow Flashing indicates that ULINK-ME is ready to communicate with the debugger.
  • Fast Flashing indicates that the target board is executing the program under debugger control.
  • ON during debugging indicates that the debugger has halted the target board.
  • ON during download indicates that target download/verification is in progress.

ULINK-ME Adapter LED

ULINK-ME Adapter - LED


ULINK-ME User's Guide: Reset Sequence

Reset Sequence

ULINK-ME's reset sequence is device-specific. To reset most devices, ULINK-ME asserts the JTAG RESET signal (pin 15 on the ARM JTAG connector), then attempts to immediately stop the device.

Some ARM devices do not support an immediate stop after a reset and instruction execution happens before ULINK-ME can issue a stop command. For these devices, when ULINK-ME gets control, it stops the CPU, and then sets the MCU's program counter (PC) and stack register (CSPR) to simulate an immediate stop after reset.

Side-Effects for ARM Devices

Resetting an ARM device may generate unexpected side-effects. The following Knowledgebase Articles describe these side effects in more detail:

  • ULINK: RESET BEHAVIOUR
  • ULINK: SINGLE STEP AT RESET APPEARS TO FAIL
  • ULINK: ARM DEVICE DOES NOT REACT
  • ULINK: RECOVER STR71X WHEN JTAG DISABLE


ULINK-ME User's Guide: Start Sequence

Start Sequence

ULINK-ME performs a number of operations to begin debugging on a target system. Many of these operations depends on configuration settings in the µVision IDE.

  • If Use Reset at Startup is enabled, ULINK-ME drives the JTAG RESET output (pin 15 on the ARM JTAG connector low for 50mSec.
  • ULINK-ME initializes the JTAG interface and detects the Chip ID.
  • If Use Reset at Startup is enabled, ULINK-ME performs a Reset Sequence.
  • ULINK-ME stops the device.
  • If Project — Options — Debug — Load Application at Startup is enabled, ULINK-ME downloads the code to the target and performs a Reset Sequence.
  • If the Project — Options — Debug — Initialization File text box contains the name of an initialization script, the debug commands in this script file are processed.


ULINK-ME User's Guide: USB Interface

USB Interface

The ULINK-ME USB Interface uses a standard USB-Micro connector to connect to your PC. ULINK-ME is a USB-powered device.

ULINK-ME USB Connector

ULINK-ME Adapter USB Interface


ULINK-ME User's Guide: Kit Contents

Kit Contents

The ULINK-ME USB-JTAG Adapter includes:

  • The ULINK-ME USB-JTAG Adapter,
  • One standard USB A to MicroB USB Cable,
  • One 10-pin to 10-pin 6" flat ribbon cable with 0.05" pitch connectors.


ULINK-ME User's Guide: Features

Features

The ULINK-ME Adapter has the following features:

  • A USB interface that provides power and fast PC communication,
  • Real-time in-circuit emulation using an on-chip debug interface,
  • Flash programming via the on-chip debug interface,
  • One LED that displays the current status.


ULINK-ME User's Guide: Limitations

Limitations

There are a number of limitations when debugging target programs with ULINK-ME. Many of these are actually limitations of the architecture of the on-chip debugger.

  • ARM7 and ARM9 Devices
    The Embedded ICE on these devices supports at most two (2) hardware breakpoints in Flash memory. Breakpoints in RAM are unlimited.
  • ARM Cortex-M Devices
    The Embedded ICE on these devices supports at most eight (8) hardware breakpoints in Flash memory. Breakpoints in RAM are unlimited.
  • Custom Boards and Hardware
    ULINK-ME is designed for use in ARM starter evaluation kits. It is not designed to drive custom hardware. For downloading and debugging custom boards and hardware, the ULINK2 USB-JTAG adapter provides all of the capabilities of the ULINK-ME adapter, and more.


ULINK-ME User's Guide: Supported Protocols

Supported Protocols

ULINK-ME supports a wide variety of devices and communication protocols.

  • ARM7 and ARM9 Devices
    These devices provide JTAG programming and debugging signals (known as Embedded ICE) that are brought out to a 20-pin connector.
  • ARM Cortex-M Devices
    These devices provide JTAG programming and debugging signals (known as Embedded ICE) or Serial Wire (SW) programming and debugging signals that are brought out to the 10-pin and 20-pin connectors.


ULINK-ME User's Guide: Software Requirements

Software Requirements

The ULINK-ME JTAG adapter requires the following software versions (or later) be installed on your computer:

  • MDK-ARM — V3.04


ULINK-ME User's Guide: Technical Data

Technical Data

Parameter | Description
Supply Voltage | Provided by the USB bus of a PC
I/O Voltage Range | 3.0V .. 3.3V
Peripherals | 1 × USB Interface 1 × JTAG Interface 1 × LED (RUN/COM/USB)
Overall Dimensions | 50mm x 25mm x 7mm (2.0" x 1.0" x 0.25").


ULINK-ME User's Guide: Introduction

Introduction

The Keil ULINK-ME USB-JTAG Adapter connects your PC's USB port to your target hardware (via JTAG) and allows you to:

  • Download programs and test them on your target hardware.
  • Program the on-chip FLASH memory of many devices.
  • Program external FLASH memory of many target systems.

ULINK-ME

ULINK-ME Adapter

The Keil µVision IDE/Debugger is the front-end you use with ULINK-ME to create, download, and test embedded applications on target hardware.


ULINK-ME User's Guide: TI LM3Sx Devices

TI LM3Sx Devices

Texas Instruments Stellaris® LM3Sx devices support all standard CoreSight features. ETM trace is not included. No additional target resources are needed for debugging. By default, LM3Sx devices debug in JTAG mode, and can be switched to Serial Wire mode. LM3Sx devices offer ITM and DWT trace data.

To use the CoreSight trace functionalities, the debugger adapter, µVision, and the target system have to be configured:

  • Enable Serial Wire Trace

For additional information, refer to the Stellaris data sheets.


ULINK-ME User's Guide: Enable Serial Wire Trace

Enable Serial Wire Trace

To enable Serial Wire Trace on Luminary LM3Sx devices:

  • Use a ULINK-ME connector interface that supports Serial Wire, and connect ULINK-ME to the board and to the host computer.
  • Configure µVision to capture Serial Wire Trace data.

Configure µVision to capture Serial Wire Trace data

  1. Open the dialog Options for Target — Debug.
  2. Enable Use, select ULINK Cortex Debugger, and click Settings to open the Target Driver Setup dialog.

    Select the debugger adapter

  3. Enable SWJ and select SW.

    Configure the Serial Wire Debug mode

  4. Click the Trace tab.

    Configure Luminary devices for Serial Wire Trace

  5. Set Trace Enable and Autodetect.
  6. The Core Clock must correspond to the device configuration.

Start the debugging session and verify the captured trace data with a µVision window as described in the ULINK2 User's Guide.

Note

  • Use the examples delivered with the Luminary board ek-lm3s6965 as a reference.


ULINK-ME User's Guide: NXP LPC17xx Devices

NXP LPC17xx Devices

NXP LPC17xx devices support all CoreSight features including ETM trace. No additional target resources are needed for debugging. By default, LPC17xx devices debug in JTAG mode, and can be switched to Serial Wire mode. LPC17xx devices offer ETM, ITM, and DWT trace data. However, to capture ETM trace data, a ULINKpro debugger adapter is needed instead of ULINK-ME.

To use the CoreSight trace functionalities, the LPC17xx device, the debugger adapter and connector, as well as µVision have to be configured properly:

  • Enable Serial Wire Trace

Note

  • While debugging, the LPC17xx cannot wake up in the usual way from deep-sleep and power-down modes. Preferably avoid to use these modes during debugging.
  • Also, while debugging, the SYSTICK timer and the Repetitive Interrupt Timer (RIT) are stopped automatically whenever the CPU is stopped. Other peripherals are not affected.
  • If the Repetitive Interrupt Timers is configured such that its PLCK is lower than the CPU clock rate, it might not increment predictably during single-stepping operations.
  • Debugging is disabled when Code Read Protection (CRP) is enabled.


ULINK-ME User's Guide: Enable Serial Wire Trace

Enable Serial Wire Trace

To enable Serial Wire Trace on an NXP LPC17xx device:

  • Use a ULINK-ME connector interface that supports Serial Wire, and connect ULINK-ME to the board and to the host computer.
  • Configure µVision to capture Serial Wire Trace data.

Configure µVision to capture Serial Wire Trace data

  1. Open the dialog Options for Target — Debug.

    Enable trace on LPC17xx

  2. Enable Use, select ULINK Cortex Debugger, and click Settings to open the Target Driver Setup dialog.

    Configure LPC17xx for Serial Wire Trace

  3. Enable SWJ and select SW.
  4. Click the Trace tab.

    Configure LPC17xx for Serial Wire Trace

  5. Set Trace Enable and Autodetect.
  6. The Core Clock must correspond to the device configuration.

Start the debugging session and verify the captured trace data with a µVision window as described in the ULINK2 User's Guide.

Note

  • Use the examples delivered with the Keil board MCB1700 as a reference.


ULINK-ME User's Guide: Enable Micro Trace Buffer (MTB)

Enable Micro Trace Buffer (MTB)

To enable CoreSight MTB tracing on Freescale MKL25Z devices:

  • Connect ULINK-ME to the board's ARM 10-Pin Connector and to the host computer.
  • Configure µVision to capture MTB trace data.

Configure µVision to capture MTB trace data.

  1. Create a text file, for example DBG_MTB.ini, and enter the following code:
    /*-------------------------------------------------------------------
** Define the function to enable the trace port
**-----------------------------------------------------------------*/
FUNC void MTB_Setup (void) {
  unsigned long position;
  unsigned long master;
  unsigned long watermark;
  unsigned long _flow;

  master     = 0x80000008;
  position   = 0x20000000;
  _flow      = 0x00000000;

  position  &= 0xFFFFFFF8;              // Mask POSITION.POINTER field
  watermark  = position + ((16 << (master & 0x1F)) - 32);
  _flow     |= watermark;

  _WDWORD(0xF0000004, 0x00000000);      // MASTER
  _WDWORD(0xF0000000, position);        // POSITION
  _WDWORD(0xF0000008, _flow);           // FLOW
  _WDWORD(0xF0000004, master);          // MASTER
}

/*-------------------------------------------------------------------
** Invoke the function at debugger startup
**-----------------------------------------------------------------*/
MTB_Setup();

    Use the _WDWORD command to configure the device.

  2. Open the dialog Options for Target — Debug and insert DBG_MTB.ini into the field Initialization File.

    Configure the device for tracing

Start the debugging session and verify the captured trace data with a µVision window.

Note

  • Use the examples delivered with the Freescale board FRDM-KL25Z as a reference.
  • MTB tracing works in Serial Wire Debug as well as in JTAG Debug mode.


ULINK-ME User's Guide: Setting Up and Using ULINK-ME

Setting Up and Using ULINK-ME

Note

  • The installation, configuration, downloading, debugging and rules for chaining multiple targets for the ULINK-ME USB-JTAG Adapter are identical to those for the ULINK2 USB-JTAG adapter. With the exception of Connecting ULINK-ME, the links below for those topics reference the appropriate pages in the ULINK2 User's Guide.

The ULINK-ME USB-JTAG Adapter is designed to be easy to use. There are just a few steps to configuring ULINK-ME and setting up your programming environment.

  • Connecting ULINK-ME
    Shows how to connect ULINK-ME to your PS and target hardware.
  • Installing Drivers
    Shows how to install USB drivers on your PC.
  • Configuring µVision
    Shows how to configure target debugging and Flash programming options for µVision.

After ULINK-ME is connected and configured, you may program the Flash memory and debug programs. The following detailed explanations show you how.

  • Downloading to Flash
    Shows how to download your program to the Flash memory of your target system.
  • Debugging Programs
    Shows how to debug programs on target hardware.
  • Chaining Multiple Targets
    Shows how to chain multiple target systems onto a single ULINK-ME.


ULINK-ME User's Guide: STMicroelectronics STM32F10xxx Devices

STMicroelectronics STM32F10xxx Devices

STMicroelectronics STM32F10xxx devices support all CoreSight features including ETM trace. No additional target resources are needed for debugging. By default, STM32F10xxx devices debug in JTAG mode, and can be switched to Serial Wire Debug mode. STM32F10xxx devices offer ETM, ITM, and DWT trace data. However, to capture ETM trace data, a ULINKpro debugger adapter is needed instead of ULINK-ME.

To use CoreSight trace functionalities, the STM32F10xxx device, the debugger adapter and connector, as well as µVision have to be configured properly:

  • Enable Serial Wire Trace

Note

  • When debugging in low-power modes, configure the DBG_SLEEP or DBG_STOP bit of the DBGMCU_CR register first. Otherwise, the debug connection is lost.


ULINK-ME User's Guide: Enable Serial Wire Trace

Enable Serial Wire Trace

To enable Serial Wire Trace on STMicroelectronics STM32F10xxx devices:

  • Use a ULINK2 connector interface that supports Serial Wire, and connect ULINK-ME to the board and to the host computer.
  • Enable the Trace Port Interface as described in the STM32F103xx Reference Manual, chapters Pinout and Debug Port Pins and TRACE Pin Assignment.
  • Configure µVision to capture trace data.

Enable the Trace Port Interface

  1. Create a text file, for example conf_STM32F10_SWO.ini, and enter the following code:
    /*-------------------------------------------------------------------
** Define the function to enable the trace port
**-----------------------------------------------------------------*/
FUNC void EnableTPIU(void) {

  _WDWORD(0xE0042004, 0x00000020);    // Set asynchronuous communication via DBGMCU_CR
}

/*-------------------------------------------------------------------
** Invoke the function at debugger startup
**-----------------------------------------------------------------*/
EnableTPIU();

    Use the _WDWORD command to configure the TRACE_IOEN and TRACE_MODE bits of the DBGMCU_CR register: _WDWORD(0xE0042004, 0x00000020);

  2. Open the dialog Options for Target — Debug and insert conf_STM32F10xxx.ini into the Initialization File field.

    Configure the device for tracing

Configure µVision to capture trace data

  1. Open the dialog Options for Target — Debug.

    Select as the debugger adapter

  2. Enable Use, select ULINK Cortex Debugger, and click Settings to open the Target Driver Setup dialog.

    Configure the Serial Wire Debug mode

  3. Enable SWJ and select SW.
  4. Click the Trace tab.

    Set the Serial Wire Trace options

  5. Set Trace Enable and Autodetect.
  6. The Core Clock must correspond to the device configuration.

Start the debugging session and verify the captured trace data with a µVision window as described in the ULINK2 User's Guide.

Note

  • Always synchronize the settings in the *.ini file with the settings in the Target Driver Setup—Trace Port dialog.
  • Use the examples delivered with the Keil board MCBSTM32E as a reference.


ULINK-ME User's Guide: Connecting ULINK-ME

Connecting ULINK-ME

ULINK-ME is equipped with both a 10-pin (1.28mm/0.05") and a 20-pin (2.54mm/0.1") Arm interface connector. The 10-pin connector uses a ribbon cable to connect to your board, while the 20-pin connector, mounted on the ULINK-ME board, may be plugged directly into a standard Arm 20-pin interface connector on your target board.

10-pin Connector

ULINK-ME Using 10-pin Connector
ULINK-ME Connected Via 10-pin JTAG Connector

The 10-pin ribbon cable (included with your ULINK-ME board) connects using the Arm 10-pin interface.

20-pin Connector

ULINK-ME Using 20-pin Connector
ULINK-ME Connected Via 20-pin JTAG Connector

The ULINK-ME Adapter plugs directly into the Arm 20-pin interface (2.54mm/0.1" pin spacing) connector on your target board.


ULINK-ME User's Guide: Debug

Debug

The Debug section controls caching, download, and device reset options applied each time a debug session starts.

Target Driver Setup - Debug Options

The Cache Options improve the performance of the µVision Debugger during target debugging by caching target memory areas in the PC memory. By default, caching options are enabled to get maximum performance.

  • Cache Code informs the debugger that the downloaded program code will not change. When this option is set, µVision never reads the program code from the target system. Disable this option if you are using self-modifying code or if you suspect that your program code is being overwritten.
  • Cache Memory determines whether memory displays are updated during a program stop. When this option is set, the debugger does not update memory displays until the next single step, procedure step, or go command executes. Disable this option if you want to see the actual memory content (e.g. the data content of memory mapped peripherals) when the debugger is halted.

The Download Options control the downloading of code to the target system when the debugger starts.

  • Verify Code Download compares the content of the target memory with the application program loaded in the Debugger.
  • Download to Flash downloads code to all memory regions. When disabled, the debugger does not download code to the Memory Address Ranges defined under Flash Download Setup.

Misc Options

  • Use Reset at Startup When enabled, the debugger issues a CPU Reset to the target when the debugger starts. When disabled, the debugger just stops the CPU at the currently executed instruction. This allows you to start a debug session and debug a program that is currently executing on your target.

    Refer to Start Sequence for more information.


ULINK-ME User's Guide: Toshiba TMPM330 Devices

Toshiba TMPM330 Devices

Toshiba TMPM330 devices support all CoreSight features including ETM trace. No additional target resources are needed for debugging. By default, TMPM330 devices debug in JTAG mode and can be switched to Serial Wire Debug mode. TMPM330 devices offer ETM, ITM, and DWT trace data. However, to capture ETM trace data, a ULINKpro debugger adapter is needed instead of ULINK-ME.

To use the CoreSight trace functionalities, the TMPM330 device, the debugger adapter and connector, as well as µVision have to be configured properly:

  • Enable Serial Wire Trace

Note

  • Debug and trace operations are prohibited when the device's Security Function is enabled.
  • The watchdog timer stops in debug mode.
  • When PA0 and PB0 are configured as debug pins, output is enabled even in STOP mode, regardless of the SYSCR2<DRVE> or STBYCR2<DRVE> bit setting.
  • When PA1 is configured as a debug pin, low-power mode is not fully effective. Configure PA1 as a general-purpose port, if the debug function is not used.


ULINK-ME User's Guide: Enable Serial Wire Trace

Enable Serial Wire Trace

To enable Serial Wire Trace on Toshiba TMPM330 devices:

  • Use a ULINK2 connector interface that supports Serial Wire, and connect ULINK-ME to the board and to the host computer.
  • Configure µVision to capture Serial Wire Trace data as described in the manual 32-bit RISC Microprocessor - TMPM330 Family, chapters Port A (PA0-PA7), and Port B (PB0-PB7).

Configure µVision to capture Serial Wire Trace data

  1. Open the dialog Options for Target — Debug.

    Select the debugger adapter

  2. Enable Use, select ULINK Cortex Debugger, and click Settings open the Target Driver Setup dialog.

    Set the Serial Wire Trace options

  3. Enable SWJ and select SW from the Port drop-down list.
  4. Click the Trace tab.

    Configure the Serial Wire Debug mode

  5. Set Trace Enable.
  6. Set the Trace Port to Serial Wire Output - Manchester.
  7. Enable Autodetect for the SWO Clock.
  8. Make sure the Core Clock is set correctly.

Start the debugging session and verify the captured trace data with a µVision window as described in he ULINK2 User's Guide.

Note

  • Use the examples delivered with the Keil board MCBTMPM330 as a reference.