ULINKplus User's Guide: ULINKplus User's Guide

Keil, An ARM® Company ULINKplus User's Guide

The ULINK®plus User's Guide describes the Keil ULINKplus Debug and Trace Unit and contains operating instructions for the hardware.

  • Introduction gives an overview of the ULINKplus adapter features and interfaces. It describes requirements, technical characteristics, and provides a reference to supported devices.
  • Debug and Trace explains the ULINKplus JTAG/SWD interface. It describes in details how to connect to a target HW and to perform flash programming, application debug and trace capturing using ULINKplus.
  • Power Measurement explores the ULINKplus power measurement capabilities. It explains connection to the target system using Power interface, available configuration options as well as usage of µVision System Analyzer window for data analysis.
  • Test Automation describes how to monitor and trigger digital and analog signals on the target using ULINKplus I/O interface. This chapter also explains usage of µVision script engine for test automation and provides a template debug script that helps you to get started.
  • Troubleshooting gives hints and solutions to issues that might arise.
  • Appendix lists additional information such as error messages.

Revision History

  • December 2017: Restructured Setup ULINKplus and Using ULINKplus chapters into Debug and Trace, Power Measurement and Test Automation chapters.
  • October 2017: Initial revision.

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


ULINKplus User's Guide: Analyzing Power Consumption

Analyzing Power Consumption

µVision provides multiple ways to analyze the power consumption of the target system in real-time and by logging the data.

System Analyzer

The Consumption section of the System Analyzer window displays the voltage and current readings captured by ULINKplus, showing energy usage of a running target over time.

System Analyzer window display

Note:

The System Analyzer window continuously captures and displays power consumption data in high resolution for the latest ~8.4 seconds of program execution. To analyze power consumption over longer intervals the Event Statistics feature can be used.

Event Statistics

The Event Statistics window shows statistical data about timing and power when executing application code. For ULINKplus, the available metrics cover execution time, counts, consumed electrical charge and energy, average current and voltage.

Event Statistics Window


ULINKplus User's Guide: Appendix

Appendix

This chapter contains the following sections:

  • Error Messages.


ULINKplus User's Guide: CE - Declaration of Conformity

CE - Declaration of Conformity

CE Declaration of Conformity

Download the PDF version of the CE declaration of conformity.


ULINKplus User's Guide: Debug

Debug

The following steps describe the setup of µVision for ULINKplus:

Debug Options

The Debug dialog controls the setup of the µVision Debugger:

  1. Options for Target Open the dialog Options for Target — Debug. Enable Use and select ULINKplus Debugger.

    Select Target Driver

    • Enable Load Application at Startup to load the object file into the µVision Debugger.
    • Enable Run to main() to execute code until main() is reached.
  2. Click Settings to open further configuration pages:
    • Debug configures the way ULINKplus connects to and debugs the target hardware.
    • Trace defines the way trace events are generated and captured.
    • Flash configures programming for on-chip and external Flash memory on your target hardware.
    • Pack controls the configuration setup delivered as part of Software Packs.

Utilities Options

The Utilities dialog controls the setup of the µVision Flash downloader:

  1. Button Options for Target Use Options for Target - Utilities to open the dialog.

    Select Target Driver

    • Select Use Target Driver for Flash Programming and enable Use Debug Driver.
    • Enable Update Target before Debugging to program Flash whenever a debugging session starts and the binary has been updated.
  2. Click Settings to open further configuration pages.


ULINKplus User's Guide: Configuring the I/O pins

Configuring the I/O pins

Setup

Open the ULINKplus dialog View - Analysis Windows - ULINKplus.

I/O Dialog The I/O section shows how the I/O pins are configured:

  • Pin - Displays the pin number
  • Function - Displays the current function set that is applied to the I/O
  • Out - If the function is "Digital Output", you can set the output to high by checking the box. Otherwise the output is low. For Pin 7, when configured for Analog Output, the pin voltage displays.
  • In - Displays the current I/O voltage level if configured to "Digital Input"

The I/O pins are configured, accessed and controlled using ULINK Virtual Simulation Registers (VTREGs). The I/O VTREGs are defined below:

VTREG | Type | Description
Mode setup |  |
ULINK_DIR | integer | Set input or output direction. Bit clear = input, bit set = output
ULINK_AMODE | integer | Set digital or analog function. Bit clear = digital I/O, bit set = analog I/O
Digital I/O |  |
ULINK_IN | integer | Reads digital input pins (also returns the physical level on output pins)
ULINK_OUT | integer | Sets digital output pins (pins configured as input with ULINK_DIR are not affected)
Analog I/O |  |
ULINK_AINn | float | Voltage level at analog input. n=4..7, requires pin configuration for analog input
ULINK_AOUT7 | float | Voltage level at analog output, requires pin configuration for analog output
ULINK_3V3 | integer | Turns +3.3V Out pin on or off. 1=On, 0=Off


ULINKplus User's Guide: Debug Settings

Debug Settings

The Debug dialog configures the way ULINKplus connects to the target hardware. When Pack support is enabled some device options or settings are controlled by the Software Pack and therefore grey or not available. As highlighted on the figure below there are 5 configurations groups in the dialog:

  • ULINKplus - JTAG/SW Adapter
  • SW Device/JTAG Device Chain
  • Connect & Reset Options
  • Cache Options
  • Download Options

Options for Target - Debug - Use ULINKplus Selection

ULINKplus - JTAG/SW Adapter shows information about the debug unit.

Serial No:
Select the serial number of the ULINKplus adapter to use. This is useful when multiple adapters are connected to the PC. Any selects the first adapter in the list.
Firmware Version
Displays the firmware software revision of the selected ULINKplus.
SWJ
Enable to generate sequences that switch between JTAG and Serial Wire (SW) mode. Disable this option for devices with only a SW or only a JTAG interface.
Port
Selects the debug port type to use: JTAG or SW (Serial Wire).
Max Clock
Sets the maximum clock rate.

SW Device/JTAG Device Chain shows status information about the connection to the target devices.

Automatic Detection
ULINKplus detects the connected devices and displays the IDCODE and known device names.
Manual Configuration
Specify the parameters of each device in a JTAG device chain when chaining multiple targets.
AP
Specify the identifier of the Access Port in multi-core devices with a single Debug Port (DP). The Access Port specification depends on the Arm Debug Interface (ADI) supported in the device.
  • For APv1 (ADIv5):
    • The AP value range is 0 to 255.
    • For single core devices, set AP to 0 (default).
    • For a multi-core device, core 0 is expected to have AP=0 and core 1 AP=1. However, the port identifiers are specified by the device manufacturer.
  • For APv2 (ADIv6):
    • Only SWD connection to ADIv6 target systems is currently supported.
    • The AP value range is 0x00000000 to 0xFFFFFFFF. The value needs to be set by a user for a target sub-system based on the information provided by the device vendor in documentation.
    • If AP value is set to 0xFFFFFFFF then µVision debugger will automatically connect to the AP of the first auto-detected CPU.
    • Debugger automatically requests power using Granular Power Requester (GPR) from Class 0x9 ROM Tables.
    • Only top-level APs are supported, not "nested APs" (AP exposing its registers via target memory accesses of a higher-level AP).

Connect & Reset Options controls device connection and reset behavior.

Connect
Control operations that execute at debugger start:
  • Normal stop the CPU after connect.
  • with Pre-reset apply a hardware reset before connect.
  • under Reset holds the hardware reset signal active during connect. Use this option when the user program disables the JTAG/SW interface by mistake.
  • without Stop connect without stopping the CPU. Useful to hot-plug to a running target.
Reset after Connect
When enabled, a reset is issued after the connect operation. Refer to Start Sequence for details.
Log Debug Accesses
When enabled, create a log file (ULINKplus_DebugLog_nnnn.log) in the project folder to analyze debugger communication issues. Disable this option for normal operation.
Reset
Control how the debugger performs a Reset Sequence to the device. The available options vary when Pack support is enabled.
  • HW RESET assert hardware reset (nReset) signal on the JTAG/SWD connector.
  • SYSRESETREQ set the SYSRESETREQ bit to perform a software reset (Cortex-M core and on-chip peripherals are reset).
  • VECTRESET performs a CPU reset (on-chip peripherals are not reset). VECTRESET is not supported on Cortex-M0, Cortex-M0+, Cortex-M1, and Armv8-M cores.
  • Custom select a custom reset method (available when defined in the Software Pack and Pack support is enabled).
  • Autodetect selects the best suitable reset method for a known device. For unknown devices SYSRESETREQ is used. (Not available when Pack support is enabled.)
Stop after Reset
Stop the CPU when executing the reset vector (this option enables the Cortex-M Reset Vector Catch).

Cache Options improve the debugger performance during debugging by caching target memory areas into the PC memory. Enable caching options to get maximum performance.

Cache Code
The debugger assumes that downloaded program code will never change. When enabled, the debugger never reads the program code from the target. Disable this option when the application includes self-modifying code or the program code might get overwritten.
Cache Memory
Determines whether memory displays are updated during a program stop. When enabled, the debugger does not update memory displays until the next program execution. Disable this option to display the actual memory content (for example, the content of memory mapped peripherals) when the debugger is halted.

Download Options control the program code updates at debugger start.

Verify Code Download
Compare the content of the target memory with the application program loaded in the debugger. Enable this option to prevent debugging of wrong code, for example when working with various project targets.
Download to Flash
By default, this option is disabled to avoid multiple code downloads to Flash memory defined under Flash Download. When enabled, download code to all memory regions including Flash memory. For more information, refer to the knowledgebase article µVision Debugger: Error 57: Illegal Address in Debugger Output Window.


ULINKplus User's Guide: Pack Settings

Pack Settings

The Pack dialog controls the usage of debug definitions provide with Software Packs.

This dialog is only available when the Software Pack contains debug descriptions. These descriptions provide configuration settings for the debug connection and specify trace features of the device. The debug descriptions influence the options available in the dialogs Debug, Trace, and Flash Download.

Debug Description controls the usage of Software Packs for the debug and trace setup.

Pack
The name of the Software Pack that contains the debug description.
Enable
Enable the debug description for the Debug and Trace dialog. It is recommended to use this setting.
Log Sequence
When enabled, the execution of the debug descriptions is logged to the specified file. The * wildcard in the filename is replaced by an index number.
Configuration
Some debug descriptions offer configuration settings that are stored in a configuration file. Click Edit to modify settings for this target.

Configuring debug settings

The dbgconf file usually contains Configuration Wizard annotations that make it easy to change the debug configuration:

Target Driver Setup - Trace

Notes

While configuring debug settings is optional in most cases, it is essential for complex devices with Arm Cortex-M23 or M33 cores that require correct setup before Flash downloading. Consult the device user manual for more information.


ULINKplus User's Guide: Trace

Trace

The Trace dialog defines generation and capturing of trace events via the Serial Wire Trace Output (SWO) pin. ULINKplus delivers trace information in real-time to the host PC.

Note

  • While the debugger is running the Status Bar indicates the trace capturing operation.

Target Driver Setup - Trace

General settings define system clock frequency and overall trace capturing.

Core Clock
Specify the processor core clock frequency here. The debugger uses this value to calculate timings for trace capturing and displays (such as current and voltage for example), even when trace is disabled. It also configures the debug unit's trace capture UART device. It should be be set to the system clock frequency that your target application uses in active state. If in doubt, use the Clock Measurement capabilities of ULINKplus to verify the correct setting. If your device's trace clock does not run as fast as the system core clock, specify a separate Trace Clock.
Trace Enable
Enable this option to capture trace via the SWO pin.
Trace Clock
Specify the trace clock frequency here, if it differs from the Core Clock.
Use Core Clock
Enable this option to use the core clock frequency for trace. If your trace clock differs, uncheck and enter the correct trace clock in the Trace Clock box.

Trace Port defines the trace port parameters. To use this feature, Port must be set to SW (Serial Wire) in the Debug dialog.

Serial Wire Output – UART/NRZ
ULINKplus only supports this trace output method.
SWO Clock Prescaler
Defines the prescaler setting for the SWO clock divider. Increase this to reduce Hardware Buffer Overrun errors. Decrease this to reduce Trace Data Overflow errors.
Autodetect
Enable this option to configure the highest possible SWO clock rate ULINKplus will run at. It will be calculated using the given Trace or Core Clock setting
SWO Clock
Displays the actual configured SWO clock rate.

Timestamps control timing information created within the trace stream.

Enable
Activate timestamps that are appended to trace packets.
Prescaler
Granularity of the timestamps (Core Clock divided by the Prescaler); set to 1 for best accuracy.

Note

  • Enable timestamps for correct timing information (for example in the System Analyzer).
  • Increase the Prescaler value if trace capture errors are shown in the Status Bar .
  • PC Sampling timestamps are reconstructed for the given period and timestamps will be shown for them even if the Enable option is not selected.

PC Sampling controls generation of program counter (PC) values within the trace stream.

Prescaler
Frequency of periodic PC values (Core Clock divided by Prescaler).
Periodic
Enables PC values at regular intervals.
Period
Displays the timing of the PC sampling interval.
on Data R/W Sample
Generate PC values for memory read/write trace capturing. Enable this option to show the program location that caused the memory accesses.

Note

  • Disable Periodic PC sampling or increase the Prescaler value if trace capture errors are shown in the Status Bar .

Trace Events enable the trace capturing of exceptions, interrupts, and Event Counters.

CPI: Cycles per Instruction
Indicates additional wait states during program execution: this counter increments on each additional cycle required to execute instructions (for example stalls caused by the memory system).
EXC: Exception Overhead
This counter increments on each cycle associated with exception stack operations (entry, return, preemption) and other exception-related processes.
SLEEP: Sleep Cycles
This counter increments on each cycle associated with power saving, whether initiated by a WFI or WFE instruction, or by the sleep-on-exit functionality.
LSU: Load Store Unit Cycles
This counter increments on each additional cycle required to execute a multi-cycle load-store instruction.
FOLD: Folded Instructions
This counter increments on any instruction that executes in zero cycles (for example, an IT instruction is folded and does not use any cycles).
EXCTRC: Exception Tracing
Include information about exception and interrupt execution in the trace stream. The Trace Exceptions window shows statistics and System Analyzer Viewer timing information.

Note

  • Disable some options if trace capture errors are shown in the Status Bar .

ITM Stimulus Ports control trace events generated with the Instrumentation Trace Macrocell (ITM).

Enable
Enable an ITM port with individual check-boxes or type a value into the field.
  • Enable Port 0 to view data in the serial window Debug (printf) Viewer.
  • Enable Port 31 to view RTX events in Kernel Awareness windows.
Privilege
Define access rights for a group of 8 ITM ports.
  • Enable an ITM port to protect access in thread mode (privilege mode can always access ITM ports).
  • Disable to allow access in any mode.


ULINKplus User's Guide: Component Viewer

Component Viewer

The Component Viewer shows information about:

  • Software components that are provided in static memory variables or structures.
  • Objects that are addressed by an object handle.
  • Events and time information generated by event annotations in a software component using the Event Recorder.

The picture below is an example showing debug information for an USB Device object:

Refer to Component Viewer documentation for more information.


ULINKplus User's Guide: Debug and Trace

Debug and Trace

ULINKplus adapter has a 10-pin JTAG/SWD connector that enables programming, debugging, and tracing programs on the target hardware. This connector is 1kV isolated and is well-suited for use with motor control and power converter applications, as well as systems with sensitive analog processing.

ULINKplus JTAG/SWD Connection Diagram

ULINKplus quick start guide provides a video overview of ULINKplus debug and trace capabilities.

This Chapter contains following information:

  • JTAG/SWD Interface provides schematics, signal description and technical data about the interface.
  • ULINK SWD Adapter explains how to use the adapter board to the 6-pin SWD port on STM32 development boards.
  • Connect to Target shows how to connect a ULINKplus to your PC and target hardware.
  • Debug explains debug configuration settings and gives an introduction on how to debug your application.
  • Configure Flash Download describes the steps to program on-chip and external Flash memory on the target hardware.
  • Clock Measurement shows how to measure CPU clock frequency with ULINKplus.
  • Trace explains the trace functionalities available with ULINKplus.

The table below summarizes the features available directly over JTAG/SWD and over SWD+SWV (trace enabled) connections.

Interface | Feature | Description
JTAG/SWD | Flash download Application debug Clock measurement Component Viewer Event Recorder | Transfer the application into the target's non-volatile memory. Run the program on the target device. Verify the clock frequency settings. Displays information on software components and other objects. Observe events and timing information of software components.
SWD+SWV | System Analyzer Logic Analyzer Event counters Exceptions and interrupts Data trace ITM trace | Graphical analysis tool for clock, power, exceptions, and variable changes. Graphical analysis tool that shows value changes of variables or VTREGs. Watch cumulative numbers of various events. Display statistical data about the traced exceptions and interrupts. Show the history of executed instructions. Enable printf style debugging using the ITM stimulus port 0.


ULINKplus User's Guide: Debug Script Template

Debug Script Template

The µVision debugger allows you to construct and execute a sequence of debugger commands using a script file. Using the ULINKplus VTREG IO pins, you can create and run your own test scripts to generate external signal patterns for testing your target board and application.

The Debug_UlinkPlus.ini initialization file may be used as a template to help you get started creating your own test automation scripts. This is an executable debugger script file that:

  • Includes a Configuration Wizard script to manually configure the ULINKplus IO test pins.
  • Contains several debug functions demonstrating how to create digital signals and analog voltage patterns.
  • Creates a Toolbox for easy test execution from the debugger.

The template file is located on your installation drive at [installation_path]\ARM\ULINK\Template\. The default [installation_path] is C:\Keil_V5.

The debug functions in the template are simple examples of how to manipulate the IO pins to create digital and analog signals. Click a button on the Toolbox to run an example. Here is a brief description of each example function:

Toolbox button | Description
5x Toggle pin #1 | Toggles pin 1 five times with a 100 ms wait after changing the state of the pin.
TableOut 250 ms | Creates four signals using pins 0, 1 and 2 with a 250 ms wait between signal changes.
TableSweep 500 ms | Generates an analog sweep of fixed voltages from 0.0 to 3.0 volts on pin 7 with a 500 ms delay between voltage changes.
StepSweep 100 ms | Generates an analog sweep from 0.0 to 3.3 volts on pin 7 increasing the voltage 0.5 volts every 100 ms.

As an example, take a look at the code of the TogglePin function:

FUNC void TogglePin (uint32_t pin, uint32_t interval, uint32_t count) {
  uint32_t i;

  printf ("%d times toggle pin %d @ state time %d mSec  \n", count, pin, interval);

  for (i = 0; i < count; i++)  {
    ULINK_OUT |= (1 << pin);
    _sleep_ (interval);
    ULINK_OUT &= ~(1 << pin);
    _sleep_ (interval);
  }
  printf ("TogglePin done...\n");
}

Note

  • Please make sure you configure the pins used by a function prior to running the function.


ULINKplus User's Guide: Trace Data Not Synchronized

Trace Data Not Synchronized

Trace Data Not Synchronized offers solutions for the event that wrong or no data are displayed in µVision Windows.

The Trace Status delivers useful information about the status of capturing trace data. When either of the error message is displayed, follow the corrective checks:

  1. Is the Core Clock set equal to the frequency of the system clock? Refer to Trace Settings.
  2. Did the system clock change its value after RESET, and, as a consequence, the Core Clock value is not set correctly?.
  3. Is Trace enabled? Refer to Trace Settings.
  4. Is the Max Clock for the debug Port set too high?


ULINKplus User's Guide: Event Recorder

Event Recorder

The Event Recorder shows execution status and event information, and helps to analyze the operation of software components.

The Event Recorder:

  • Increases the visibility to the dynamic execution of application program.
  • Provides filter capabilities for event types (Errors, API Calls, Operation, Details).
  • Allows unrestricted calls to Event Recorder functions from Threads, RTOS kernel, and ISRs.
  • Implements recording functions that do not disable ISR on ARMv7M (Cortex-M3, Cortex-M4, Cortex-M7).
  • Supplies fast time-deterministic execution of Event Recorder functions with minimal code and timing overhead. Thus, event annotations can remain in production code without the need to create a debug or release build.

Analysis Window Button Open the Event Recorder from View – Analysis Windows - Event Recorder.

Event Recorder Window

For more information, refer to the Event Recorder documentation.


ULINKplus User's Guide: Error Messages

Error Messages

This list identifies errors that might occur when using ULINKplus. If you are experiencing difficulties, contact our support group.

ULINKplus

No ULINKplus firmware found
Communication is lost or ULINKplus is not working. Unplug ULINKplus from the USB port and plug it back in.
Firmware Download Failed
ULINKplus firmware cannot be downloaded. Use the firmware download tool available at C:\Keil_v5\ARM\ULINK to update the firmware manually.
No ULINKplus device found
No ULINKplus detected. ULINKplus is not connected to the USB port, or the USB driver is not installed properly, or ULINKplus is not working properly. Reconnect or connect ULINKplus to the USB port of the PC.
No ULINKplus is selected
No ULINKplus adapter has been selected for debugging. Occurs when more ULINKplus adapters have been detected, but none has been selected. Select one ULINKplus from the Serial No drop-down list in the Target Driver Setup dialog. Use Options for Target - Debug - Settings.
ULINKplus Communication Timeout
Communication is lost or corrupted. Unplug ULINKplus from the USB port and plug it back in.
USB Communication Failure
USB communication is lost or corrupted. Unplug ULINKplus from the USB port and plug it back in.
Parameter Error
Internal driver error. Please report it to our support group.

RDDI-DAP errors

RDDI-DAP errors indicate that the serial wire debug connection is corrupted. Typically, they are indicated by the following messages:

Serial Wire RDDI-DAP Error

RDDI-DAP errors can be caused by:

  • an unpowered target (check the target's power supply)
  • a missing physical connection to the target (check your 10-pin Arm Cortex cable)
  • a maximum JTAG/SW clock that is set too high (lower the Max Clock frequency in the Target Driver Setup - Debug dialog)
  • a device in deep-sleep mode

JTAG errors

JTAG errors indicate that the JTAG communication is corrupted or that the device chain is not set up correctly. They are indicated by the following messages:

JTAG Chain Error

JTAG errors can be caused by:

  • an unpowered target (check the target's power supply)
  • a missing physical connection to the target (check your 10-pin Arm Cortex cable)
  • a maximum JTAG/SW clock that is set too high (lower the Max Clock frequency in the Target Driver Setup - Debug dialog)
  • a device in deep-sleep mode
  • devices on that JTAG chain not meeting the requirements, or an improperly configured chain when chaining multiple targets.

Problems entering Debug mode

If not configured properly, you might face issues to enter the debug mode or to download an image to the target's Flash memory. This is indicated by the following messages:

Cannot access target

Cannot access memory

Flash Memory Time Out

Could not load file

These errors can be caused by:

  • an unpowered target (check the target's power supply)
  • a missing physical connection to the target (check your 10-pin Arm Cortex cable)
  • a device in deep-sleep mode
  • connecting to the wrong device. If you have multiple ULINKplus debug adapters in your system (connected to different target devices), check that you are accessing the right one. Select the ULINKplus -JTAG/SW Adapter in the Target Driver Setup - Debug dialog. Attention: selecting "Any" will select the first device ULINKplus in the list.

Other Debug Errors

Cannot enter Debug Mode
Debug Interface on the target cannot be accessed. The target debug interface is not working properly. Mainly caused by target problems: debug block not powered or clocked properly. Avoid Deep-Sleep modes while debugging. Lower the Max Clock frequency in the Target Driver Setup - Debug dialog.
Could not stop Cortex-M device
The debugger tries to stop the target. This attempt can be made after initializing the connection, or while resetting the target, or through a stop/step command while debugging. In some cases, the target's debug block not functioning properly raises this error. This Knowledgebase Article details some other possible conditions which could cause this error.
Device could not be powered up
Debug block on the device could not be powered. Debug block on the target is not working properly. Mainly caused by target problems: debug block not powered and clocked properly.
Memory Mismatch
Memory mismatch detected while downloading the code to target. Appears when the option Verify Code Download is enabled and when a debugging session is started. Then the code in the target is compared against the load image. The message is raised when the target's Flash was not programmed with the code being debugged. Download the program to Flash.
Could not stop ARM device
The debugger tries to stop the target. This attempt can be made after initializing the connection, or while resetting the target, or through a stop/step command while debugging. In some cases, the target's debug block not functioning properly raises this error.

Breakpoints and watchpoints

It was not possible to disable all breakpoints
Occurs when breakpoints cannot be disabled while the target is running. Stop the target to perform this operation.
Operation not possible while target device is executing
This operation is not possible or failed while the target is running. Occurs in situations where breakpoints cannot be enabled or disabled while the target is running.
This target device does not support all the defined breakpoints
Too many breakpoints have been defined. Reduce the number of breakpoints.
This target device does not support all the defined watchpoints
Too many watchpoints have been defined. Reduce the number of watchpoints.
This target device does not support conditional breakpoints
Remove all conditional breakpoints.
This target device supports only the following watchpoints:
size = 2^n; n = 0..15
start must be 2^n aligned
with optional value match
Change the watchpoint definition.
It was not possible to kill all breakpoints
Usually occurs when breakpoints cannot be killed while the target is running. Stop the target to perform this operation.


ULINKplus User's Guide: Hardware Description

Hardware Description

The ULINKplus debug adapter has a status indicator and a number of connectors to support the debug, test, and power measurement capabilities.

Connectors

ULINKplus - Back

  • USB: high-speed USB 2.0 Micro-B connector powers the ULINKplus adapter and transfers data between the PC.
  • JTAG/SWD: connects to the Cortex CoreSight debug logic and provides 1 kV isolation to the target.
  • Power: connects to the supply volatage line for power measurement. Provides a separate 1 kV isolation to the target hardware.
  • I/O: connects to external equipment for controlling test automation via the debugger.


ULINKplus User's Guide: Power Interface

Power Interface

The 3-pin Power connector (with a 2.54 mm pitch) connects to the power supply circuit of the target system as shown on schematic figure.

The current range with the ULINKplus-internal shunt resistor is +/- 2.5mA. This range can be extended using external shunt resistors.

ULINKplus comes with six shunt boards (5 mA, 10 mA, 25 mA, 50 mA, 100 mA or 250 mA) that adjust the maximum current range to be measured.

The table below lists the technical parameters of the internal and external shunt resistors.

Current range (mA) | Power (Watts) | Resolution | Shunt (Ω) | Tolerance (%) | TCR (±ppm/oC)
2.5 | 0.25 | 200nA | 100 (internal) | 0.1 | 25
5 | 0.1 | 400nA | 100 (external) | 0.1 | 25
10 | 0.1 | 800nA | 33.2 (external) | 0.1 | 25
25 | 0.125 | 1.8µA | 11 (external) | 1 | 100
50 | 0.25 | 3.5µA | 5.23 (external) | 1 | 100
100 | 0.25 | 7.0µA | 2.55 (external) | 1 | 200
250 | 0.25 | 15.0µA | 1 (external) | 1 | 200

Note:

  • It is also possible to use custom shunt resistors. Please refer to the Power Measurement Setup for details on the shunt configuration.

The Power Measurement page explains how to use this interface to record and analyze the power consumption.


ULINKplus User's Guide: I/O Interface

I/O Interface

The ULINKplus adapter has an 11-pin connector that can be used to monitor and control digital and analog signals on the target. The figure below provides schematics of this interface:

I/O test Schematic

The pin pitch is 2.54 mm.

I/O pin assignment and technical characteristics

The I/O pins on the connector may be used as follows:

Pin Name | Function | VTREG
GND (1) | Ground for general purpose I/O pins | N/A
+3.3V (2) | Power for external circuits (switchable) | ULINK_3V3
0 | Digital input/output | ULINK_IN / ULINK_OUT (bit 0)
1 | Digital input/output | ULINK_IN / ULINK_OUT (bit 1)
2 | Digital input/output | ULINK_IN / ULINK_OUT (bit 2)
3 | Digital input/output | ULINK_IN / ULINK_OUT (bit 3)
4 | Digital input/output; Analog input | ULINK_IN / ULINK_OUT (bit 4); ULINK_AIN4
5 | Digital input/output; Analog input | ULINK_IN / ULINK_OUT (bit 5); ULINK_AIN5
6 | Digital input/output; Analog input | ULINK_IN / ULINK_OUT (bit 6); ULINK_AIN6
7 | Digital input/output; Analog input/output | ULINK_IN / ULINK_OUT (bit 7); ULINK_AIN7 / ULINK_AOUT7
8 | Digital input/output | ULINK_IN / ULINK_OUT (bit 8)

(1) It is important to have the Test I/O GND connected to the target as the ULINKplus I/O, JTAG/SWD, and Power interfaces are fully isolated from each other and GND pins on this interfaces are not identical.

(2) The switchable +3.3V pin can deliver up to 10 mA current.

The digital I/O pins have following characteristics:
  • 5V tolerance
  • Input Low: < 1.0V
  • Input High: >2.3V
  • Output Low: <0.4V @ 6mA
  • Output High: >2.9V @ -6mA
  • High-level short-circuit current (drive High; connected to GND): <10mA
  • Low-level short-circuit current (drive Low; connected to 3.3V): <10mA


ULINKplus User's Guide: Introduction

Introduction

ULINKplus is an innovative debug and trace adapter that connects to any Arm Cortex-based device. It equips developers with following features:

  • Debug and Trace via isolated JTAG/Serial-Wire-Debug (SWD) connector.
  • Power Measurement via isolated Power interface. It is synchronized to event tracing making it easier to optimize the energy efficiency of a system.
  • Digital and analog I/O pins accessible from debug views or from debug scripts. This enables you to interact with the target under test or to control automated test stands.
See Kit Contents section for details on the content of the ULINKplus package.
Section Hardware Description gives an overview of the ULINKplus HW interfaces and provides technical characteristics.

The table below summarizes features available via particular ULINKplus interfaces.

Interface | Feature | Description
JTAG/SWD | Flash download Application debug Clock measurement Component Viewer Event Recorder | Transfer the application into the target's non-volatile memory. Run the program on the target device. Verify the clock frequency settings. Displays information on software components and other objects. Observe events and timing information of software components.
SWD+SWV | System Analyzer Logic Analyzer Event counters Exceptions and interrupts Data trace ITM trace | Graphical analysis tool for clock, power, exceptions, and variable changes. Graphical analysis tool that shows value changes of variables or VTREGs. Watch cumulative numbers of various events. Display statistical data about the traced exceptions and interrupts. Show the history of executed instructions. Enable printf style debugging using the ITM stimulus port 0.
Power | Current and voltage measurement | Optimize the energy efficiency of your design.
I/O | Test automation | Run continuous integration and nightly build tests.

Requirements

Use ULINKplus with MDK v5.25, or higher.

Supported devices

ULINKplus supports Arm Cortex-A, Cortex-M, and heterogeneous devices equipped with a CoreSight debug unit. Refer to the device database for a complete list.


ULINKplus User's Guide: JTAG/SWD Interface

JTAG/SWD Interface

The ULINKplus supports an isolated JTAG/SWD interface using a low-cost 10-pin (0.05") connector.

Technical characteristics

Interface | Description
JTAG/SWD | Voltage range: 1.2 V .. 5.5 V Clock speed: configurable up to 10 MHz SWO trace capturing: data rate up to 50 Mbit/s (UART/NRZ Mode) Isolation: 1 kV Supports hot-plugging to a running target

Interface Schematic

The target interface schematic shows the JTAG and Serial Wire interface circuits of ULINKplus. All pins are 1kV isolated and support hot-plugging while the target is running.

Use this schematic to help with board design, and for analyzing and debugging your target hardware.

ULINKplus Interface Diagram

JTAG/SWD Connector

The 10-pin, 0.05" JTAG/SWD connector offers ITM and DWT trace information. In SWD mode, two pins are used for debugging: one bi-directional pin (SWDIO) transfers the information and the second pin (SWDCLK) clocks the data. A third pin (SWO) delivers the trace data at minimum system cost. The Serial Wire and JTAG pins are shared.

10-pin JTAG/SWD Connector Pin Layout of 10-pin JTAG/SWD Connector

Note

  • KEY (position 7) has no pin and serves only as a key to properly orient the connector.
  • VCC (pin 1) provides the supply voltage for the JTAG/SWD I/O driver and is required as ULINKplus has isolated connection.
  • The 10-pin connector is a Samtec 10-pin: FTSH-105-01-L-DV-007-K connector with pin 7 removed. It's dimensions are: 0.25" x 0.188" (6.35mm x 4.78mm).

JTAG and Serial Wire Signals

Because the 10-pin JTAG/SWD connector supports both JTAG and Serial Wire signals, you can configure the debugger for either JTAG or Serial Wire mode to suit your Cortex device.

JTAG Signals

Signal | Connects to...
TMS | Test Mode State pin -- Use 100K Ohm pull-up resistor to VCC.
TDO | Test Data Out pin.
TDI | Test Data In pin -- Use 100K Ohm pull-up resistor to VCC.
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.

Serial Wire Signals

The Serial Wire mode differs to JTAG debugging, because only two pins are used for the communication. A third pin can be used 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)
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.

Note

  • 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.


ULINKplus User's Guide: Kit Contents

Kit Contents

The ULINKplus kit includes:

  • 1 x ULINKplus USB-JTAG adapter.
  • 1 x USB A/MicroB cable.
  • 1 x 10-pin ribbon cable for connecting to target hardware using the Cortex debug connector.
  • 1 x ULINK SWD adapter for STM32 development boards.
  • 14 x jumper wires for power measurement and I/O test connections.
  • 6 x power measurement shunts (5 mA, 10 mA, 25 mA, 50 mA, 100 mA and 250 mA).

ULINKplus Adapter Kit


ULINKplus User's Guide: Power Measurement

Power Measurement

The ULINKplus adapter equips developers with advanced power measurement capabilities over the isolated 3-pin Power connector.

ULINKplus quick start guide provides a video overview on how to use ULINKplus for power measurement.

Power Measurement Connection

This chapter describes ULINKplus power measurement in details:

  • Power Interface provides connector schematics and technical parameters of the internal and external shunt resistors.
  • Power Measurement Setup shows how to connect a target system to the ULINKplus and properly configure it for power measurement.
  • Measurement Modes explains the different debug modes in µVision that can be used to measure power.
  • Analyzing Power Consumption describes how to use µVision's System Analyzer and Event Statistics windows for power analysis.


ULINKplus User's Guide: Measurement Modes

Measurement Modes

Optimizing embedded applications for overall efficiency should be an integral part of the development process as it is important to understand how peripherals, software algorithms, and power saving modes work together.

While measuring power with debug has benefits, the Arm CoreSight™ debug logic makes measuring deep sleep modes impossible. Therefore, µVision supports energy measurement in two ways:

Debug Energy measurement with debug allows you to:

  • observe power consumption profile synchronized with the trace data and program events
  • have full debug control over the program execution
  • obtain aggregated measurement data using Event Statistics.

Debug Energy Measurement without debug:

  • has no impact of the debug connection on the measurement results.
  • enables consumption measurement in deep sleep states.
  • can be done on any target and without source code required.


ULINKplus User's Guide: Power Measurement Setup

Power Measurement Setup

After ULINKplus is selected as target debug adapter in the µVision project you can configure the ULINKplus for power measurement. This can be done in three different ways:

  • During the debug session by using the ULINKplus dialog.
  • With debug commands that access ULINKplus VTREGs.
  • With a debug initialization script.

Configuring power measurement in ULINKplus window

In the debug mode, open the ULINKplus dialog from menu View - Analysis Windows - ULINKplus.

Power Dialog The Power section shows these values:

  • Shunt R - external shunt resistor in Ohms (see Note below)
  • Voltage - measured voltage in Volts
  • Current - measured current in Amperes
  • Power - calculated power in Watts
  • Average Current - measured average current in Amperes
  • Charge (Q) consumed - measured total charge in mAs
  • Time measured - total time measured in Seconds
  • Current offset - calibration current in Amperes (refer to Offset calibration for current)
  • Enable - enable or disable power measurement capture.

Note:

  • Shunt R shows the value of the external shunt. If no external shunt is specified (the default), a value of '0' will be shown.

ULINKplus comes with a set of six boards for external shunts. Please refer to the following table for the resistor values:

Current range (mA) | External shunt in (Ω) | ULINK_SHUNT value
2.5 | N/A | 0
5 | 100 | 100
10 | 33.2 | 33.2
25 | 11 | 11
50 | 5.23 | 5.23
100 | 2.55 | 2.55
250 | 1 | 1

Configuring power measurement using command window

µVision has a set of Virtual Simulation Registers (VTREGs) for power measurement settings and values. These VTREGs can be accessed at run-time during debug session from µVision Command Window. For example:

Power measurement VTREGS

The table below describes the ULINKplus power measurement Virtual Simulation Registers (VTREGs):

VTREG | Type | Description
ULINK_PM | integer | Enable or disable power measurement capture. 1=Enable, 0=Disable
ULINK_SHUNT | float | Set or return the external shunt resistor value in Ohm
ULINK_U | float | Return the last measured voltage value in Volt (V)
ULINK_I | float | Return the last measured current value in Ampere (A)
ULINK_I_OFFSET | float | Set or return the offset value in Ampere (A) used as zero point reference for the current measurement. The default value is 0.
ULINK_I_AVG | float | Return average current in Ampere (A) drawn during program execution.
ULINK_Q | float | Return total charge in Ampere Seconds (As) consumed during program execution.
ULINK_I_TIME | float | Return program execution time that was used for the calculation of ULINK_I_AVG and ULINK_Q.

See µVision documentation for additional details on Virtual Simulation Registers (VTREGs).

Configuring power measurement using debug script

The µVision debugger allows you to construct and execute a sequence of debugger commands using an initialization script.

For ULINKplus configuration the Debug_UlinkPlus.ini initialization file can be used as a template for such script. It is located at [MDK installation_path]\ARM\ULINK\Template\ and best should be copied in the project directory for editing. The default [MDK installation_path] is C:\Keil_V5.

The path to such *.ini file should be provided in the debug configuration dialog:

Debug Initialization File

In this script, you can assign target values to the ULINKplus VTREGs and hence get the ULINKplus automatically configured right before the debug session start or prior to energy measurement without debug.

The file is already annotated with Configuration Wizard support, enabling GUI-like configuration for enabling power measurement and selecting the external shunt values.

Debug Initialization File

The Debug_UlinkPlus.ini template also annotates I/O pin configuration and provides function examples.

For more information on debug scripts, see Command input from file.

Offset calibration for current

For a precise measurement of very small currents, the bias offset of ULINKplus needs calibration. This offset differs, based on the shunt resistors. The VTREG ULINK_I_OFFSET contains the offset adjustment after calibration.

Capture the current offset

The following steps describe how to adjust the current offset:

  1. Disconnect the target hardware from the shunt resistor.
  2. Enter the Energy measurement without debug mode and run the program.
  3. In the System Analyzer window, right-click into the Current line and select Zero Point Adjustment (from visible area) to set the offset automatically. Note the number that is shown in the menu entry as this needs to be used in consecutive runs:

    Zero Point Adjustment

  4. Leave the energy measurement session and open the Debug_UlinkPlus.ini file. In the following section, enter the value that you have just determined:
    /*------- Zero point reference for ULINKplus I/O current measurement-----------*/
/* Example: for a 3.5 uA offset, specify -3.5e-006                             */
ULINK_I_OFFSET = -3.4602e-006;

When starting a new energy measurement or debug session, the offset value will be taken into account.

Note:

To remove the offset, specify a negative number.


ULINKplus User's Guide: Status LED

Status LED

The multi-color LED on front side informs about the ULINKplus operation status. When connecting ULINKplus to USB the LED changes from Orange, to Red (400 ms), to Green (400 ms) and finally to Blue. This indicates a successful USB connection.

ULINKplus - Front

The following table describes the LED status colors:

LED Color | Description
none | ULINKplus firmware is not running -- not connected over USB or in DFU mode
Orange | ULINKplus is connected but not yet enumerated or enumeration failed
Blue | ULINKplus is connected and enumerated -- the debugger is not connected
Red | The debugger is connected, and the target is stopped
Green | The debugger is connected, and the target is running


ULINKplus User's Guide: Connect to Target

Connect to Target

To connect ULINKplus with the target hardware and PC:

  1. Using the 10-pin cable connect the ULINKplus JTAG/SWD interace to the corresponding connector on the target. If necessary, use the ULINK SWD adapter.
  2. Plug the USB cable into the PC and into the ULINKplus's USB connector.

Note

  • The red stripe on the cable marks pin 1.

Start Sequence

ULINKplus performs a start sequence prior to start debugging on target systems. The start sequence depends on the device type and the settings in µVision.

For Cortex devices, ULINKplus:

  1. Initializes the JTAG or Serial Wire interface, detects the Chip ID and acquires control of the CPU debug logic. The HW RESET signal may be activated and depends on the Connect option selected in Options for Target — Debug — Settings.
  2. Stops the device.
  3. Performs a reset as defined in Options for Target — Debug — Settings, if Reset after Connect is enabled.
  4. Performs a Reset Sequence and downloads the code to the target if Options for Target — Debug — Load Application at Startup is enabled.
  5. Executes debug commands defined in the file specified in Options for Target — Debug — Initialization File.

Reset Sequence

ULINKplus' reset sequence is device-specific. To reset the device, ULINKplus asserts the JTAG/SWD RESET signal (pin 10 [nRESET] on JTAG/SWD connector) to stop the device.

Hot Plug Connections to a Target

Because the JTAG/SWD and I/O pins are 1kV isolated, you may connect and disconnect (hot plug) your ULINKplus to an un-powered, powered or running target board without affecting the board's operation. With this powerful feature, if you observe an intermittent or unexpected problem, you can connect ULINKplus to the target board and start a debug session to examine and isolate problems while the problem is happening.

To take advantage of the hot plug feature, your debug session must load the application program without disturbing the target or preventing the debugger from resetting the target when it starts. To accomplish this, create a "hot plug debug" copy of your debug target by making the following changes:

  • Disable Load Application at Startup.
  • Disable Reset after Connect.
  • Disable Update Target before Debugging.
  • Add the following debug command to your Debug Initialization File:
    LOAD %L INCREMENTAL;

This "hot plug debug" target is now ready to use whenever a problem occurs.

For more detail regarding these steps see Connecting to a Running Target.


ULINKplus User's Guide: Application Debug

Application Debug

Start/Stop Debug Button Debug - Start/Stop Debug Session after you have built and downloaded the application to Flash.

µVision switches to the Debug Mode screens.

Target Download Progress

If ULINKplus has been configured for tracing, then you can analyze captured data with the listed µVision Windows.

Note

  • ULINKplus automatically detects the debug features of the target system core. It reads the CPU ID and checks which core debug peripherals are present. With this information ULINKplus is able to determine:
    • The number of Flash breakpoints.
    • The number of watchpoints.
    • The possible use of ITM and TPIU.

See also

  • Configure the Debugger prior to start debugging.
  • Refer to Debugging and start debugging in the µVision User's Guide for more details.


ULINKplus User's Guide: Flash Download

Flash Download

There is more than one way to download the application into the target's Flash memory. It is also possible to download multiple images using a pre-download script. This is important for multi-core devices or if program objects are required in addition to the user application.

Using the download button

Download to Flash Button Flash - Download the application to target after you have built your application. The Status Bar shows the download progress.

Target Download Progress

The download result is displayed in the Build Output window.

Target Download Status

Continue debugging the application code in Flash ROM or in RAM of the target board.

Automatic download when entering debug

In the Options for Target dialog, you can enable Update Target before Debugging to download the application to Flash whenever a new debugging session is started. The download is processed only when the binary was updated since the last Flash programming step.

Update Target before Debugging

Flash download from the command line

Flash memory can be programmed from the command line or from a batch file. Refer to Program Flash Example for more information.

See also

  • Configure Flash Download before downloading the application to target.
  • Refer to Flash Programming in the µVision User's Guide for details.


ULINKplus User's Guide: Install USB Driver

Install USB Driver

Windows 8 and 10

ULINKplus uses a specific Keil USB driver, which is included with the MDK product download. If you have MDK installed, Windows 8/10 will find and use the required drivers automatically. Please wait, until the installation process has ended. When finished, multiple devices named "ULINKplus" are available in device manager:

Windows Device Manager entries for ULINKplus

Windows 7

For Windows 7, when you first connect ULINKplus, Windows 7 detects the new hardware and displays the following dialog:

Would you like to install device software?

Click the Install button to install the ULINKplus device support on your computer.

When the installation is complete, the following dialog displays:

Device is ready to use

If installation issues arise, perform these steps:

  1. Open the Windows Device Manager (you may use devmgmt.msc in the command prompt).
  2. Expand Universal Serial Bus devices. Four ULINKplus devices should display.

  3. Right click any ULINKplus device name and select Update Driver Software...

Note

  • Administrator rights are needed to install the driver software.
  • Subsequent connections to ULINKplus do not require new driver installations.


ULINKplus User's Guide: Configure Flash Download

Configure Flash Download

Flash programming using ULINKplus can be configured in the Button Options for Target Options for Target - Utilities dialog. Available configuration options are explained in Flash Programming section in µVision User's Guide.

Select Target Driver


ULINKplus User's Guide: Firmware Update

Firmware Update

The first time you connect to ULINKplus (for Flash downloading, debugging or setting up the debugger), you may receive the following message explaining that ULINKplus firmware should be updated. Your ULINKplus may be installed with either V1.x.x or V2.x.x firmware. The dialog that displays is slightly different for V1.x.x and V2.x.x:

V1.x.x Firmware

ULINKplus V1 Firmware Update Dialog

Click OK to update from V1.x.x firmware to V2.x.x firmware and complete the connection to ULINKplus.

  • If you do not allow the update, the ULINKplus Flash download or debug session terminates. To use the V1.x.x version of the firmware, in Options for Target - Debug, you must change the debug target driver to CMSIS-DAP Debugger. The download or debug session will then run, but without the full features of ULINKplus.

V2.x.x Firmware

ULINKplus V2 Firmware Update Dialog

Click OK to update your V2.x.x firmware and complete the connection to ULINKplus.

Manual Update

The ULINKplus adapter may also be manually re-programmed for use with other CMSIS-DAP V1.1 compliant debuggers such as DS-5.

Downloading Firmware to ULINKplus

When you install the MDK tools, the ULINKplus_FW_Downloader.exe program is automatically installed on your local drive along with the latest ULINKplus firmware (.BIN) download files.

To manually download firmware to your ULINKplus adapter:

  1. Connect your ULINKplus to the USB connector on your PC.
  2. Browse to the [installation_path]\ARM\ULINK\Utilities\ where the default [installation_path] is C:\Keil_V5\.
  3. Double-click the ULINKplus_FW_Downloader.exe file to load the program.
  4. Select the ULINKplus SN Lxxxxxxxxx from the Device drop down list. The ULINKplus Serial Number, Boot version and Firmware version currently installed in the ULINKplus adapter display.
    ULINKplus Firmware Download Dialog
  5. Click the browse button to the right of the Image: text box and select either:
    ULINKplusFW_V1_x_x.bin
    For use with the DS-5 debugger (CMSIS-DAP V1 compliant)
    ULINKplusFW_V2_x_x.bin
    For use with the full-featured, µVision debugger
  6. Click Open, then click the Download button to start the download. When finished, Download succeeded! displays below the progress bar.
    ULINKplus Firmware Download Succeeded


ULINKplus User's Guide: ULINK SWD Adapter

ULINK SWD Adapter

Many STM32 development boards do not have standard 10-pin Cortex Debug Connector. For such cases, the ULINKplus kit also includes an adapter for the 6-pin SWD interface which is frequently present on STM32 development boards. The figure below shows the adapter.

ULINK SWD adapter front and back view

Connecting to the target board

To use the ULINK SWD adapter with the target board:

  • Connect the 10-pin cable to the ULINKplus JTAG/SWD interface.
  • Attach the other side of the cable to the 10-pin Cortex debug connector on the top of the SWD adapter. Due to the connector form factor, only one correct position is possible.
  • Connect the SWD adapter to the 6-pin SWD port on the target board. Note that the VCC pin of the SWD adapter shall connect to the pin 1 of the SWD on-board port.
  • The ST-LINK jumpers on the development board must be present (ON).
  • On some development boards, pin 1 of the SWD port is not VCC. In such cases, find a VCC (or VDD) pin on the development board and use one of the jumper wires to connect it to the standalone VCC pin located next to the Cortex Debug port on the SWD adapter front. The connection is required to supply voltage to the SWD I/O driver as ULINKplus has isolated connection.
  • Now you can use ULINKplus to program and debug an application on the target device. Refer to the Debug chapter for details.

Pinout

The table below explains the SWD adapter pins in details. The Cortex debug connector is explained in the JTAG/SWD interface

Signal | Description
VCC | Positive Supply Voltage -- Power supply for JTAG interface drivers.
SWCLK | Clock pin
GND | Digital ground.
SWDIO | Data I/O pin.
NRST | Reset input -- Connect this pin to the (active low) reset input of the target CPU.
SWO | Optional trace output pin.


ULINKplus User's Guide: Technical Characteristics

Technical Characteristics

The following table is an overview of the technical characteristics. Refer to Hardware description for further details on the specific ULINKplus interfaces.

Interface | Description
USB | USB 2.0 high-speed Provides power supply for ULINKplus
JTAG/SWD | Voltage range: 1.2 V .. 5.5 V Clock speed: configurable up to 10 MHz SWO trace capturing: data rate up to 50 Mbit/s (UART/NRZ Mode) Isolation: 1 kV Supports hot-plugging to a running target
Power | Sample rate: 20 MSPS (16-bit delta-sigma technology) Input bandwidth (BW): 1 MHz Configurable digital low-pass filters: 160, 80, 40, 20, 10 and 5 kHz Input voltage range: +/- 6.0 V - Precision: +/- 2% - Resolution: 0.6mV Input current range (with internal shunt resistor): +/- 2.5mA - Precision: +/- 2% - Resolution: 200nA Current range is extended using external shunt resistors Isolation: 1 kV
I/O | 9 configurable I/O pins support: - Up to 9 digital I/O pins - Up to 4 analog input pins (3 if analog output is required) - 1 analog output pin (reconfigures 1 analog input pin) Additional +3.3 V supply voltage (10mA) switchable


ULINKplus User's Guide: Trace Data

Trace Data

The Trace Data Window shows the history of the executed instructions.

Instruction Trace button Open the window from the toolbar or with the menu View – Trace - Trace Data. When using the Simulator, enable the flag View – Trace - Enable Trace Recording.

Trace Data Window


ULINKplus User's Guide: Event Counters

Event Counters

The Event Counters window displays cumulative numbers, which show how often an event triggered.

Trace Button Open the Event Counters window from View - Trace - Event Counters.

To display data in this window:

  • Enable Trace.
  • Enable the event counters dynamically in the window. (It is identical to enabling the counters in Trace Events.)

Event Counters Window

For more information, refer to the Event Counters documentation.


ULINKplus User's Guide: Event Statistics

Event Statistics

Event Statistics show collected data about execution time, number of calls, and (when using ULINKplus) the energy consumption for each execution slot.

Event Statistics Button Open the Event Statistics from the toolbar or via the menu View - Analysis Windows - Event Statistics.

Event Statistics Window

For more information, refer to the Event Statistics documentation.


ULINKplus User's Guide: Trace Exceptions

Trace Exceptions

The Trace Exceptions window displays statistical data about the traced exceptions and interrupts.

Trace Button Open the Trace Exceptions window from View - Trace - Trace Exceptions.

To display data in this window:

  • Enable Trace outside this window.
  • Enable EXCTRC: Exception Tracing. (It is identical to setting the option in Trace Events.)
  • Enable Timestamps Enable. (Is identical to setting the option in Timestamps.)

Exception Trace Records Window

Refer to Trace Exceptions documentation for more information.


ULINKplus User's Guide: Debug (printf) Viewer

Debug (printf) Viewer

The Debug (printf) Viewer window displays data streams that are transmitted sequentially via ITM Stimulus Port 0.

Debug (printf) Viewer Button Open the Debug (printf) Viewer from View - Serial Windows - Debug (printf) Viewer.

Debug (printf) Viewer

Note

  • For more information, refer to the Debug (printf) Viewer documentation.
  • Learn how to set up the debug session for SWO trace.
  • More ITM data can be monitored in the Trace Data Window.


ULINKplus User's Guide: System Analyzer

System Analyzer

The System Analyzer is a graphical analysis tool that shows:

  • power measurement data and clock frequency information from ULINKplus.
  • thread, interrupt, and exception execution over time.
  • Event Recorder messages.
  • value changes of variables or VTREGs.

System Analyzer can be used with any Arm Cortex-M based device that provides trace.

Logic Analyzer Button Open the System Analyzer from the toolbar or via the menu View - Analysis Windows - System Analyzer.

System Analyzer Window

System Analyzer window display

For more information, refer to the System Analyzer documentation.


ULINKplus User's Guide: Trace Status

Trace Status

The µVision Status Bar displays trace status messages whenever tracing has been enabled. Additional information is available in the general description of the Status Bar for CPUs that have enabled TrustZone for Armv8-M.

Trace Status Bar

The trace status:

  • Displays progress and error messages when the target processor is running.
  • Refreshes the Running... message every 3 seconds during error-free operations.
  • Is blank, when tracing is stopped without an error.
  • Displays the error message in red when the target stopped with an error.
  • Keeps the error message displayed until tracing is restarted.
Trace Status | Description
Communication Error | An invalid communication has been detected. Incorrect clock settings or hardware problems cause this message. Applications that change the Core Clock in the main() program may throw this message when data are captured incorrectly. This error message disappears once the Core Clock has been adjusted to the system settings.
HW Buffer Overrun | The USB port cannot accept data at the speed the adapter is sending them. Turn off trace events you do not need, or skip PC Sampling.
SW Buffer Overrun | Internal SW buffer overrun on the PC. Adjust the SWO Clock Prescaler of the trace port or the Max Clock of the debug port.
No Synchronization | Synchronization packets are not received from the target. The trace hardware is either not connected or configured improperly. Check for the correct Core Clock value. Help can be found in Trace Settings.
Data Stream Error | Errors are detected in the Trace Data Stream. Check for the correct Core Clock value.
Data Overflow | The target system Trace Port was too busy, and not all trace packets could be transmitted. This happens when too many trace packets are captured. Decrease the number of trace events.
Running ... | The target system itself and tracing operations are running without errors.
<is blank> | The target stopped without throwing an error.

Note

  • To use Trace in your application before changing the clock setting, configure Trace with the startup (default) clock value then reconfigure Trace clock later (via dialog or by using the CORE_CLK VTreg directly from the command window or some custom load script).


ULINKplus User's Guide: Setup and Connectivity Guide

Setup and Connectivity Guide

Before you start testing your ULINKplus, please make sure that:

  • Only one ULINKplus is connected to your PC.
  • Windows 7/8/10 is running
  • ULINKplus is not connected to the target system.
  • If possible, use one of the Keil example projects together with a standard evaluation board.
  • Use a target system that is known to be functional.

Start Testing

  1. Depending on your target system and toolset, select one of the ULINKplus drivers:
    • ULINKplus Debugger or
    • CMSIS-DAP Debugger

  2. Click Settings.
  3. If the Serial Number and Firmware Version are shown, continue with the next step.
    If they are blank, continue with Hardware Checklist.
  4. Connect your target system to ULINKplus using the supplied ribbon cable. Ensure the red stripe of the ribbon cable is connected to pin 1 of the debug connector.
  5. Ensure to power ON the target system.
  6. If you see an ARM Device Name and IDCODE in the JTAG Device (or SW Device) list box, continue with the next step.

    If you see an error message, such as SWD Communication Failure or an empty JTAG Device Chain list, continue with Target Checklist.

  7. ULINKplus is communicating with your target system. If error messages occur during a flash download or in a debug session, refer to Error Messages.


ULINKplus User's Guide: Spikes on Core Clock

Spikes on Core Clock

If you see little spikes on the Core Clock line in the System Analyzer window, you should check if your board has an on-chip oscillator:

Periodic current spikes

On-chip oscillators can introduce noise that is captured by ULINKplus.


ULINKplus User's Guide: Current and voltage display problems

Current and voltage display problems

False display of current and voltage

The trace clock might not be set correctly, if your current and voltage graphs display the following (or similar recurring patterns):

Wrong current and voltage display

To enable a correct display, open the Trace tab of the Options for Target dialog and verify that the Core Clock matches the display in System Analyzer.

No display of current and voltage

A Windows problem might prevent to display current and voltage in the System Analyzer window. To resolve the issue, you need to remove the ULINKplus driver and add it again to your system.

In Windows, in the search box on the taskbar, type Device Manager, then select from the menu.

Once open, scroll down and expand the Universal Serial Bus devices. Right-click on ULINKplus Power Probe and select Uninstall device:

Wrong current and voltage display

The device will be removed. Open a Windows Explorer and browse to your µVision installation directory (usually C:\\Keil_v5). Browse to ARM/ULINK and double-click on InstallULINK.exe. Remove the probe, reattach to your PC, and it should work.


ULINKplus User's Guide: Exchange Procedure

Exchange Procedure

Depending on where you purchased ULINKplus, please contact your distributor and provide the following information:

  • The error code depicted through the steps described in this guide.
  • The serial number of ULINKplus located on the back side of the device.
  • Where and when you purchased your ULINKplus device. Invoice or order numbers are helpful.

Your distributor will contact you to agree on further steps based on the information provided.

Thank you! We appreciate your intensive investigation and detailed information.

Note

  • We do explicitly refer to our terms of guarantee!


ULINKplus User's Guide: Hardware Checklist

Hardware Checklist

  1. Disconnect all ULINKplus adapters from the PC and from your target system.
  2. Connect only one ULINKplus to the PC via USB. Do NOT use:
    • A USB hub.
    • USB cables longer than 2m(6.0 ft).
    • USB connections via docking stations or port extenders.
    • A battery-powered notebook PC. Connect your AC power adapter to the notebook PC.
  3. Is the Status LED blue? If not, try the following:
    • Exchange the USB cable with another one to ensure that the cable is not defective.
    • Try using a different USB port.
    • Try connecting ULINKplus to a different PC where MDK-ARM is installed.

    If the Status LED is orange, your ULINKplus is not enumerating and may be broken. If you have another ULINKplus, you can confirm the defect by comparing the behavior.

    Please proceed to Exchange Procedure and report code UPH1.

  4. Ensure that Keil ULINKplus is listed in the Windows Device Manager under USB-Controller. If the driver is not listed, then install the driver as described in Installing Drivers. If the installation fails, then contact the Keil Technical Support and report code UPH2.


ULINKplus User's Guide: Current spikes when debugging

Current spikes when debugging

During debugging, if you see current spikes that cannot be explained by the operation of your software, or unexpected current spikes in the System Analyzer window, you should check the SWD lines of your target hardware for pull-up resistors:

Periodic current spikes

The spikes are created when the debugger accesses the target via SWD every 60 milliseconds. If you are using the Energy Measurement without debug mode, you will see that the spikes are gone:

Periodic current spikes

Note

To get rid of the spikes during debug, you should consider to remove the pull-up resistors from the SWD lines.


ULINKplus User's Guide: Target Checklist

Target Checklist

If you are experiencing connectivity issues to your target device, try the following:

  1. Enable the SWJ checkbox.
  2. Select Port:SW.
  3. Select different Max Clock: frequencies (10MHz, 5MHz, 2MHz, 1MHz, 500kHz, 200kHz, 100kHz) from the drop-down list.

    After each new selection, check whether a device ID is shown in the SW Device list box.

    • If YES, then your ULINKplus is communicating with your target. Use this setting in your project.
    • Otherwise proceed with the next step.
  4. With the SWJ checkbox still enabled, select Port:JTAG and try out several Max Clock: frequency settings. After each new selection, check whether a device is shown in the JTAG Device Chain list box.
    • If YES, your ULINKplus is communicating with the target. Use this setting in your project.
    • Otherwise, proceed with Exchange Procedure and report code UPTC2.


ULINKplus User's Guide: Troubleshooting

Troubleshooting

Troubleshooting supplies hints for fixing issues that could occur with ULINKplus when debugging applications. We have summarized the most occurring questions and provided possible solutions:

  • Trace Data Not Synchronized shows solutions to synchronize communication between ULINKplus, µVision, and the target hardware.
  • Current spikes when debugging shows how pull-up resistors in the SWD lines can influence the current measurement.
  • Spikes on Core Clock explains how on-board oscillators can influence the measurement of the core clock frequency.
  • Capturing trace works no longer after a software RESET. Refer to TPIU Initialization after RESET (Cortex-M).

In case you have connectivity issues (to the ULINKplus or the target device), follow the in-depth instructions of the Setup and Connectivity Guide.


ULINKplus User's Guide: Clock Measurement

Clock Measurement

In the Trace tab, you need to set the correct clock frequency of your target. The debugger uses this setting for calculating timing for trace capturing and other displays, such as current and voltage. While this should be known from the settings that are used in the application, sometimes this can go wrong, due to complex clock setup with multiple PLL dividers on-chip. ULINKplus automatically checks the clock frequency of the running target using a simple JTAG/SWD connection. The measured clock frequency is shown in the System Analyzer window.

System Analyzer Button Open the System Analyzer from the toolbar or via the menu View - Analysis Windows - System Analyzer.

Clock measurement in the System Analyzer window

After the application properly programs the clocks, the correct core clock will be displayed.

Note

  • The clock measurement feature works on Arm Cortex-M3, Cortex-M4, Cortex-M7, and Cortex-M33 devices only.
  • Make sure that the displayed clock matches the Core Clock setting on the Trace tab in the Options for Target dialog.


ULINKplus User's Guide: Test Automation

Test Automation

The ULINKplus adapter includes an 11-pin connector providing 3.3 V supply, ground and nine I/O pins for digital and analog signals. These pins may be configured and used in concert with automated test scripts to:

  • measure or apply analog test signals to the target.
  • externally generate digital logic levels to trigger events on the target.
  • detect digital logic level changes from the target

ULINKplus I/O Interface

ULINKplus quick start guide provides a video overview on I/O monitoring and control with ULINKplus and debug scripts.

This chapter describes ULINKplus I/O control and test automation capabilities in details:

  • I/O Interface provides schematics, signal description and technical data about the ULINKplus I/O connector.
  • Configure the I/O pins explains the ULINKplus settings for analog and digital input/output signals using Virtual Simulation Registers (VTREGs) and µVision ULINKplus window.
  • Debug Script Template gives an example how to create and run a test script to generate external signal patterns for testing a target board and application with ULINKplus.


ULINKplus User's Guide: µVision Windows

µVision Windows

µVision shows trace information in:

  • The Trace Status that continuously displays status and progress messages.
  • The Component Viewer that shows detailed information about software components.
  • The Event Recorder that displays execution status and event information, which help to analyze the operation of software components.
  • The System Analyzer that graphically shows core clock, power consumption, interrupts, thread and exception execution over time.

Detailed trace information for Cortex-M3, Cortex-M4, and Cortex-M7 processor-based devices can be viewed using the following windows:

  • Debug (printf) Viewer for viewing debugging and program-specific information.
  • Trace Data for viewing the instruction history of Cortex-M processor-based devices.
  • Trace Exceptions window that displays statistics about processor exceptions, which are based on trace events.
  • Event Counters window that displays a counter for each user-selected event.

The ULINKplus window shows the status and enables the management of the ULINKplus' I/O pins and the power measurement values.

Note

  • Trace Settings explains how to configure the trace output and configure individual devices.
  • The Logic Analyzer that displays up to 4 global or static variables on a time-graph is still available but superseded by System Analyzer which offers the same functionality plus more advanced features.


ULINKplus User's Guide: ULINKplus

ULINKplus

The ULINKplus window shows the status of the ULINKplus' I/O pins and the power measurement values. Open it using View - Analysis Windows - ULINKplus.

The I/O section shows how the I/O pins are configured:

  • Pin - Displays the pin number
  • Function - Displays the current function set that is applied to the I/O. You can change the function set by clicking on the current function:
    Function change
  • Out - If the function is "Digital Output", you can set the output to high by checking the box. Otherwise the output is low. For Pin 7, when configured for Analog Output, the pin voltage displays. You can change the voltage by entering a new value.
  • In - Displays the current I/O voltage level if configured to "Digital Input"

The Power section shows these values:

  • Shunt R - Displays and sets the external shunt resistance in Ohms. Change the shunt value by entering the new value here.
  • Voltage - Displays the measured voltage
  • Current - Displays the measured current
  • Power - Displays the calculated power
  • Enable - Is checked or unchecked to allow or prevent power measurement capture (required for System Analyzer).

Note:

The ULINKplus window is only available if you are using a ULINKplus debug adapter.