<<

A Software Guide to Universal Debug Engine for C166, ST10, XC166, XE166 XC2000, TriCore, PowerPC ARM, XScale, SuperH

Integrated Development Environment for 32-bit TriCore, PowerArchitecture, Cortex, ARM7, ARM9, ARM11, XScale, SuperH derivatives for 16-bit C166, ST10, XC166, XC2000, XE166, C166CBC derivatives

PLS 1991-2013 4.00.02.02

This manual contains 167 pages.

Contact us at:

EMail: [email protected] [email protected] WWW: http://www.pls-mc.com

PLS Programmierbare Logik & Systeme GmbH PLS Development Tools Technologiepark Lauta 1250 Oakmead Parkway, Suite#210 - 02991 Lauta Sunnyvale CA, 94085 Germany U.S.A. Phone: + 49 35722 384 - 0 + 1 408 451 - 8408 Fax: + 49 35722 384 - 69 + 1 408 501 - 8808 Toll Free: + 1 877 - 77DEBUG

All rights reserved. No part of this manual may be reproduced or may be transmitted in any form or by any means without prior written permission of PLS Programmierbare Logik & Systeme GmbH. The information in this manual is subject to change without notice, no responsibility is assumed for its use. Universal Debug Engine is a trademark of PLS Programmierbare Logik & Systeme GmbH. Adobe is a registered trademark of Adobe Systems Incorporated. TriCore™ is a trademark of Infineon AG. ARM7™, ARM9™, ARM11™, Cortex™ are trademarks of ARM . PowerPC is a registered trademark of IBM Corporation. Power Architecture™ is a trademark of Power.org. Windows XP, , Windows 7, Windows 8 are trademarks of Corporation. Pentium and Core™ are trademarks of Corporation. XScale , Celeron are registered trademarks of Intel Corporation. Athlon™ is a trademark of Advanced Micro Devices, Inc. SuperH™ is a trademark of Renesas Technology Corporation. All other names and trademarks are the property of their respective owners.

Contents

Introduction 7 Overview 7 Feedback 7 Versions of UDE 8 Delivery Contents 9 System Requirements 11

Installing of Universal Debug Engine 12 Installation Notes - before you install UDE 12 Installing Hardware 13 Static Electricity Precautions 13 Demo Version for Starterkits (via JTAG) 14 Demo Version for Starterkits (via ASC Bootstrap loader) 15 Demo Version for Easy Kits (via DAS/USB-JTAG adapter) 16 Standard Version UAD2compact (via JTAG) 17 Standard Version UAD2 and UAD2pro (via JTAG) 18 Standard Version UAD2 and UAD2pro (via DAP) 19 Standard Version UAD2 and UAD2pro (via SWD) 20 Standard Version UAD2+ (via JTAG) 21 Standard Version UAD2+ (via DAP) 22 Standard Version UAD2+ (via SWD) 23 Standard Version UAD3+ (via JTAG) 24 Standard Version UAD2 (via ASC, SSC, CAN) 25 Standard Version UAD2+ (via ASC, SSC, CAN) 26 Standard Version UAD2+ (via 3Pin) 27 Standard Version fast-PC6x / fast-PC276 (via ASC/SSC) 28 Standard Version fast-PC6x / fast-PC276 (via CAN) 29 Standard Version UAD2+ (with Trace Support) 30 Standard Version UAD3+ (with Trace support) 31 UAD2-JTAG Protector 2 for UAD2 32 UAD-JTAG Protector 2 for UAD2+ 33 Simulator Version (TSim) 34 Installing UDE Software 35 Working with the CD browser 35 Start the Installation 36 Driver Installation for Universal Access Device 37 UAD via standard parallel port interface 37 UAD2+ via IEEE1394 38 UAD3+ via IEEE1394b 39 UAD2, UAD2pro, UAD2+, UAD3+ via USB port 40 UAD2+, UAD3+ via Ethernet TCP/IP 41 Driver Installation for USB-JTAG-Port 44 USB-JTAG-Port via USB port 44 Driver Installation for USB-Key (Sentinel USB SuperPro) 45 USB-Key via USB port 45 Driver Installation for fast-PC6x Card 46 fast-PC67C/PCI via PCI Host PC 46 Driver Installation for Starterkit Version 47 JTAG Parallel Port via Standard Parallel port 47 Serial Port via Standard Serial Port 47 Serial Port via USB-to-Serial Port 47

Introduction Overview 3 of 167 License Manager 48 Node-locked licensing 49 How to get the Host ID of UDE Installation 49 Setup of Node-Locked License 51 Uninstalling or Reinstalling UDE 52 Trouble Shooting 53 Precautions 53 Latest Versions on World Wide Web 53 Known Issues with UDE 53

Getting Started 55 Examples delivered with UDE 55 A First Example with TriCore™ 56 Precautions 56 Starting Universal Debug Engine 56 Loading a TriCore Executable 58 Running and Stepping through the Application 59 Setting Breakpoints 59 CPU Registers 60 SFR Registers 61 Viewing Variables 61 Viewing Memory Locations 62 Leaving the Project 62 A Multi-Core Debugging Example with TriCore/PCP 63 Creating a New Workspace with changed configuration 63 Running the Program 64 HelloPCP Internals 64 A Multi-Core Debugging Example with TriCore2 AURIX 65 Creating a New Workspace 65 Preparing the 65 Loading a multi-core Executable 66 Core selection 67 Single-core Breakpoints 67 Multi-core Breakpoints and Stepping 68 A Multi-Core GTM Debugging Example with PowerPC MPC5746M 69 Creating a New Workspace 69 Preparing the debugger 70 Loading a multi-core Executable 70 Core selection 71 Single-core Breakpoints 71 Multi-core Breakpoints and Stepping 72 Inspecting Multi-Channel-Sequencer (MCS) Channels 72 A TriCore MCDS Trace Example 74 Introduction 74 Target Configuration 74 Preparations 74 MCDS Trace 76 An Example with C166S V2 / XC16x via JTAG/OCDS L1 77 Starting with Universal Debug Engine 77 Loading and Starting of an Executable 77 Automatic Variables Refresh 77 Trigger Functions 78 An Example with MPC5567 via JTAG 79 Starting with Universal Debug Engine 79 Loading and Starting of an Executable 79 Automatic Variables Refresh 79 Trigger Functions 80 Hints for using the MPC55xx via JTAG 81 An example for kernel and application debugging 82 Preparations 82 Create a new workspace 82 Load the kernel ELF file 83

4 of 167 Overview Introduction Substitute kernel path 83 Debug a syscall kernel function 84 An Example for C166 debugging via 3Pin 85 Hardware Requirements 85 Useful hints for 3Pin Debugging 85 Monitor preparations 86 Starting the Universal Debug Engine 86 Setup Target Interface 87 Using the Simulated I/O channel 89 Creating new Target Configurations 90 Creating a new workspace 90 Invoking the Wizard 90 Select the controller derivative 91 Selecting Target Interface 91 Setup the Target Interface 92 Configuring the FLASH memory 93 Finish the wizard 94 Using the OCDS L2 Trace Board with the TriCore 95 Preparations 95 Recording the first Samples 95 Looking what happens when the Function exits 95 Measuring the Interval a Function is called 96 Conclusion 96

User's Guide 97 Introduction 97 Architecture of Universal Debug Engine 98 Using On-line Help 99 Project Management 100 Working with Projects 100 Creating a New Project 100 Select Target Configuration 101 Loading a Project 101 Saving Project Settings 101 Closing a Project 101 Command line options of UDE 102 Preparing a binary File 102 Compiler Support 102 Downloading the binary File 104 Examples of Debug Communication Channels 104 Selection of a Hardware Communication Channel 105 Overview about the Monitor programs 106 Preparing the Communication 106 Connect the target system 108 Download the application 108 Viewing Program Code 108 Workspace 108 Program Window 109 Running a program 111 Inline Assembler 111 Viewing and Modifying Registers 112 Kinds of Register Views 112 CPU View 112 SFR View 113 HTML View based on the UDE Object Model 114 Watching Variables 115 Watch View 115 Watch Expressions 115 Adding Variables and Expressions using Select Watch Dialog 117 Locals View 119 Automatically variable content refresh 119 Stepping and Breakpoints 119

Introduction Overview 5 of 167 Overview 119 Following the program flow 119 Stop the program at a specified location 120 Breakpoint dialog 121 Breakpoint identifier 122 Viewing Memory Locations 123 Writing data to target 123 Updating data from target 123 Printing of memory locations 124 Viewing Data as Scientific Chart 124 Basic features of the Graphic Display Window 124 Using Expressions 124 Graphical Display Window Properties 125 Viewing Call Stack 125 Program Execution Time Measuring 126 Trace, Visualization and Analyzing 127 Trace Analyzing Features and Views 128 Trace Profiling as Statistical Chart 129 Trace Profiling as Flow Chart 132 Code Coverage 133 MCDS, Nexus, CoreSight, ETM, ETB, OCDS L2 Trace View 134 Signal Trace - Real-Time Graphical Monitoring 139 ITM Trace 141 Activating and Using Add-Ins 142 Activating an Add-In 142 Removing an Add-In 142 Triggered Transfer Recorder 143 FLASH / OTP Programming 144 Supported Functions 144 Basic Concept 144 Definition of external FLASH Memories 147 Definition of on-chip FLASH Memories 147 Definition of Memory Access Filters 148 Enabling the FLASH Programming 148 FLASH Programming 149 Setup FLASH Programming options 150 UDE CAN Recorder 151 Supported Functions 151 Enabling the CAN Recorder 151 Send and Record CAN Messages 151 UDE RTX Viewer 152 Supported Functions 152 Enabling the RTX Viewer 152 Using the RTX Viewer 152 UDE rcX Viewer 153 Supported Functions 153 Enabling the rcX Viewer 153 Using the rcX Viewer 153 Eclipse IDE for UDE 154 Prepare Eclipse IDE for UDE Integration Package 154 Launching UDE Debug Session in Eclipse IDE 156 Add UDE Sample Project to Eclipse Helios C/C++ IDE 158 UDE Object Model 160 Overview 160 Example for TriCore 160 User Definable Enhancements 161

Reference 163

Index 164

6 of 167 Overview Introduction Introduction

Overview Thank you for choosing Universal Debug Engine (UDE) 4, one of the most powerful development workbenches available for the 16-bit architectures C166, ST10, XC166, XC2000, XE166, C166CBC, C166S V2 and the 32-bit TriCore™, PowerPC , Cortex™, ARM7™, ARM9™, ARM11™, XScale™ and SuperH™ derivatives. The software which you are about to install is the UDE Standard License software. Included with the full licensed version comes a high-speed communication hardware which speeds up downloading your application into the target system. It offers a flexible way of communication via various communication channels to the supported . UDE offers and application debugging. The simultaneous use of two is supported. Troubleshooting within the application takes place via an Ethernet interface and a modified gdb -server in the target. Special versions of UDE like the MemTool Flash/OTP Memory Programming Tool are available on your request.

This Software UDE manual describes the Universal Debug Engine based on the selective Evaluation Boards. However, the UDE is also working with other C166, ST10, XC166, XC2000, XE166, TriCore, PowerArchitecture, Cortex, ARM7, ARM9, ARM11, XScale and SuperH based hardware and simulators. Please see the compatibility list in appendix of this manual or the actual list on our Web site for supported MCUs. This manual is supplemented by the Hardware Appendix UDE manual, an appendix of this manual. Please see this manual for detailed description of the hardware interfaces.

You are invited to browse to our Web site at http://www.pls-mc.com to get the newest ? information or to download the latest version of Universal Debug Engine.

Feedback The PLS Development Tools welcomes feedback on our products and documentation's. If you have any comments, suggestions or improvements about the products you are using, please use the Feedback Form from our Web Site http://www.pls-mc.com, send an email to [email protected] or call our Support Line.

Introduction Overview 7 of 167 Versions of UDE UDE, the Universal Debug Engine for C166, ST10, XC166, XC2000, XE166, TriCore, PowerArchitecture, Cortex, ARM7, ARM9, ARM11, XScale and SuperH derivatives is available in a Starterkit version with parallel port support for JTAG, in a Starterkit version with serial port support and in a high-speed full-featured version with extra communication hardware. Versions with simulator support are available too. The following table describes the differences between the versions of UDE: 1. The Free Entry Toolchain offers a wide range of UDE features combined with the Eclipse environment and the HighTec C/C++ compiler. 2. The Demo version for Starterkits (JTAG or ASC bootstrap loader support) (Evaluation Kit) offers a simple JTAG target access to the Starterkit board via parallel port or USB-JTAG adapter or offers a target access to the Starterkit board via serial port. 3. The Standard versions are equipped with specialized communication hardware and allow higher transmission rates than the Starterkit version. Additional various communication channels are featured.

The Standard version Universal Access Device 2 compact (UAD2compact) allows a flexible way of communication and is suitable for desktop and notebook users in the same way. The Universal Access Device 2 communicates with the host PC via the USB2.0 bus. Target Communication is supported via JTAG to ARM7 and ARM9 targets only.

The Standard version Universal Access Device 2 (UAD2) allows a flexible way of communication and is suitable for desktop and notebook users in the same way. The Universal Access Device 2 communicates with the host PC via the USB2.0 bus. Target Communication is supported via ASC, SSC, CAN, DAP and JTAG.

The Standard version Universal Access Device 2pro (UAD2pro) allows a flexible way of communication and is suitable for desktop and notebook users in the same way. The Universal Access Device 2pro communicates with the host PC via the USB2.0 bus. Target Communication is supported via ASC, SSC, CAN, JTAG, cJTAG, DAP, SWD.

The Standard version Universal Access Device 2+ (UAD2+) is the all-in-on solution for UDE. It communicates with the host PC via the USB2.0, IEEE1394 or Ethernet bus. Target Communication is supported via ASC, SSC, 3Pin, CAN, JTAG, DAP, SWD. Additionally the Universal Access Device 2+ supports the program instruction trace with the trace board add-in feature.

The Standard version Universal Access Device 3+ (UAD3+) is the high-end- solution for UDE. It communicates with the host PC via the USB2.0, IEEE1394b or Ethernet bus. Target Communication is supported via JTAG, cJTAG, DAP, SWD. Additionally the Universal Access Device 2+ supports the high-speed program instruction trace with the trace board add-in feature.

The Standard version fast-PC6x card allows communication to the target via a PCI card. Target Communication is supported via ASC, SSC and CAN. 4. The Simulator version features a debugging environment about various simulators. The simulators can be used effectively in the early stages of software development, reducing the length of time spent later on system integration. The UDE debugger uses the simulator interface like a real hardware platform. All advantages of HLL- Debugging are offered with the combination of UDE and the simulator environment.

8 of 167 Versions of UDE Introduction Delivery Contents Depending on your UDE version, please check the contents of delivery from the following table and make sure that the package contains all of the required parts.

sion

Trace Trace

pro

version

compact

PC6x

-

with with

UAD2

Board Board

UAD2+ UAD3+

Starterkits

UAD2

fast

UAD2

Demo version Demo

for for

Standardversion Standardversion Standardversion Standardversion Standardversion Standardversion Standardver Standardversion

Simulator

UAD2+ UAD3+

Software and Manuals Software UDE Manual 1  Hardware Appendix UDE Manual         

CD-ROM          

Access Devices

UAD2compact 

UAD2 

UAD2pro 

UAD2+   4 UAD2+ Trace Board (built-in)  UAD2+ JTAG Extender with 10-wire 3 3 (DAP), or 14-wire (JTAG/cJTAG), or 16-   wire (JTAG), 20-wire (JTAG)

UAD3+  

UAD3+ JTAG Pod   4 UAD3+ Trace Board 2 (built-in) 

UAD3+ Trace Pod  fast-PC67C/PCI card or 3 fast-PC276C/PCI card  3 USB-to-Serial Converter 

USB-Key 

Interface Devices UAD2 JTAG Adapter (ARM, OnCE, COP, 3 3 3 ...)    UAD2+ Trace Pod ( 38-pin, 40-pin or 60- 4 pin)  UAD2pro/UAD3+ JTAG Adapter (ARM, 3 3 3 OnCE, ...)   4 UAD3+ Trace Adapter (16-bit ARM, ...) 

Introduction Delivery Contents 9 of 167

Trace Trace

pro

version

compact

PC6x

-

with with

UAD2

Board Board

UAD2+ UAD3+

Starterkits

UAD2

fast

andard version andard

UAD2

Demo version Demo

for for

Standardversion St Standardversion Standardversion Standardversion Standardversion Standardversion Standardversion

Simulator

UAD2+ UAD3+

Pod Interface Cables UAD2+ JTAG Extender Cable (40-wire 3 3 HD Flat Ribbon Cable)   UAD2+ Trace Pod Cable (80-wire HD Flat Ribbon Cable) 

UAD3+ IO Pod Cable (26-wire HD Cable)   UAD3+ Trace Pod Cable (68-wire HD Cable) 

Target Interface Cables UAD2 10" (25 cm) Flat Ribbon Cable, 10-wire, 3Pin, ASC, SSC  UAD2 10" (25 cm) Flat Ribbon Cable, 3 3 10-wire (DAP), or 14-wire (JTAG),   or 16-wire (JTAG), 20-wire (JTAG) UAD2pro/UAD3+ JTAG Adapter Cable  (40-wire HD Flat Ribbon Cable)   UAD3+ Trace Adapter Cable (38-wire HD Flat Ribbon Cable) 

Host PC Adapters and Cables 3 3 Host IEEE1394 PCI Board   3 3 Host IEEE1394 Cable   3 3 3 Host IEEE1394b PCI Board    3 3 3 Host IEEE1394b Cable    3 Host USB Cable        2 Host Parallel Cable 

Power Supply Wall Transformer 220 VAC 5 5 5 50~ / 12V DC (6W)    Wall Transformer 110-220VAC 5 5 5 50-60~ / 12V DC or 18V DC (24W)     Wall Transformer 110-220VAC 50-60~ / 12V DC or 18V DC (100W)   1 If you did not receive a manual with your Starterkit CD-ROM, you may order one. 2 for TARA EVA M2 only 3 optional shipped, corresponding your order 4 with Trace Board option only 5 depending on your country location

10 of 167 Delivery Contents Introduction System Requirements To run Universal Debug Engine (UDE) 3 at least the following minimum system configuration is required:  compatible PC  1 GHz or faster 32-bit () or 64-bit (x64)  1 GByte RAM (32-bit) or 2 GByte RAM (64-bit)  1 GByte available hard disk space  Windows XP, Windows Vista, Windows 7, Windows 8  Microsoft .NET™ Framework 3.5 SP1  Microsoft Windows Scripting Host V5.6  Microsoft ® 6.0 or higher  Adobe® Acrobat Reader 4.0 or higher  300 MByte space on local hard-disk  Administrator permissions for the current login during installation.

The UDE version 4.0 requires the installation of .NET Framework 3.5 SP1. To obtain the installation package of .NET Framework 3.5, please see the Readme file within the UDE ! installation folder for further hints.

Depending on the type of target access, you will additionally need one of the following interface ports:  an IEEE1394-OHCI interface for the Standard version with UAD2+ or UAD3+ via IEEE1394 or an IEEE1394b-OHCI interface for the Standard version with UAD3+ via IEEE1394b  or an USB port interface for the Standard version with UAD2 or UAD2pro or UAD2+ or UAD3+ or for the Demo version for Easy Kits XC166, XC2000, XE166 or for the Simulator version with USB-Key or the Standard version with USB-JTAG-Port  or an Ethernet interface for the Standard version UAD2+ or UAD3+  or a standard parallel port ( LPTx ) interface for the Demo version for Starterkits (JTAG support)  or a standard serial port ( COMx ) interface for the Demo version for Starterkits (ASC bootstrap loader support)  or an free PCI slot for the Standard version with fast-PC67C/PCI / fast- PC276C/PCI The fast-PC67C/PCI and fast-PC276C/PCI are compliant with PCI r2.1.

Introduction System Requirements 11 of 167 Installing of Universal Debug Engine

Before you start the installation , please ensure which version of Universal Debug Engine (UDE) 4.0 you intend to use. Check that your package contains the required parts and install the hardware and software according to the following description. Depending on your UDE version, please follow the corresponding instructions.

Please note that you must have administrator rights for successful execution of the ! installation process.

The UDE Universal Debug Engine is also available as a Demo version for various starterkits. Please use the CD Browser utility from the UDE CD-ROM and install the UDE demo software without hardware support as well as the hardware drivers if needed. The demo versions will work with the host ports LPTx or COMx. For COMx a standard serial ports or an USB-to-Serial port can be used. The demo version is limited to 16 kByte program sizes for C16x derivatives, 32 kByte for TriCore derivatives and is limited to program the first FLASH sector only. All other functions are freely available for testing. Further more, so-called Free Entry Tool Chain is available. This version based on a Demo version integrated into an Eclipse environment and an HighTec C/C++ compiler.

Installation Notes - before you install UDE A proper function of the Universal Debug Engine and its hardware devices is only guaranteed for working with the original components tested and delivered by PLS Development Tools. The delivered components are verified with the recommends and standards of the chip manufactures.

When a new version of UDE is started the first time, a update may be executed on the access device (UAD, UAD2 ...). This may take some more time than usual for the target connect operation. Please DO NOT power off or unplug the access device while this time!

12 of 167 Installation Notes - before you install UDE Installing of Universal Debug Engine Installing Hardware

Static Electricity Precautions Electrostatic Discharge (ESD) can damage a sensitive electronic component! Under several conditions static electricity and ground potential differences between the Access Device and the user's target hardware can build up high voltages - over 10000 Volts (10 kV) in some cases. The electrostatic discharge of this build-up voltage results in fast high current waveforms and fast magnetic (H-field) or electrostatic (E-field) disturbances. The discharge into the electronic components and circuitry can damage or destroy hardware components, resulting in failures and reduced reliability. Because of the non-hot-pluggable 3,3 Volts / 5 Volts -TTL properties of the JTAG and the 3Pin/Serial connectors, these ports are endangered especially. The maximum voltage on these pins may not exceeded 5,5 Volts against the UAD’s ground, especially in the case that the ground planes are not connected first. To protect your hardware against damage from static electricity and ground potential discharge, you have to follow some precautions: 1. Before you change any cable connections from the Access Device, please remove the power from the Access Device and your target system. 2. Please ensure that the static electricity and ground potentials between the Access Device, the host PC and the target hardware are balanced. If there is a of high potential differences, you must connect the Access Device, the host PC and the target hardware to the same ground domain via a low resistance connection. 3. Establish the target connection and power on the systems.

Host Development Universal Access Device Custom Specific Target Hardware

Hot-Pluggable Host Signal line + Signal line + Ground line Ground line

Additional Ground Additional Ground

line required in case of potential differences line required

Host Ground UAD Ground Target Ground

Hint: All Universal Access Devices are equipped with a ground socket on the front side. Please use this ground socket for discharging the static electricity and balancing ground potentials between the Universal Access Device, the host PC and the target hardware ! BEFORE you connect the target hardware to the Access Device. An additional protection for UAD2 can be achieved by using the JTAG Protector. The UAD2pro, UAD2+ contains the protection function already. Please note, that the JTAG Protector DOES NOT suspend the precautions described above.

Installing of Universal Debug Engine Installing Hardware 13 of 167 Demo Version for Starterkits (via JTAG) The hardware installation of Universal Debug Engine for Starterkits with parallel port support for JTAG/OCDS L1 is done within the following steps: 1. Configure the Starterkit board with the correct jumper setting. Please see the appendix "Hardware Description" about useful information about the supported Starterkit boards. 2. Connect the Host PCs parallel port with the Onboard JTAG adapter. Connector on the Starterkit board by the 25-wire parallel cable. A gender changer is required in case of using a standard 25-wire 1:1 parallel port cable. 3. Connect the wall transformer's cable with the 'Power' jack and apply power to the Starterkit board.

Host PC Target system

JTAG/OCDS-Debugging

Trans- former

Starterkit ( i.e. TriBoard, EasyUTAH, XC16)

Parallel Port

cable

Host PC with Standard Parallel Port

4. Start your computer system and login with administrator rights. 5. Read the file RELEASE.HTM for the latest hardware and software changes. 6. Start SETUP.EXE from the UDE CD-ROM and follow the instructions on the screen. A detailed description of the software installation is followed in the chapter „Installing UDE Software“. 7. After a few additional steps, the installation program lets you choose to launch UDE automatically. The UDE is now installed and ready to use.

If you have trouble while installing the product, please contact the PLS Support Team at [email protected].

? Please see the appendix „Hardware Description“ for important information about the configuration of the Starterkit board.

14 of 167 Installing Hardware Installing of Universal Debug Engine Demo Version for Starterkits (via ASC Bootstrap loader) The hardware installation of Universal Debug Engine for the Starterkits via ASC Bootstrap loader is done within the following steps: 1. Configure the evaluation board with the correct jumper setting. Please see the appendix "Hardware Description" about useful information about the supported Starterkit boards. 2. Connect the ASC0 connector with a COMx connector of the PC via a 9-pin D-SUB extension cable. Alternatively, an USB-to-Serial converter can be used. The USB converter device and drivers are included in the Starterkit delivery (e.g. ST10F252 Starterkit). 3. Connect the wall transformer's cable with the 'Power' jack and apply power to the Starterkit board. Host PC Target system ASC Bootstrap loader Debugging Trans- former

USB-To-Serial Converter

USB interface or ASC0

COMx interface interface

4. Start your computer system and login with administrator rights. 5. Read the file RELEASE.HTM for the latest hardware and software changes. 6. Start SETUP.EXE from the UDE CD-ROM and follow the instructions on the screen. A detailed description of the software installation is followed in the chapter „Installing UDE Software“. 7. After a few additional steps, the installation program lets you choose to launch UDE automatically. The UDE workbench is now installed and ready to use.

If you have trouble while installing the product, please contact the PLS Support Team at [email protected].

? Please see the appendix „Hardware Description“ for important information about the configuration of the Starterkit board.

Installing of Universal Debug Engine Installing Hardware 15 of 167 Demo Version for Easy Kits (via DAS/USB-JTAG adapter) The hardware installation of Universal Debug Engine for the Starterkit Easy Kit XC166, XC2000 and XE166 with DAS/USB-JTAG adapter is done within the following steps: 1. Configure the Easy Kit board with the correct jumper setting. Please see the appendix "Hardware Description" about useful information about the supported Starterkit boards. 2. Connect the USB-Wiggler with an USB connector of the installed USB host adapter in your PC. Connect the USB-JTAG adapter with the JTAG/OCDS L1 connector of the Easy Kit board by the 10" 16-wire JTAG cable. 3. Connect the wall transformer's cable with the 'Power' jack and apply power to the Starterkit board. Host PC Target system JTAG/ARM Debugging Trans- former

Easy Kit

USB-Wiggler

USB2.0 JTAG/OCDS L1

4. Start your computer system and login with administrator rights. 5. Read the file RELEASE.HTM for the latest hardware and software changes. 6. Start SETUP.EXE from the UDE CD-ROM and follow the instructions on the screen. A detailed description of the software installation is followed in the chapter „Installing UDE Software“. 7. After a few additional steps, the installation program lets you choose to launch UDE automatically. The UDE workbench is now installed and ready to use.

If you have trouble while installing the product, please contact the PLS Support Team at [email protected].

? Please see the appendix „Hardware Description“ for important information about the configuration of the Starterkit board.

16 of 167 Installing Hardware Installing of Universal Debug Engine Standard Version UAD2compact (via JTAG)

The hardware installation of Universal Access Device 2compact is done within the following steps: 1. Connect the Universal Access Device 2compact (connector 'USB') with an USB 2.0 connector of the installed USB host adapter in your PC (USB 2.0 is recommend, USB 1.1 is also possible). 2. Connect the ground socket with the ground potential of your target hardware for discharging the static electricity and balancing ground potentials. 3. Connect the 'JTAG Target' connector of the Universal Access Device 2compact with the JTAG connector of the microcontroller board by the 10" 20-wire JTAG cable. Refer to the appendix „Hardware Description“ of the user’s manual for more information about the correct pin connections. Host PC Target system JTAG/ARM Debugging

Trans- former

Starterkit or Custom Specific Target Hardware Trans- former

Universal Access Device 2 compact

USB2.0 JTAG

4. Start your computer system and login with administrator rights. 5. Connect the wall transformer's cable with the 'Power' jack to the Universal Access Device 2compact. 6. Read the file RELEASE.HTM for the latest software changes. 7. Start SETUP.EXE from the UDE CD-ROM and follow the instructions on the screen. A detailed description of the software installation is followed in the chapter „Installing UDE Software“. 8. After a few additional steps, the installation program lets you choose to launch UDE automatically. The UDE workbench is now installed and ready to use.

If you have trouble while installing the product, please contact the PLS Support Team at ? [email protected]. Please pay attention to the chapter "Static Electricity Precautions" containing important information about required ESD protection of the access devices.

Installing of Universal Debug Engine Installing Hardware 17 of 167 Standard Version UAD2 and UAD2pro (via JTAG) The hardware installation of Universal Access Device 2 and 2pro is done within the following steps: 1. Connect the Universal Access Device 2 or 2pro (connector 'USB') with an USB 2.0 connector of the installed USB host adapter in your PC (USB 2.0 is recommend, USB 1.1 is also possible). 2. Connect the ground socket with the ground potential of your target hardware for discharging the static electricity and balancing ground potentials. 3. Connect the 'JTAG/OCDS Target' connector of the Universal Access Device 2 with the JTAG connector of the microcontroller board by the 14-wire, 16-wire or 20-wire JTAG cable or connect the Universal Access Device 2pro with the JTAG connector by the 40-pin cable and delivered adapter. Refer to the appendix „Hardware Description“ of the user’s manual for more information about the correct pin connections. Host PC Target system JTAG Debugging

Trans- former

Starterkit or Custom Specific Target Hardware

Trans- former

Universal Access Device 2

USB2.0 JTAG

4. Start your computer system and login with administrator rights. 5. Connect the wall transformer's cable with the 'Power' jack to the Universal Access Device 2. 6. Read the file RELEASE.HTM for the latest software changes. 7. Start SETUP.EXE from the UDE CD-ROM and follow the instructions on the screen. A detailed description of the software installation is followed in the chapter „Installing UDE Software“. 8. After a few additional steps, the installation program lets you choose to launch UDE automatically. The UDE workbench is now installed and ready to use.

If you have trouble while installing the product, please contact the PLS Support Team at ? [email protected]. Please pay attention to the chapter „Static Electricity Precautions“ containing important information about required ESD protection of the access devices.

18 of 167 Installing Hardware Installing of Universal Debug Engine Standard Version UAD2 and UAD2pro (via DAP) The hardware installation of Universal Access Device 2 is done within the following steps: 1. Connect the Universal Access Device 2 (connector 'USB') with an USB 2.0 connector of the installed USB host adapter in your PC (USB 2.0 is recommend, USB 1.1 is also possible). 2. Connect the ground socket with the ground potential of your target hardware for discharging the static electricity and balancing ground potentials. 3. Connect the 'JTAG/OCDS Target' connector of the Universal Access Device 2 with the JTAG connector of the microcontroller board by the 10-wire DAP adapter cable or connect the Universal Access Device 2pro with the DAP connector by the 40-pin cable and delivered adapter. Refer to the appendix „Hardware Description“ of the user’s manual for more information about the correct pin connections.

Host PC Target system DAP Debugging Trans- former

Starterkit or Custom Specific Target Hardware

Trans- former Universal Access Device 2

USB2.0 DAP Adapter

4. Start your computer system and login with administrator rights. 5. Connect the wall transformer's cable with the 'Power' jack to the Universal Access Device 2. 6. Read the file RELEASE.HTM for the latest software changes. 7. Start SETUP.EXE from the UDE CD-ROM and follow the instructions on the screen. A detailed description of the software installation is followed in the chapter „Installing UDE Software“. 8. After a few additional steps, the installation program lets you choose to launch UDE automatically. The UDE workbench is now installed and ready to use.

If you have trouble while installing the product, please contact the PLS Support Team at ? [email protected]. Please pay attention to the chapter „Static Electricity Precautions“ containing important information about required ESD protection of the access devices.

Installing of Universal Debug Engine Installing Hardware 19 of 167 Standard Version UAD2 and UAD2pro (via SWD) The hardware installation of Universal Access Device 2 is done within the following steps: 1. Connect the Universal Access Device 2 (connector 'USB') with an USB 2.0 connector of the installed USB host adapter in your PC (USB 2.0 is recommend, USB 1.1 is also possible). 2. Connect the ground socket with the ground potential of your target hardware for discharging the static electricity and balancing ground potentials. 3. Connect the 'JTAG/OCDS Target' connector of the Universal Access Device 2 with the SWD adapter (‘UAD2’-side) by the 16-wire adapter cable. 4. Connect the 20-pin ‘Target’-side of the SWD adapter with the connector of the microcontroller board directly (20-pin connector) or by the 20-wire high density adapter cable (20-pin high density connector) or connect the Universal Access Device 2pro with the DAP connector by the 40-pin cable and delivered adapter. Refer to the appendix „Hardware Description“ of the user’s manual for more information about the correct pin connections. Host PC Target system SWD Debugging Trans- former

Starterkit or Custom Specific Target Hardware

Trans- former Universal Access Device 2

USB2.0 SWD adapter

5. Start your computer system and login with administrator rights. 6. Connect the wall transformer's cable with the 'Power' jack to the Universal Access Device 2. 7. Read the file RELEASE.HTM for the latest software changes. 8. Start SETUP.EXE from the UDE CD-ROM and follow the instructions on the screen. A detailed description of the software installation is followed in the chapter „Installing UDE Software“. 9. After a few additional steps, the installation program lets you choose to launch UDE automatically. The UDE workbench is now installed and ready to use.

If you have trouble while installing the product, please contact the PLS Support Team at ? [email protected]. Please pay attention to the chapter „Static Electricity Precautions“ containing important information about required ESD protection of the access devices.

20 of 167 Installing Hardware Installing of Universal Debug Engine Standard Version UAD2+ (via JTAG) The hardware installation of Universal Access Device 2+ is done within the following steps: 1. Connect the Universal Access Device 2+ (connector 'IEEE1394') with an IEEE1394 connector of the installed IEEE1394 host adapter in your PC or connect the connector 'USB 2.0' with an USB 2.0 connector of the installed USB host adapter in your PC (USB 2.0 is recommend, USB 1.1 is also possible) or the connector ETH with a Ethernet network. 2. Connect the ground socket with the ground potential of your target hardware for discharging the static electricity and balancing ground potentials. 3. Connect the 'JTAG/OCDS Target' connector of the Universal Access Device 2+ with the JTAG Extender via the 40-wire HD flat ribbon cable. Connect the JTAG Extender with your target by the 14-wire, 16-wire or 20-wire JTAG cable. Refer to the appendix „Hardware Description“ of the user’s manual for more information about the correct pin connections.

Host PC Target system JTAG Debugging

Trans- former

Trans- Starterkit or Custom former Specific Target Hardware Universal Access Device 2+

IEEE1394, ETH

USB2.0 JTAG

JTAG Extender

4. Start your computer system and login with administrator rights. 5. Connect the wall transformer's cable with the 'Power' jack to the Universal Access Device. 6. Read the file RELEASE.HTM for the latest software changes. 7. Start SETUP.EXE from the UDE CD-ROM and follow the instructions on the screen. A detailed description of the software installation is followed in the chapter „Installing UDE Software“. 8. After a few additional steps, the installation program lets you choose to launch UDE automatically. The UDE workbench is now installed and ready to use.

If you have trouble while installing the product, please contact the PLS Support Team at ? [email protected]. Please pay attention to the chapter „Static Electricity Precautions“ containing important information about required ESD protection of the access devices.

Installing of Universal Debug Engine Installing Hardware 21 of 167 Standard Version UAD2+ (via DAP) The hardware installation of Universal Access Device 2+ is done within the following steps: 1. Connect the Universal Access Device 2+ (connector 'IEEE1394') with an IEEE1394 connector of the installed IEEE1394 host adapter in your PC or connect the connector 'USB 2.0' with an USB 2.0 connector of the installed USB host adapter in your PC (USB 2.0 is recommend, USB 1.1 is also possible) or the connector ETH with a Ethernet network. 2. Connect the ground socket with the ground potential of your target hardware for discharging the static electricity and balancing ground potentials. 3. Connect the 'JTAG/OCDS Target' connector of the Universal Access Device 2+ with the JTAG Extender via the 40-wire HD flat ribbon cable. Connect the JTAG Extender with your target by the 10-wire DAP adapter cable. Refer to the appendix „Hardware Description“ of the user’s manual for more information about the correct pin connections.

Host PC Target system JTAG Debugging

Trans- former

Trans- Starterkit or Custom former Specific Target Hardware Universal Access Device 2+

IEEE1394, ETH

USB2.0 DAP

JTAG Extender

4. Start your computer system and login with administrator rights. 5. Connect the wall transformer's cable with the 'Power' jack to the Universal Access Device. 6. Read the file RELEASE.HTM for the latest software changes. 7. Start SETUP.EXE from the UDE CD-ROM and follow the instructions on the screen. A detailed description of the software installation is followed in the chapter „Installing UDE Software“. 8. After a few additional steps, the installation program lets you choose to launch UDE automatically. The UDE workbench is now installed and ready to use.

If you have trouble while installing the product, please contact the PLS Support Team at ? [email protected]. Please pay attention to the chapter „Static Electricity Precautions“ containing important information about required ESD protection of the access devices.

22 of 167 Installing Hardware Installing of Universal Debug Engine Standard Version UAD2+ (via SWD) The hardware installation of Universal Access Device 2+ is done within the following steps: 1. Connect the Universal Access Device 2+ (connector 'IEEE1394') with an IEEE1394 connector of the installed IEEE1394 host adapter in your PC or connect the connector 'USB 2.0' with an USB 2.0 connector of the installed USB host adapter in your PC (USB 2.0 is recommend, USB 1.1 is also possible) or the connector ETH with a Ethernet network. 2. Connect the ground socket with the ground potential of your target hardware for discharging the static electricity and balancing ground potentials. 3. Connect the 'JTAG/OCDS Target' connector of the Universal Access Device 2+ with the JTAG Extender via the 40-wire HD flat ribbon cable. Connect the 16-wire extender cable with the SWD adapter (‘UAD2’-side). 4. Connect the 20-pin ‘Target’-side of the SWD adapter with the connector of the microcontroller board directly (20-pin connector) or by the 20-wire high density adapter cable (20-pin high density connector). Refer to the appendix „Hardware Description“ of the user’s manual for more information about the correct pin connections. Host PC Target system SWD Debugging

Trans- former

Trans- Starterkit or Custom former Specific Target Hardware Universal Access Device 2+

IEEE1394, ETH USB2.0

JTAG Extender SWD adapter

5. Start your computer system and login with administrator rights. 6. Connect the wall transformer's cable with the 'Power' jack to the Universal Access Device. 7. Read the file RELEASE.HTM for the latest software changes. 8. Start SETUP.EXE from the UDE CD-ROM and follow the instructions on the screen. A detailed description of the software installation is followed in the chapter „Installing UDE Software“. 9. After a few additional steps, the installation program lets you choose to launch UDE automatically. The UDE workbench is now installed and ready to use.

If you have trouble while installing the product, please contact the PLS Support Team at ? [email protected]. Please pay attention to the chapter „Static Electricity Precautions“ containing important information about required ESD protection of the access devices.

Installing of Universal Debug Engine Installing Hardware 23 of 167 Standard Version UAD3+ (via JTAG) The hardware installation of Universal Access Device 3+ is done within the following steps: 1. Connect the Universal Access Device 3+ (connector 'IEEE1394b') with an IEEE1394b connector of the installed IEEE1394b host adapter in your PC or connect the connector 'USB 2.0' with an USB 2.0 connector of the installed USB host adapter in your PC (USB 2.0 is recommend, USB 1.1 is also possible) or the connector Ethernet with a Ethernet network. 2. Connect the ground socket with the ground potential of your target hardware for discharging the static electricity and balancing ground potentials. 3. Connect one of the ‘Pod 1-4’ connectors with the JTAG Pod via the IO Pod Cable. Connect the JTAG-Pod with the JTAG Adapter via the JTAG Adapter Cable. Connect the JTAG Adapter with the JTAG connector of the target board. Refer to the appendix „Hardware Description“ of the user’s manual for more information about the correct pin connections. Host PC Target system JTAG Debugging Trans- former

Starterkit or Custom Specific Target Hardware

Trans- former

Universal Access Device 3+

JTAG Adapter IEEE1394, ETH

USB2.0 IO Pod JTAG Adapter Cable Cable JTAG Pod

4. Start your computer system and login with administrator rights. 5. Connect the wall transformer's cable with the 'Power' jack to the Universal Access Device. 6. Read the file RELEASE.HTM for the latest software changes. 7. Start SETUP.EXE from the UDE CD-ROM and follow the instructions on the screen. A detailed description of the software installation is followed in the chapter „Installing UDE Software“. 8. After a few additional steps, the installation program lets you choose to launch UDE automatically. The UDE workbench is now installed and ready to use.

If you have trouble while installing the product, please contact the PLS Support Team at ? [email protected]. Please pay attention to the chapter „Static Electricity Precautions“ containing important information about required ESD protection of the access devices.

24 of 167 Installing Hardware Installing of Universal Debug Engine Standard Version UAD2 (via ASC, SSC, CAN) The hardware installation of Universal Access Device 2 is done within the following steps: 1. Connect the Universal Access Device 2 (connector 'USB') with an USB 2.0 connector of the installed USB host adapter in your PC (USB 2.0 is recommend, USB 1.1 is possible). 2. Connect the ground socket with the ground potential of your target hardware for discharging the static electricity and balancing ground potentials. 3. Connect the 'ASC/SSC/CAN Target' connector of the Universal Access Device 2 with the ASC (RS232), SSC (RS485) or CAN connector of the microcontroller board by a 9-pin 1:1 SUB-D9 (M) to SUB-D9 (F) extension cable. Refer to the appendix „Hardware Description“ of the user’s manual for more information about the correct pin connections.

Host PC Target system ASC, SSC, CAN Debugging

Trans- former

Starterkit or Custom

Trans- Specific Target Hardware former

Universal Access Device 2

ASC, SSC USB2.0 or CAN

4. Start your computer system and login with administrator rights. 5. Connect the wall transformer's cable with the 'Power' jack to the Universal Access Device. 6. Read the file RELEASE.HTM for the latest software changes. 7. Start SETUP.EXE from the UDE CD-ROM and follow the instructions on the screen. A detailed description of the software installation is followed in the chapter „Installing UDE Software“. 8. After a few additional steps, the installation program lets you choose to launch UDE automatically. The UDE workbench is now installed and ready to use.

If you have trouble while installing the product, please contact the PLS Support Team at ? [email protected]. Please pay attention to the chapter „Static Electricity Precautions“ containing important information about required ESD protection of the access devices.

Installing of Universal Debug Engine Installing Hardware 25 of 167 Standard Version UAD2+ (via ASC, SSC, CAN) The hardware installation of Universal Access Device 2+ is done within the following steps: 1. Connect the Universal Access Device 2+ (connector 'IEEE1394') with an IEEE1394 connector of the installed IEEE1394 host adapter in your PC or connector 'USB 2.0' with an USB connector or the connector ETH with an Ethernet network. 2. Connect the ground socket with the ground potential of your target hardware for discharging the static electricity and balancing ground potentials. 3. For Bootstrap loading via ASC (RS232), connect the ‘ASC/SSC/CAN0 Target’ connector with the target connector via a 9-pin D-SUB extension cable. In case of ASC (TTL) or SSC (TTL), connect the ' ASC/SSC/3PIN Target ' connector with the ASC or SSC hardware pins of the microcontroller board by the 10-wire flat ribbon extension cable. When CAN is used, connect additionally the 'CAN1 Target' connector with the target via a 9-pin D-SUB extension cable. Refer to the appendix „Hardware Description“ of the user manual for more information about the correct pin connections of the ASC, SSC and CAN interfaces. Host PC Target system ASC, SSC or CAN -Debugging Trans- former

Starterkit or Custom Serial / Trans- former Specific Target Hardware Application* Universal Access Device 2+

ASC0 / BSL*

IEEE1394, ETH SSC, CAN Parallel Port

* Serial Cable for Bootstraploader Monitor required and for

transparent using of ASC0 required only

4. Start your computer system and login with administrator rights. 5. Connect the wall transformer's cable with the 'Power' jack to the Universal Access Device. 6. Read the file RELEASE.HTM for the latest software changes. 7. Start SETUP.EXE from the UDE CD-ROM and follow the instructions on the screen. A detailed description of the software installation is followed in the chapter „Installing UDE Software“. 8. After a few additional steps, the installation program lets you choose to launch UDE automatically. The UDE workbench is now installed and ready to use.

If you have trouble while installing the product, please contact the PLS Support Team at ? [email protected]. Please pay attention to the chapter „Static Electricity Precautions“ containing important information about required ESD protection of the access devices.

26 of 167 Installing Hardware Installing of Universal Debug Engine Standard Version UAD2+ (via 3Pin) The hardware installation of Universal Access Device2+ is done within the following steps: 1. Connect the Universal Access Device 2+ (connector 'IEEE1394') with an IEEE1394 connector of the installed IEEE1394 host adapter in your PC or connector 'USB 2.0' with an USB connector or the connector ETH with an Ethernet network. 2. Connect the ground socket with the ground potential of your target hardware for discharging the static electricity and balancing ground potentials. 3. Connect the 'ASC/SSC/3Pin Target' connector of the Universal Access Device 2+ with the 3Pin connector of the microcontroller board by the 10-wire 3Pin cable. Because the 3Pin connector is not standardized, it must be installed on your target hardware subsequently. For Bootstrap loading ASC (RS232)/3Pin solution, you must connect the ‘ASC0 Target’ connector with the ASC0 target connector. Refer to the appendix „Hardware Description“ of the user’s manual for more information about the correct pin connections of the 3Pin interface. Host PC Target system 3Pin-Debugging Trans- former

Starterkit or Custom Serial / Trans- former Specific Target Hardware Application* Universal Access Device 2+

Serial / BSL* IEEE1394, ETH 3Pin USB 2.0

* Serial cable for Bootstraploader Monitor required or for transparent using of ASC0 interface required only

4. Start your computer system and login with administrator rights. 5. Connect the wall transformer's cable with the 'Power' jack to the Universal Access Device. 6. Read the file RELEASE.HTM for the latest software changes. 7. Start SETUP.EXE from the UDE CD-ROM and follow the instructions on the screen. A detailed description of the software installation is followed in the chapter „Installing UDE Software“. 8. After a few additional steps, the installation program lets you choose to launch UDE automatically. The UDE workbench is now installed and ready to use.

If you have trouble, while installing the product, please contact the PLS Support Team at [email protected].

? Please pay attention to the chapter „Static Electricity Precautions“ containing important information about required ESD protection of the access devices.

Installing of Universal Debug Engine Installing Hardware 27 of 167 Standard Version fast-PC6x / fast-PC276 (via ASC/SSC) The hardware installation of fast-PC67C/PCI fast-PC276/PCI is done within the following steps: 1. Power OFF your computer system and all connected devices. Disconnect all cables from the computer. 2. Remove the computer cover. 3. Locate an empty PCI slot. 4. Remove the expansion slot rear panel cover. 5. Unpack the fast-PC67C/PCI board from the antistatic bag. Try to hold the board only at the corners and ground yourself by touching the computer chassis. 6. Gently press the fast-PC67C/PCI board into the expansion slot and fix it using the slot cover screw. 7. Close the computer cover and reconnect all cables. 8. Connect the ’Host’ respectively ’RS232/RS485’ connector of the fast-PC67 card with the ASC connector of the microcontroller board by a 1:1 SUB-D9(M) to SUB-D9(F) extension cable. Refer to the appendix „Hardware Description“ of the user’s manual for more information about the correct pin connections of the ASC and SSC interface. Host PC Target system ASC/SSC-Debugging via fast-PC67C/PCI

C167

Serial / BSL C167 C167

fast-PC67C/ISA

8. Start your computer system and login with administrator rights. 9. Read the file RELEASE.HTM for the latest software changes. 10. Start SETUP.EXE from the UDE CD-ROM and follow the instructions on the screen. A detailed description of the software installation is followed in the chapter "Installing Software". 11. After a few additional steps, the installation program lets you choose to launch UDE automatically. The UDE workbench is now installed and ready to use.

If you have trouble while installing the product, please contact the PLS Support Team at [email protected].

? Please pay attention to the chapter „Static Electricity Precautions“ containing important information about required ESD protection of the access devices.

28 of 167 Installing Hardware Installing of Universal Debug Engine Standard Version fast-PC6x / fast-PC276 (via CAN) The hardware installation of fast-PC67C/PCI fast-PC276/PCI is done within the following steps: The hardware installation of fast-PC67C/PCI fast-PC276/PCI is done within the following steps: 1. Remove the computer cover. 2. Locate an empty PCI slot. 3. Remove the expansion slot rear panel cover. 4. Unpack the fast-PC67C/PCI board from the antistatic bag. Try to hold the board only at the corners and ground yourself by touching the computer chassis. 5. Gently press the fast-PC67C/PCI board into the expansion slot and fix it using the slot cover screw. 6. Close the computer cover and reconnect all cables. 7. Connect the ’CAN’ connector of the fast-PC67 card with the CAN connector of the microcontroller board. For bootstrap loading/CAN solution, you must connect the ‘RS232/RS485’ connector with the ASC0 target connector. Refer to the appendix „Hardware Description“ of the user manual for more information about the correct pin connections of the CAN interface. Host PC Target system CAN-Debugging via fast-PC67C/PCI

C167

Serial / BSL* C167 C167

CAN

fast-PC67C/ISA * Serial cable for Bootstrap Loader required only

8. Start your computer system and login with administrator rights. 9. Read the file RELEASE.HTM for the latest software changes. 11. Start SETUP.EXE from the UDE CD-ROM and follow the instructions on the screen. A detailed description of the software installation is followed in the chapter "Installing Software". 12. After a few additional steps, the installation program lets you choose to launch UDE automatically. The UDE workbench is now installed and ready to use.

If you have trouble while installing the product, please contact the PLS Support Team at [email protected].

? Please pay attention to the chapter „Static Electricity Precautions“ containing important information about required ESD protection of the access devices.

Installing of Universal Debug Engine Installing Hardware 29 of 167 Standard Version UAD2+ (with Trace Support) The hardware installation of Universal Access Device is done within the following steps: 1. Connect the Universal Access Device 2+ (connector 'IEEE1394') with an IEEE1394 connector of the installed IEEE1394 host adapter in your PC or the connector 'USB 2.0' with an USB connector or the connector ETH with an Ethernet network. 2. Connect the ground socket with the ground potential of your target hardware for discharging the static electricity and balancing ground potentials. 3. Connect the 'TRACE Target' connector of the UAD2+ (80-pin connector above the OCDS connector) with the corresponding target pod of your target hardware via the 80-wire flat ribbon cable. 4. If the "OCDS L2” or the “Nexus” or the "ETM" connector of the microcontroller board does not provide the "JTAG" signals, you have to connect the "JTAG" board connector with the "JTAG" connector of the Trace Pod by the 10" 20-wire JTAG cable. Otherwise, no further cable is required. Please see further detailed installing instructions in the chapter "Hardware Description". Host PC Target system JTAG Debugging and OCDS L2 or ETM Support Trans- former

Trans- Starterkit or Custom former Specific Target Hardware

Universal Access Device

or Universal Access Device 2+

IEEE1394, ETH USB 2.0

OCDS L2 or ETM or Nexus Trace

5. Start your computer system and login with administrator rights. 6. Connect the wall transformer's cable with the 'Power' jack to the Universal Access Device. 7. Read the file RELEASE.HTM for the latest software changes. 8. Start SETUP.EXE from the UDE CD-ROM and follow the instructions on the screen. A detailed description of the software installation is followed in the chapter „Installing UDE Software“. 9. After a few additional steps, the installation program lets you choose to launch UDE automatically. The UDE workbench is now installed and ready to use.

If you have trouble while installing the product, please contact the PLS Support Team at ? [email protected]. Please pay attention to the chapter „Static Electricity Precautions“ containing important information about required ESD protection of the access devices.

30 of 167 Installing Hardware Installing of Universal Debug Engine Standard Version UAD3+ (with Trace support) The hardware installation of Universal Access Device 3+ is done within the following steps: 1. Connect the Universal Access Device 3+ (connector 'IEEE1394b') with an IEEE1394b connector of the installed IEEE1394b host adapter in your PC or connect the connector 'USB 2.0' with an USB 2.0 connector of the installed USB host adapter in your PC (USB 2.0 is recommend, USB 1.1 is also possible) or the connector ‘Ethernet’ with a Ethernet network. 2. Connect the ground socket with the ground potential of your target hardware for discharging the static electricity and balancing ground potentials. 3. Connect one of the ‘Pod 1-4’ connectors with the JTAG Pod via the IO Pod Cable. Connect the JTAG-Pod with the Trace Adapter via the JTAG Adapter Cable. Connect the JTAG Adapter with the Trace connector of the target board. Do the same with the Trace Pod interfaces. Refer to the appendix „Hardware Description“ of the user’s manual for more information about the correct pin connections.

Trans-

Host PC Target system former

JTAG Debugging Starterkit or Custom Specific Target Hardware

Trans- former Universal Access Device 3+ Trace Trace Adapter Trace Pod Adapter

Cable Cable IEEE1394, ETH TRACE Pod USB2.0 IO Pod JTAG Adapter Cable Cable

JTAG Pod

4. Start your computer system and login with administrator rights. 5. Connect the wall transformer's cable with the 'Power' jack to the Universal Access Device. 6. Read the file RELEASE.HTM for the latest software changes. 7. Start SETUP.EXE from the UDE CD-ROM and follow the instructions on the screen. A detailed description of the software installation is followed in the chapter „Installing UDE Software“. 8. After a few additional steps, the installation program lets you choose to launch UDE automatically. The UDE workbench is now installed and ready to use.

If you have trouble while installing the product, please contact the PLS Support Team at ? [email protected]. Please pay attention to the chapter „Static Electricity Precautions“ containing important information about required ESD protection of the access devices.

Installing of Universal Debug Engine Installing Hardware 31 of 167 UAD2-JTAG Protector 2 for UAD2 In hard process environments it is strongly recommended to use the JTAG-Protector described below. This adapter allows an extended protection of the Universal Access Devices and other JTAG based devices from the danger of over-voltage and ESD. The hardware installation of Universal Debug Engine is done within the following steps: 1. Connect the UAD2-JTAG Protector 2 connector 'UAD2' (female connector) with the JTAG connector of Universal Access Device (UAD2). 2. Connect the UAD2-JTAG Protector 2 connector 'Target' (male connector) with the JTAG ribbon cable to your target.

Please note, that the function of the JTAG protections can be ensured only, when the ! ground and target power connections (MCU I/O voltage) are established.

Host PC ESD JTAG Target system JTAG Debugging Protector

Trans- former Trans- former Universal Access Device

Signal line +

Ground line

Target Hardware

Additional Ground line required in case of potential differences

Host Ground UAD Ground Target Ground

If you have trouble while installing the product, please contact the PLS Support Team at ? [email protected].

Please pay attention to the chapter „Static Electricity Precautions“ containing important information about required ESD protection of the access devices. Please note, that the JTAG Protector DOES NOT suspend the precautions described in this chapter.

32 of 167 Installing Hardware Installing of Universal Debug Engine UAD-JTAG Protector 2 for UAD2+ In hard process environments it is strongly recommended to use the JTAG-Protector described below. This adapter allows an extended protection of the Universal Access Devices and other JTAG based devices from the danger of over-voltage and ESD. The hardware installation of Universal Debug Engine is done within the following steps: 1. Connect the UAD-JTAG Protector 2 connector 'UAD' (female connector) with the JTAG connector of JTAG Extender. If the JTAG-Extender is not equipped with a male shrouded header, please contact the PLS Support. 2. Connect the UAD-JTAG Protector 2 connector 'Target' (male connector) with the JTAG ribbon cable to your target.

Please note, that the function of the JTAG protections can be ensured only, when the ! ground and target power connections (MCU I/O voltage) are established.

Host PC ESD JTAG Target system JTAG Debugging Protector

Trans- former

Trans- Starterkit or Custom former Specific Target Hardware Universal Access Device 2+

IEEE1394, ETH

USB2.0 JTA G JTAG Extender + JTAG Protector Additional Ground Additional Ground

line required in case of potential differences line required

Host Ground UAD Ground Target Ground

If you have trouble while installing the product, please contact the PLS Support Team at ? [email protected].

Please pay attention to the chapter „Static Electricity Precautions“ containing important information about required ESD protection of the access devices. Please note, that the JTAG Protector DOES NOT suspend the precautions described in this chapter.

Installing of Universal Debug Engine Installing Hardware 33 of 167 Simulator Version (TSim) The hardware installation of Universal Debug Engine is done within the following steps: 1. Connect the USB-Key with an USB connector of your PC. 2. Follow the driver installation when the 'New hardware found' dialog appears. 3. Read the file RELEASE.HTM for the latest software changes. 4. Start SETUP.EXE from the UDE CD-ROM and follow the instructions on the screen. A detailed description of the software installation is followed in the chapter „Installing UDE Software“. 5. After a few additional steps, the installation program lets you choose to launch UDE automatically. The UDE workbench is now installed and ready to use.

If you have trouble while installing the product, please contact the PLS Support Team at ? [email protected].

34 of 167 Installing Hardware Installing of Universal Debug Engine Installing UDE Software

Working with the CD browser The CD browser helps you to install the UDE software and further software components and demo versions, e.g. GNU C/C++ Compiler and CASE Tools.

Please insert the Universal Debug Engine CD-ROM. The CD browser will start automatically. If not, please start the SETUP.EXE from the CD-ROM root manually. The UDE CD-ROM contains following chapters:  Readme UDE 4.0 – Contains important information about the current UDE installation and requirements. Please read it first.  Install UDE 4.0 Software – Start the installation process of the Universal Debug Engine. You can install the full version of UDE (communication device required) or test a demo version of UDE for Starterkit.  Install UDE Samples – Start the installation process of the Universal Debug Engine’s Sample directory. It contains code samples for supported compilers, target architectures and evaluation boards.  Install 3rd Party Products – Install demo versions of software, which enhance the UDE installation, e.g. a CASE Tool.  Information and Manuals – Find out more about all of the UDE products.  How to contact PLS – guides you to the directly contact to PLS via Email, Web and Mail.

Installing of Universal Debug Engine Installing UDE Software 35 of 167 Start the Installation

When a new version of UDE is started the first time, a firmware update may be executed on the access device (UAD, UAD2 ...). This may take some more time than usual for the target connect operation. Please DO NOT power off or unplug the access device while this time!

Before you can use the Universal Debug Engine, you must install the software components by using the UDE CD-ROM. To install the software, follow these steps: 1. Read the file RELEASE.HTM for the latest software changes. 2. Start SETUP.EXE from the UDE CD-ROM.

3. Click Next to continue the installing process or click Cancel for aborting. 4. Check the license terms and your customer information and click Next to continue. 5. Choose the destination location installation via the Browse button. Please advise an empty or new directory for the UDE software. Click Next. 6. Select the Program Folder and click Next to continue. 7. Click Next to continue the installation process. 8. Select the required drivers  Communication Device Support  UAD2, UAD2pro, UAD2+, UAD3+, UAD2compact Support  UAD Parallel Port Driver – UAD Support  fast-PC6x Communication Driver – fast-PC67, fast-PC276 Support  Sentinel SuperPro USB Driver – USB-Key for Simulator support 9. Click Next to continue the installing process. 10. Check the selected components you want to install and click Next to start the installing process.

Note: The step depends on your selection of the target access and UDE version respectively. The following step describes what you have to do for each target communication channel. However, you have the possibility to select one or more target access channels, which will be installed one after the other. In this case, please follow the ! corresponding installing description.

36 of 167 Installing UDE Software Installing of Universal Debug Engine Driver Installation for Universal Access Device If the previous steps are done successfully, the software will install the hardware driver components. The Universal Access Device is capable to communicate via parallel port interfaces and IEEE1394-OHCI interfaces. Please follow the corresponding instructions.

When a new version of UDE is started the first time, a firmware update may be executed on the access device (UAD, UAD2, Uad2pro, UAD3 ...). This may take some more time than usual for the target connect operation. Please DO NOT power off or unplug the access device while this time!

UAD via standard parallel port interface

Please note: The usage of a dongle and the Universal Access Device at the same time on the same parallel port is not possible, because in some cases the simultaneous usage of the dongle disturbs the communication to the Universal Access Device.

! We strongly recommend either to use dongle on the second parallel port or to communicate with the Universal Access Device via the IEEE1394 interface.

1. Click the check box "Universal Access Device" and "Parallel Port Driver" for installing the Standard Version with Universal Access Device and the host communication channel via a standard parallel port interface. 2. The driver installation begins with the dialog box "Step 1: Driver Installation". Click Next to continue the installing process. 3. Select the free parallel port for using. Possible selections are LPT1 and LPT2. Please disconnect all devices from the selected parallel port and click Next to continue the installing process. 5. The installation process searches for the selected port and gives information about the port. Please connect now the Universal Access Device with the selected port via the 25-wire parallel cable and apply power to Universal Access Device. 6. Click Next to test the communication with Universal Access Device. 7. If the test was successful, you can finish the driver installation. If the test failed, ensure that all cables and connections are correct. Click Finish to continue.

Please note that the best transfer performance between the Host PC and the target can only be achieved if the parallel port interrupt is usable and the port is in EPP mode. Use the EPPSetup.exe tool from your UDE installation to verify your parallel port installation. It ! is recommended enabling the parallel port interrupt and the EPP mode.

Installing of Universal Debug Engine Driver Installation for Universal Access Device 37 of 167 UAD2+ via IEEE1394 Because of the Plug 'n Play-Capabilities of UAD and UAD2+ the IEEE1394 driver installation is started automatically, when the Universal Access Device is connected to the host PC the first time. 1. Power ON the Universal Access Device. 2. Connect the UAD or UAD2+ with the host adapter of your PC using the 6-wire cable. The Windows system will find a new hardware device on your system called "Universal Access Device" in the “pls Debugging Devices” group and you will be prompted to install a new device driver. 3. Click Next to continue. 4. Click Search for a suitable driver and click Next. 5. Click Specify a location, click Next and browse for the driver file \SETUP\DRIVER\UADDEVS\UADDEVS.INF driver on your UDE CD-ROM. 6. Click Next and Finish.

In the case of problems, please verify the correct installation. Open the Device Manager, the following entries are shown:  IEEE 1394 Bus host controllers  Your host bus controller  pls Debugging Devices  Universal Access Device/Universal Access Device 2  If one of the entries is marked with a question mark, please unplug and plug the UAD again and repeat the installation if necessary.

Please see the chapter „Hardware Description“ of the user’s manual for additional ? information.

38 of 167 Driver Installation for Universal Access Device Installing of Universal Debug Engine UAD3+ via IEEE1394b Because of the Plug 'n Play-Capabilities of UAD3+ the IEEE1394b driver installation is started automatically, when the Universal Access Device is connected to the host PC the first time. 1. Power ON the Universal Access Device. 2. Connect the UAD3+ with the host adapter of your PC using the 9-wire IEEE1394b cable or a 6-9-wire IEEE1394 bilingual cable. The Windows system will find a new hardware device on your system called "Universal Access Device" in the “pls Debugging Devices” group and you will be prompted to install a new device driver. 3. Click Next to continue. 4. Click Search for a suitable driver and click Next. 5. Click Specify a location, click Next and browse for the driver file \SETUP\DRIVER\UADDEVS\UADDEVS.INF driver on your UDE CD-ROM. 6. Click Next and Finish.

In the case of problems, please verify the correct installation. Open the Device Manager, the following entries are shown:  IEEE 1394b Bus host controllers  Your host bus controller  pls Debugging Devices  Universal Access Device 3 If one of the entries is marked with a question mark, please unplug and plug the UAD again and repeat the installation if necessary.

Please see the chapter „Hardware Description“ of the user’s manual for additional ? information.

Installing of Universal Debug Engine Driver Installation for Universal Access Device 39 of 167 UAD2, UAD2pro, UAD2+, UAD3+ via USB port Because of the Plug 'n Play-Capabilities of UAD2, UAD2+ and UAD3+ the USB driver installation is starting automatically, when the Universal Access Device 2 or Universal Access Device 3 is connecting to the host PC the first time. 1. Connect the UAD2, UAD2pro, UAD2+ or UAD3+ to the PC host system using the USB cable. The Windows system will find a new hardware device on your system called “Universal Access Device 2” or “Universal Access Device 3” in the “pls Debugging Devices” group and you will be prompted to install a new device driver. 3. Click Next to continue. 4. Click Search for a suitable driver and click Next. 5. Click Specify a location, click Next and browse for the driver file \SETUP\DRIVER\UADDEVS\UADDEVS.INF driver on your UDE CD/ROM. 6. Click Next and Finish.

In the case of problems, please verify the correct installation. Open the Device Manager, the following entries are shown:  Universal Serial Bus controllers  Your host bus controller  pls Debugging Devices  Universal Access Device 2 If one of the entries is marked with a question mark, please unplug and plug the UAD2 or UAD3 again and repeat the installation if necessary.

Please see the chapter „Hardware Description“ of the user’s manual for additional ? information.

40 of 167 Driver Installation for Universal Access Device Installing of Universal Debug Engine UAD2+, UAD3+ via Ethernet TCP/IP The UAD2+ is equipped with a 100 Mbit/s fast Ethernet interface. The UAD3+ is equipped with a 1000 Mbit/s (1GBit/s) Ethernet interface. It can be connected to a local PC or to a Local Network via Hubs or to . The UAD2+ and UAD3+ support both, DHCP and static IP addressing.

Connection methods Before using UAD2+ or UAD3+ for debugging purposes, the devices must be configured properly. It can be communicating to the UDE via TCP/IP protocol. The only thing to set is valid IP (Internet Protocol) addresses. There are two possibilities: 1. Using DHCP, this requires a DHCP server on your network 2. Using static IP address, this requires exactly knowledge of the network structure (e.g. knowledge of free IP addresses so that there is no IP used twice in the network). At delivery time, the UAD2+ or UAD3+ was configured with DHCP enabled. After power on it tries to get an IP address from a DHCP server. When there is no DHCP server answering, the UAD2+ or UAD3+ will fall back to static IP address after 60 seconds. The static fall back IP address is 192.168.1.100. The UAD2+/UAD3+ use the following TCP ports for communication: 43690 (0xAAAA) and 43691 (0xAAAB)

Configuration the IP address via Ethernet For reconfiguration the UAD2+ or UAD3+ configuration can be changed using a web browser. The current IP address must be known. This IP address must be entered as the web address, e.g. http://192.168.1.74 and the UAD2 Configuration Page or UAD3 Configuration Page appears. In the left side the serial number of the UAD2+ or UAD3+ and the current configuration is shown.

Installing of Universal Debug Engine Driver Installation for Universal Access Device 41 of 167

In this case DHCP is enabled and the current IP address is 192.168.1.74. In the right side new settings could be entered. The IP address will also be used when DHCP is enabled but there is no DHCP server inside the network. After clicking 'Apply' the new settings are stored. They will be activated after next power on of the UAD2+ or UAD3+.

Configuration the IP address via USB/IEEE1394 If the IP address of the UAD2+ or UAD3+ is unknown, another configuration mechanism is possible: For that the UAD2+ or UAD3+ must be connect either to USB or Firewire. Go to the device manager’s property page of the UAD2+ or UAD3+ and select Ethernet Config.

The Ethernet Configuration dialog appears where the same settings could be made.

42 of 167 Driver Installation for Universal Access Device Installing of Universal Debug Engine Once the UAD2+ or UAD3+ are configured well a connection via UAD2+ or UAD3+ can be established. For that create a new workspace, and select your target configuration. If default is set as communication device and there is no other UAD2+ or UAD3+ connected, the Ethernet device is found. If not, open the menu Config - Target interface... inside UDE or menu Target - Setup inside MemTool. In the Target Interface Setup dialog select and click on the Setup button.

For using the TCP/IP communication the Select Communication Device dialog is opened. You can select the specific access device that you want to use. These settings are stored in the target configuration *.cfg file format. For Ethernet connections select UAD2 device, attached to Ethernet port. A specific IP address to connect can be entered or an UAD2+ or UAD3+ can be selected from the list after retrieving available devices. Pressing OK stores the settings. A connection is established now. If multiple UAD2+ or UAD3+ are used at the same time (e.g. for automated flash programming), then every UAD2+ or UAD3+ have its own target configuration with either unique IP or unique serial number.

Installing of Universal Debug Engine Driver Installation for Universal Access Device 43 of 167 Driver Installation for USB-JTAG-Port Because of the Plug 'n Play-Capabilities of the USB-JTAG-Port, the USB driver installation is started automatically, when the USB-JTAG-Port is connected to the host PC the first time.

USB-JTAG-Port via USB port 1. Connect the USB-JTAG-Port to the PC host system using the USB cable. The Windows system will find a new hardware device on your system called "USB- JTAG-Port" in the “UDE JTAG-Port Devices” group and you will be prompted to install a new device driver. 3. Click Next to continue. 4. Click Search for a suitable driver and click Next. 5. Click Specify a location, click Next and browse for the driver file \SETUP\DRIVER\USB-JTAG-Port\USBJTAG.INF driver on your UDE CD/ROM. 6. Click Next and Finish.

In the case of problems, please verify the correct installation. Open the Device Manager; the following entries are shown:  Universal Serial Bus controllers  Your host bus controller  UDE USB-JTAG Devices  UDE USB-JTAG-Port If one of the entries is marked with a question mark, please unplug and plug the JTAG- Port again and repeat the installation if necessary.

44 of 167 Driver Installation for USB-JTAG-Port Installing of Universal Debug Engine Driver Installation for USB-Key (Sentinel USB SuperPro) Because of the Plug 'n Play-Capabilities of the USB-Key the USB driver installation is started automatically, when the USB-Key is connected to the host PC the first time.

USB-Key via USB port 1. Connect the USB-Key to the PC host system using the USB port. The Windows system will find a new hardware device on your system called "USB SuperProNet" or "USB SuperPro" or "USB UltraPro" in the “Universal Serial Bus controller” or “Other devices”. Default the driver is installed while the UDE installation process. 2. To install the drivers manually click on the installing program located at \3rdparty\Rainbow Combo Installer\SETUP.EXE driver on your UDE CD/ROM. 3. Click Next and Finish.

Installing of Universal Debug Engine Driver Installation for USB-Key (Sentinel USB SuperPro) 45 of 167 Driver Installation for fast-PC6x Card

fast-PC67C/PCI via PCI Bus Host PC If you have inserted fast-PC67C/PCI in your PC in one of the 32-bit PCI slots, during the system start-up the operating system recognizes the new hardware. The PCI enumeration process during start-up detects the new fast-PC67C card as PCI Simple Communications Controller in the system and requests for a new driver for the card after system login. 1. The New Hardware Wizard will open. Click Next to start the driver installation process. 2. Click Search for a suitable driver and click Next. 3. Click Next to continue the installing process. 4. Click Specify a location, click Next and browse for the driver file location \SETUP\DRIVER\fastPC6x\FSPC_6XW.INF on your UDE CD/ROM or disk. 5. The next box let you enable or disable the new hardware in the hardware profiles. Click Next. 6. The box shows detailed information about the device driver and the firmware. Click Next. 7. A short hardware test will be executed. If the test was successfully, click Next. 8. If the driver installation was successfully, click Finish or Close.

46 of 167 Driver Installation for fast-PC6x Card Installing of Universal Debug Engine Driver Installation for Starterkit Version

JTAG Parallel Port via Standard Parallel port 1. Click the check box "Starterkit JTAG Parallel Port" for installing the Starterkit Version with parallel port support (Onboard JTAG adapter) or use the prepared "Installation for Starterkit" version of UDE. Click Next to continue the installing process. 2. The driver installation begins with the dialog box "Step 1". Click Next to continue the installing process. 3. Select the free parallel port for using. Possible selections are LPT1 and LPT2. Please disconnect all devices from the selected parallel port and click Next to continue the installing process. 4. The JTAG parallel port Driver for direct communication via standard parallel port will be installed. Finish the driver installation.

Serial Port via Standard Serial Port 1. Click the check box "Standard Serial Port Support – COMx Support" for installing the Starterkit Version with serial port support or use a prepared "Installation for Starterkit" version of UDE. Click Next to continue and complete the installing process. 2. For setup the right COMx port selection, please ensure the right standard port (often COM1 or COM2). Set the corresponding COMx port to UDE, if the connection to the evaluation board cannot be established. In the dialog "Can't establish Connection to Target" push the Change button, push the button Setup on the page General and change the port number to the memorized port from the Device Manager.

Serial Port via USB-to-Serial Port 1. Install the USB-to-Serial Converter driver from the CDROM browser or directly from the CDROM located at \3rdparty\usb-rs232\ . The drivers have to be installed before you connect the converter to an USB port. 2. Click the check box "Standard Serial Port Support – COMx Support" for installing the Starterkit Version with serial port support or use a prepared "Installation for Starterkit" version of UDE. Click Next to continue and complete the installing process. 3. For setup the right COMx port selection, please open the Device Manager and search for Ports (COM & LPT). The USB Converter is located as "Prolific USB-to- Serial COMx Port (COM3 or higher)". Set the corresponding COMx port (e.g. COM3 in this case) to UDE, if the connection to the evaluation board cannot be established. In the dialog "Can't establish Connection to Target" push the Change button, push the button Setup on the page General and change the port number to the memorized port from the Device Manager.

Installing of Universal Debug Engine Driver Installation for Starterkit Version 47 of 167 License Manager

When a new version of UDE is started the first time, a firmware update may be executed on the access device (UAD, UAD2 ...). This may take some more time than usual for the target connect operation. Please DO NOT power off or unplug the access device while this time!

During the installation process, you will be asked for a license key. You got your personal license key with consignment of Universal Debug Engine. You can also find the license key within the UDE CD-ROM case. Please enter the key into the left edit field and click Add. A new key entry will be added, if the license key is valid. Pushing the Button OK applies the changes to the system. Otherwise licenses are distributed as key file with the extension *.ukf. Use the button Add Key File to browse and select a new key file.

If you expand your feature list of UDE, you will get further license keys. These keys will either replace an older key or complement your key list. Please use the Help - License Manager from the system menu of UDE to open the License Manager. If you do not have a valid license key for a desired feature, a message box "License check failed" will appear as soon as you request this feature.

Please note that one license key is valid for the combination of one Universal Access ! Device with one supported target architecture only.

48 of 167 License Manager Installing of Universal Debug Engine Node-locked licensing Universal Debug Engine products will be licensed by node-locked licensing, if the product package does not contain any additional access device, which will be used normally for licensing of UDE. For this type of licensing the customer will receive an activation key with his license documents. This activation key is the basic reference identifier assigned to his UDE license. The activation process for a node-locked licensing based UDE product will cover the following steps: 1. The customer receives the activation key with his license documents and installs UDE on his Windows PC 2. The customer determines the host identifier of his PC. How to obtain this host ID will be described in the following chapter 3. The host ID must be transmitted to PLS’ support (email to [email protected] ) with the corresponding activation key from the UDE license documents. 4. He will receive the license file from PLS and install the license file using UDE license manager dialog.

How to get the Host ID of UDE Installation This chapter describes three methods to obtain the host ID, which is required for generation a node-locked license file.

Obtain Host Identifier via Script The following 3 lines of script code must be saved at local disk as Script file GetHostID.vbs: set LicenseServer = CreateObject ("UDE.LicenseServer.4.0") RequString = LicenseServer.RLMHostID WScript.Echo "PC Host ID:" & vbcrlf & RequString This script must be executed by following Windows command line: CScript GetHostID.vbs > HostID.txt The content of the file HostID.txt hast be send to PLS’ support mailbox (support@pls- mc.com ) with the activation key from license documents.

The script COM-object identifier of the UDE license server is version depended. The COM-object id listed in the script code above is the COM-object id of UDE license server of UDE version 3.0. If higher UDE version is used, the first line of code must be changed.

The COM-object Id must be expressed as set LicenseServer = CreateObject ("UDE.LicenseServer..") For UDE version 4.0 this script code line must be changed to: set LicenseServer = CreateObject ("UDE.LicenseServer.4.0")

Obtain Host Identifier via UDE License Manager The following steps must be executed to obtain the host identifier by UDE license manager: 1. Start UDEOpenPlatform.exe or UDEDesktop.exe 2. Open UDE main menu Help and use License Manager to open UDE license manager dialog The content of the dialog field Host Identifier can now be copied to Windows clipboard.

Installing of Universal Debug Engine Node-locked licensing 49 of 167

The copied text string hast be send to PLS’ support mailbox ([email protected]) with the activation key from license documents.

Obtain Host Identifier via UDE License Key Request Form All information, which is required for license activation, can be delivered by UDE license request form. The usage of service requires an active UDE configuration is normally used by subsequent request for updated license keys. The following step must be executed to create the appropriate information in this case: 1. Start UDEOpenPlatform.exe or UDEDesktop.exe 2. Open UDE main menu Help and use submenu UDE License Key Request Form to open UDE license key request form

3. Fill all necessary fields of the license key request form, such as user name, department, e-mail address and license activation key

50 of 167 Node-locked licensing Installing of Universal Debug Engine 4. Fill the Save as ZIP file field by a local hard disk path and press the Save ZIP File button. 5. Close this dialog This ZIP file contains all necessary information and can be sent directly to PLS’ support ([email protected]) without any further information.

Setup of Node-Locked License File After sending the host identifier of your Windows PC to PLS you will get a license file, which contains all licenses for all architectures, which are part of this license. The license file has the extension *.lic and the license file contains several lines: ISV pls-mc LICENSE pls-mc ude_tricore 2010.09 permanent uncounted hostid=ANY options=Starterkit|Simulator _ck=051ea537fb sig="60P0453CGHCUHR0XBGA WQY622179HMSAFCC4UWR22GH6J8MGY0P0EREHG5G0925R6AJMNQAUP8" LICENSE pls-mc ude_tricore_pcp 2010.09 permanent uncounted hostid=ANY options=Starterkit|Simulator _ck=a71ea5a55a sig="60P0453609KDHHSAXT1 22XVNQ760EABXRQ6GEC022GM184JT750TCB1E80WDHPM7MARTNY0KTG" Typically, the license arrives as attachment of a mail from PLS’ support team. The attachment should be saved to a local hard disk path. The UDE license manager dialog must be used to activate this license for UDE. The following steps must be executed to activate the node-locked license by UDE license manager: 1. Start UDEOpenPlatform.exe or UDEDesktop.exe 2. Open UDE main menu „Help“ and use submenu “License Manager” to open UDE license manager dialog

3. Press Add NL License File and browse with the opened file input explorer to your local copy of the license file. 4. After successful import the license manger dialog will be updated and displays the additional node-locked licenses.

Installing of Universal Debug Engine Node-locked licensing 51 of 167 Uninstalling or Reinstalling UDE For uninstalling the Universal Debug Engine (UDE) workbench, you may use the 'Add/Remove Programs' feature from the Control Panel or the Remove function of the Setup program. The uninstall function will remove all UDE components except the user changed files as workspaces.

Note: If you made any modifications on the examples and you want to keep these changes, copy or move the example source files to another location before uninstalling or reinstalling of UDE. However, the uninstall procedure will not delete other projects and ! files.

For uninstalling of UDE execute the following three steps: 1. Click Start from system menu, choose Settings and open the Control Panel. 2. Choose the 'Add/Remove Programs' Icon and open it. 3. Select 'Universal Debug Engine' and click Change/Remove ... Button.

For reinstalling the Universal Debug Engine start the Setup program SETUP.EXE from the UDE for TriCore CD-ROM. In the first step, the previously installed components of UDE are removed. Please follow the instructions on the screen.

52 of 167 Uninstalling or Reinstalling UDE Installing of Universal Debug Engine Trouble Shooting Please read this manual and the hints very conscientious. If the problem is not soluble, the fastest way is to fill in the 'Problem Report Form' at the end of this manual and fax it to the PLS Support Line at [email protected]. Our Support team will contact you as soon as possible.

Precautions

When a new version of UDE is started the first time, a firmware update may be executed on the access device (UAD, UAD2 ...). This may take some more time than usual for the target connect operation. Please DO NOT power off or unplug the access device while ! this time!

Latest Versions on World Wide Web You may find the latest versions of Universal Debug Engine, fast-view66 and other components on our Web site http://www.pls-mc.com/download.htm for downloading. ? Please see also the FAQ site on http://www.pls-mc.com/faq.htm. Known Issues with UDE

Installation fails Please make sure that you have full rights (administrator rights) for the installation process of UDE.

IEEE1394 Port Installation fails In some cases it is possible, that the Plug and Play mechanism does not work immediately. Please try in this case new Plug and Play detection by disconnecting the IEEE1394 cable from the Universal Access Device. Power first the Universal Access Device and after that connect the IEEE1394 cable with the Universal Access Device again. If the installation was successfully, the “Universal Access Device” is visible in the folder “pls IEEE1394 Debugging Device” of the Device Manager (Control Panel - System - Device Manager) or the hardware wizard asks for a new driver.

UAD2/ UAD2+ does not enumerate at USB-Bus This could happen, when an UAD2, UAD2+ is connected to a target without powering UAD2, UAD2+. When the target system gets power before the UAD2, UAD2+ it is possible that it does not connect correctly to USB. In this case, power off target, power off UAD2, UAD2+, disconnect USB and disconnect the target from UAD2. Then power on UAD2, UAD2+, connect to USB, power on target and connect both together. If the problem persists, please contact the PLS Support Team at [email protected].

Installing of Universal Debug Engine Trouble Shooting 53 of 167

Getting Started

Examples delivered with UDE The Universal Debug Engine comes with a set of example programs demonstrating the features of UDE. The examples are compiled with the available Compilers for starterkit boards and evaluation boards and are located depending on the Windows OS version: Windows XP: \Samples Windows Vista, Windows 7, Windows 8:\pls\UDE4.0\Samples

ARM7 Example programs for ARM7 derivatives

ARM9 Example programs for ARM9 derivatives

ARM11 Example programs for ARM11 derivatives

C16x Example programs for C167, ST10F167, ST10276 and other derivatives

C166CBC Example programs for C161U, C165UTAH and other derivatives

CortexM3 Example programs for Cortex-M3 derivatives

PowerPC Example programs for PowerPC derivatives

SuperH Example programs for SuperH derivatives

TriCore Example programs for TriCore derivatives

TriBoard_TC1130 Example programs for TriCore TC1130

TriBoard_TC1796 Example programs for TriCore TC1796 Example program lets flash the LED using the PCP. This Example is delivered HelloPCP for TriCore derivatives with PCP on-chip available only

Sieve Example demonstration of the Simulated I/O capabilities, source code directory

TimeDemo Example demonstration of the variables auto refresh mode and using interrupts

GnuTC Example directory GNU Compiler, contains source, locater and makefiles.

Ram Example located for using in external RAM, contains binary and mapping file

iRam Example located for using in internal RAM, contains binary and mapping file

Rom Example located for using in external ROM, contains binary and mapping file

iRom Example located for using in internal ROM, contains binary and mapping file

TaskingTC Example directory Tasking Compiler, contains source, locater and makefiles

XC16x Example programs for XC161, XC167 and other derivatives

XC2000 Example programs for XC2287, XC2267 and other derivatives

XScale Example programs for XScale derivatives

Getting Started Examples delivered with UDE 55 of 167 A First Example with TriCore™ We assume that you now have successfully installed the Universal Debug Engine (UDE) version. In this section you will learn about...  how to start UDE  how to use the windows in UDE  and how to load and start and furthermore principles of how to debug an existing application. We recommend you to go through this tutorial step-by-step. This example is shown under Windows Vista and using the TriCore TC1796 TriBoard Starterkit offered by Infineon Technologies with the communication add-on "Universal Access Device 2". For further supported controllers please see the compatibility list below. For the correct setup of the board see the chapter „Hardware Description Starterkit boards“ in the Hardware Appendix of the UDE manual.

Precautions

When a new version of UDE is started the first time, a firmware update may be executed on the access device (UAD, UAD2 ...). This may take some more time than usual for the target connect operation. Please DO NOT power off or unplug the access device while ! this time!

Starting Universal Debug Engine Once the operating system is up and running, double-click on the icon UDE on the desktop. Alternatively, UDE may be launched also via Start - Programs - Universal Debug Engine - UDE Desktop. This will start the desktop of UDE development system.

The next step is creating a new workspace. An UDE workspace saves all configurations and settings of UDE Desktop, windows and their content, path and name of loaded files. The file extension is *.wsx Click New Workspace from the File menu and choose a new file name from the file selection box, e.g. TC1796_TriBoard.wsx . After creating the new workspace, you will be asked to select a target hardware configuration. UDE comes with some default target configurations of starterkits. Click Default button and enable the "Use a default target configuration" to select a predefined configuration. In a later chapter the creation of a new target configuration is described too.

56 of 167 A First Example with TriCore™ Getting Started For this example a communication hardware add-on as the UAD2 is using. The TriBoard with TC1775B configuration is available under the entry "TriCore - TriBoard with TC1796 (JTAG/OCDS)". The content of the parentheses describes the target communication channel, JTAG with OCDS L1 support in this case.

Select this entry and click Finish. Set the name for the target configuration, e.g. TriBoard_TC1796.cfg. In the "Select target Configuration" dialog click OK. When executed successfully, the UDE for TriCore Workbench appears:

When a dialog "License Check Summary" appears, a valid license is not available. There are some reasons for that. Your license key, you have got within the delivered UDE package, was not published to UDE. Use the menu Help - License manager for inserting the key string. Alternatively, the hardware add-on is not connected or powered on. Please ! use the Device Manager from the Control panel for validation.

Getting Started A First Example with TriCore™ 57 of 167 When launching UDE for the second time, you may use either File - Open Workspace or File - Recent Workspaces to select the workspace and start a new session with settings from the saved workspace. If you get an error message, return to the section Software Installation and make sure that all settings are correct. Refer also to the Troubleshooting section to get further information. If the problem persists ask the PLS Support Team at [email protected] for qualified help.

Loading a TriCore Executable After having UDE for TriCore started, we want to load a program that can be executed on the TriCore Starterkit board. First, the GNU compiler variant of the Hello example located for using in the internal RAM has to be used. This example is a basic demonstration and toggles the LED on the TriBoard only. The example is located to the internal sRAM of the TriCore TC1796 at memory address 0xD400'0000. Select from the UDE menu Load Program in the File menu bar, browse to \SAMPLES\ TriCore\TriBoard_TC1796\Hello\GnuTc\iRam\Hello.elf. In the workbench, the Program window appears showing the source code of the main function of the sample application. When clicking with the right-hand mouse button into the Program window, a context button appears to between Source code only and Source/Assembly code display via the Mixed Mode entry.

Project management A docked window at the left-hand side of the UDE desktop houses the Explore Symbols tab where the application's source files and their inside procedures are shown after unfolding the markers. If no workspace window is shown, you can make it visible via the menu Window - Project Workspace. The UDE project contains source files, C/C++ functions, address sections and user-defined breakpoints. By double-clicking on one of the source files, the selected file will be brought into the Program window; by double-clicking on one of the procedures, the selected procedure is displayed. After loading the program code, the Program window shows following content.

In the Program window, a yellow arrow indicates the current instruction pointer position.

58 of 167 A First Example with TriCore™ Getting Started

Please note: After downloading a program executable, the instruction pointer is set to the entry point of the program. Usually the entry point is located at the start-up code. That is why the default C/C++ Program window above does not show an instruction pointer. To force the view of the current instruction pointer use the context menu Show Next ! Statement or the main menu Show - Show IP.

Running and Stepping through the Application After the application has been loaded successfully, you may open now the menu Debug to run or step through the example procedures. The icons from the Debug menu are also located in the tool bar covering the same functionality. Short cuts are available too. Click now onto the Start Program Execution entry or button and watch the LED on the TriCore Starterkit board flashing the Morse code for UDE. When clicking onto Break Program Execution, the application is halted and the current instruction pointer position (code line) is displayed. You may also step through the application by using Step over Subroutine (steps with freely executing subroutines in one-step) or Step into Subroutine with following function calls and executing subroutines instruction by instruction.

Note: For debugging the C/C++ parts of the example program only, the start-up code must be executed first. For this, make a Step over Subroutine from the Debug menu of UDE. After that, the IP will be shown at the main function; the start-up code has been executed.

The application can be reloaded with Restart Program Execution. If the program is running already, it will be started immediately after the reload terminates.

Setting Breakpoints Now, we assumed that a loaded application is error-free and ready for running. However, for debugging purposes single step executions and breakpoints have to be performed to watch program behaviour and processor status. Now we want to set a breakpoint in the Hello program. To do this, click with the mouse on a line in a procedure and then click on the simple Hand symbol in the tool bar. A red-filled dot appears in the line indicating that the breakpoint has been successfully set. Alternatively, you may also select the menu Debug - Breakpoints... or the Hand symbol in the tool bar marked with 'D' to open the Breakpoints dialog.

Getting Started A First Example with TriCore™ 59 of 167 Within the Breakpoint dialog, breakpoints may be added, changed of type and deleted using the corresponding buttons. By clicking on the E/D (Enable/Disable) checkbox, you toggle the breakpoint between active and suspended. Disabled breakpoints are indicated by a red-shaped circle. Now start the application again. The application will be executed until the first breakpoint in the execution path is reached. The application will be stopped then immediately.

Note: The OCDS unit of the TriCore microcontroller supports an unlimited count of software breakpoints, but only four hardware breakpoints. The background is that software breakpoints are made by software code patching, which is only possible in writeable RAM areas. Hardware breakpoints are supported by the OCDS unit directly and ! can be used in read-only ROM areas only. The possibility of patched ROM areas (e.g. FLASH) is not realized in UDE because of the vendor-defined limited FLASH programming cycles.

Another possibility to execute certain portions of code without setting a breakpoint explicitly is placing the cursor into the line where the application is required to halt and then select Debug - Run Program to Cursor from the menu or Run to Cursor from the context menu.

CPU Registers The CPU Register window is opened by the menu View - CPU Window or the corresponding tool bar button. Perform a few single steps to see the CPU register values changing according to the executed instructions. Registers which values have been changed compared with the previous state are red highlighted to provide quick overview. While the program is stopped (e.g. between single steps) you may alter the content of registers. Simply click on the register's value in the CPU registers window and type in the new value of the register.

60 of 167 A First Example with TriCore™ Getting Started SFR Registers Special function register values are changed in the same way in the SFR Register window (open this window by selecting the menu View - SFR Window). To add a new register entry, select Browse Ins from the context menu of the SFR Register window and take the SFR that you want from the list.

Tooltips show the address, the reset value of the current SFR and further information about the focused register. Expand a SFR for viewing all available fields composing this register. With a right click on the values you can change them.

Various registers are protected which means that a special unlock sequence is required to change the register value. UDE can unlock these registers. Use the context menu of ! the register name and disable the entry Write protect.

Viewing Variables

Viewing and changing global/static variables All global and static variables from the C/C++ source code may be observed directly using the Watch window. Open the Watch Window by selecting the menu View - Watch Window or the corresponding tool bar button. The variables can be added by double- clicking to or using the context menu of the entry via Browse Ins. The browser dialog shows you all available global and static variables. Click Add for adding a new variable to the watch window. The variables are sorted in following groups:  Global Variables – shows all global variables with a global scope.  Static Variables (at file level) – shows only variables visible at a specific file.  Static Variables (at function level) – shows only static variables visible at a specific function.  Static Variables (all) – shows all static variables, which are not global variables.  All Global/Static Variables – shows all global and static variables.

Getting Started A First Example with TriCore™ 61 of 167  If the variable is expandable, i.e. it is a pointer or an array, clicking on the '+' sign in front of the variable's name will expand it. This means, that the location where the pointer points to or the content of the elements of the array will be displayed. Expanding is possible for more than one level. Variable values can be changed easily by double-clicking in the value area or pressing and typing in the new value.

Watch tips Furthermore, UDE offers so-called Watch tips, which show you the content of simple variables in the Program Window. Highlight i.e. the morse_bit_counter variable from the morse() function by a double-click, move the mouse pointer over and the content will be displayed in a watch tip after a short waiting time.

Viewing and changing local variables Viewing local variables is provided by the Locals Window that can be reached via the menu View - Locals Window. In this window, all currently valid local variables are displayed. The value of the local variable can be changed in the same way as in the Watch Window.

Viewing Memory Locations The Memory window which is available via View - Memory Window and enables to view and change memory areas in the TriCore's memory space. To change the memory's area set the cursor to the address row of the memory window and type in the new address. Memory locations itself can be changed by clicking on a memory location value and typing in the new value. Changed values are marked blue before they are written back to the memory. The memory window supports the viewing modes as , Word, DWord, Double, Fract and the ASCII representation of the memory area.

Leaving the Project To leave the current Project, select File - Close Workspace from the UDE Desktop menu. The workspace with all settings will be saved automatically. If you want to save the current project under a different project name, select Save Workspace As ... from File menu. In the file selection box the new workspace name must be selected and confirmed.

62 of 167 A First Example with TriCore™ Getting Started A Multi-Core Debugging Example with TriCore/PCP

The HelloPCP program delivers an example of how to use the PCP (Peripheral Communication Processor) of the TriCore chip. It demonstrates the multi-processor support of UDE. When running, a flashing LED on the TriBoard is displayed while the flashing pattern itself may be determined by a string in the source code. The string is translated into Morse code that turns out to flash the LED according to this code. Please note that in this example the PCP is the working horse serving the interrupts of the GPTU. The PCP code is contained in the source file MORSE.PCP. The TriCore itself is used only to initialize the PCP.

Creating a New Workspace with changed configuration At first, a new workspace has to be created. Click New Workspace from the File menu and choose a new file name in the opening file selection box. The next step extends the target configuration with the PCP controller. UDE comes with a number of prepared target configurations. For this example, the TriBoard with TC1796 configuration, used in the chapter above, has to be copied and changed. Select the entry "TriBoard with TC1796 (JTAG)" and click to Copy. In the configuration box, choose a new file, e.g. TriBoard_TC1796_PCP.cfg. The Target Configuration Dialog will be opened. This dialog gives the user the possibility to change your target hardware descriptions and settings.

Select the PCP entry as shown above, it enables the PCP debugging. Change the Target Description to ".. TC1796B and PCP (JTAG)". Click OK. Your workspace will be reconfigured and the workspace view shows two core debugger entries.

All windows can be allocated to one of the cores only, except the command view. To differentiate the both cores each window shows the allocated core as descriptor in the ! title bar, i.e. as Controller0.Core and Controller0.PCP.

Getting Started A Multi-Core Debugging Example with TriCore/PCP 63 of 167 When the connection is successfully established, the following messages will appear in the command window: Connection to TC1796 target monitor established: TriCore(Core), ID: 200B8083h Connection to TC1796 target monitor established: TriCore(PCP), ID: 200B8083h When both debuggers are launched, UDE is ready for loading the application file HelloPCP.elf.

Running the Program

After loading HelloPCP.elf into the TriCore target system, two program windows are displayed. One of them is the PCP program window while the other is the TriCore program window. Buttons and menu commands offered are related to the active debugger window.

To debug the PCP program, set a breakpoint in the PCP code, switch to the Core Window and execute a Step over Subroutine. This will initialize the PCP. After that click onto Start Program Execution of the TriCore code.

Please note, that the sequence described above must be executed exactly in this order. The background is that the start-up code transfers the PCP code to the PCP memory and overwrites any software breakpoints. To give the UDE the possibility to set a breakpoint ! to the PCP, UDE must have access to the PCP after the initialization. That is why the first step must be a Step over Subroutine.

The PCP program will stop at the breakpoint. Now you may for example step through the code, continue running the PCP program or watch the PCP registers.

HelloPCP Internals The TriCore program initializes the GPTU0, the PCP and the port P0. At the end of the program, the GPTU0 timer is started to provide recurrent interrupts to execute the PCP routines. The PCP program may be viewed like a state machine. Each interrupt causes the PCP to start in the following state (EXIT instruction with restart at next address). Each state ends with setting GPTU0 registers to proper values. When the timer of GPTU0 overflows, channel 1 of the PCP is restarted. This way, the PCP program will infinitely run and continuously send the string defined by const char morse_string[] ...

64 of 167 A Multi-Core Debugging Example with TriCore/PCP Getting Started A Multi-Core Debugging Example with TriCore2 AURIX Infineon recently introduced its 32-bit multi-core architecture AURIX (AUtomotive Realtime Integrated neXt generation architecture). The first AURIX architecture based MCU, part number TC275A, contains three TriCore processor cores (version 1.6). The following chapter describes the possibilities of debugging three cores of the example architecture AURIX. Multi-core debugging is possible with other architectures, too. The described multi-core features of UDE are available in the UDE Open Platform. Please run UDE Open/Visual Platform from the Window’s start menu.

Creating a New Workspace At first, a new workspace has to be created. Click New Workspace from the File menu and choose a new file name in the opening file selection box. UDE comes with a number of prepared target configurations (Default button). For this example, the TriBoard with TC275A configuration is suitable. Select the entry "TriCore - Infineon - TC275A Starterkit - TriBoard with TC275 A-Step (JTAG)" and click to Finish. In the configuration box, choose a file, e.g. TriBoard_TC275A.cfg. Select the created configuration and click to Edit to edit the target configuration.

The default target configuration contains all information about the Core0, Core1, Core2, GTM and FLASH devices. Core0 is the master core (TriCore1.6P), Core1 and Core2 are slave cores (TriCore1.6E) of the Core0. GTM support is disabled in this example. Click OK. When the connection is successfully established, the following messages will appear in the message view: Connection to TC275A_ED target established: TriCore(Core0), ID: 201DA083h Connection to TC275A_ED target established: TriCore(Core1) Connection to TC275A_ED target established: TriCore(Core2) When all debuggers are launched, UDE is ready for loading the multi-core application Timedemo.elf.

Preparing the debugger First, we want illustrade all of the debugger windows associated with a single core debugger with its own color, so that the associated windows can be better differentiated. Open the menu Config - Debug Server Configuration - Framework - Windows Tabs Color.

Getting Started A Multi-Core Debugging Example with TriCore2 AURIX 65 of 167 Select one of the core’s view server and assign a tab color to it. The selected color is now used for each window tab of the selected core debugger.

Loading a multi-core Executable UDE supports several possibilities to handle executables for multi-core architectures: 1. One executable is suitable for each core and there is only a single Elf file. 2. All executables of all cores are combined to a single Elf file. 3. Each core has its own Elf file. UDE handles this requirements via a multi-core / multi-program loader box, where can be selected, which executable is assigned to which core. This can be selected for binaries and symbols. Select from the UDE menu File - Load Program and browse to \SAMPLES\ TriCore\TriBoard_TC275A\Multicore_Timedemo\TriBoard_TC2 75A_Hightec_IntRam2\Timedemo.elf. This is an example of a single executable, which can be loaded into each core. That’s why, there is only the entry Timedemo.elf for all cores assigned. Select the required check marks.

UDE will load and transfer all binaries into the corresponding core and the symbols to the debugger symbol server. After that step, you can add new windows to each core debugger.

66 of 167 A Multi-Core Debugging Example with TriCore2 AURIX Getting Started Core selection To select the right core debugger, you can click into a core-specific window (with a colored frame tab) and the focus will be on this core debugger. The state bar below shows the current selected core debugger, too. For example, UDE can be visible as the following screenshot shows:

Core is halted and is focused, Core1 and Core2 (slave cores) are inactive and not focused. For each core a CPU window is opened.

Single-core Breakpoints A simple example is to set a breakpoint to a program location of a single core. Select a core’s program window and set the breakpoint via context menu in this program window. If the source file is not available, opens the CoreX Symbols window and select the source from the Source Files folder. In this first example, select Core1, set a breakpoint to line 83, select Core0 (only this core can be started in TriCore2 architecture) and run the program via Start Program Execution. This will start the Timedemo.elf on Core0, and Timedemo.elf will start Core1 und Core2 automatically. After a short time, Core1 stops, because the breakpoint is reached. Core0 and Core2 are running furthermore. After inspecting of Core1, it can be started via Start Program Execution again.

Getting Started A Multi-Core Debugging Example with TriCore2 AURIX 67 of 167 Multi-core Breakpoints and Stepping A multi-core application may require that in case of reaching of a breakpoint condition in one core, other cores must be halted and after that, the halted core must be started simultaneously. The Multi-core run group manager helps you to setup the combination of halting and starting of core groups. Open the manager via Config - Multi-core Run Control Configuration. Create a new group Core0 and Core1 and add Controller.Core0 and Controller.Core1 to this group.

Select the required properties of the run control group via check boxes. Break the program via Ctrl+F5. Core0 and Core1 are stopped simultaneously; Core2 is still running (because it is no part of a run control group). Select Core2 and stop it manually. Remove all breakpoints. Restart Program via F7. Set a new breakpoint in Core1 in line 51 and start the program execution. Both, Core0 (halted) and Core1 (halted by internal breakpoint) are stopped by the breakpoint condition in Core1. Core2 is running furthermore. The same mechanism works while stepping through the program code.

68 of 167 A Multi-Core Debugging Example with TriCore2 AURIX Getting Started A Multi-Core GTM Debugging Example with PowerPC MPC5746M Recent 32-bit multi-core architectures like TriCore Aurix (AUtomotive Realtime Integrated neXt generation architecture) or PowerPC MPC5746M contain a multipurpose Timer module called Generic Timer Module (GTM). On the TriCore platform, this timer module is designed to detach the former General Purpose Timer Array (GPTA). Because of the complexity of the GTM, this example will only give an introduction of the debugging possibilities. At the starting point, it will begin with the creation of an UDE workspace. After the workspace, common elements like the start-, stop-control and the multi-core behavior are being showed. After the common control it will dive into more debugging details of the GTM by debugging the Multi-Core-Sequencer (MCS). Please note that the described multi-core features of UDE are available in the UDE Open Platform. Please run UDE Open/Visual Platform from the Window’s start menu.

Creating a New Workspace At first, a new workspace has to be created. Click New Workspace from the File menu and choose a new file name in the opening file selection box. UDE comes with a number of prepared target configurations (Default button). For this example, the PowerPC with MPC5746 configuration is suitable. Select the entry "PowerPC - Freescale – MPC5746 Evaluation Board – Freescale MPC57xx Evalboard with MPC5746M (Jtag/Core2/Core0/Core1)" and click to Finish. In the configuration box, choose a file, e.g. freescale_mpc5746m_core2_core0_core1_debug.cfg. Select the created configuration and click to Edit to edit the target configuration.

The default target configuration contains all information about the Core2, Core0, Core1, GTM and FLASH devices. Core2 is the master I/O core (e200z425), Core0 and Core1 are slave cores (e200z420) of the Core2. Please check that the GTM core is also enabled (see red circle). Click OK. When the connection is successfully established, the following messages will appear in the message view: Core2::UDEDebugServer, Connection to MPC5746M target established: PowerPC Target, JTAG-ID: 0x0AF0A01D Core0::UDEDebugServer, Connection to MPC5746M target established: PowerPC Target, JTAG-ID: 0x0AF0A01D Core1::UDEDebugServer, Connection to MPC5746M target

Getting Started A Multi-Core GTM Debugging Example with PowerPC MPC5746M 69 of 167 established: PowerPC Target, JTAG-ID: 0x0AF0A01D GTM::UDEDebugServer, Connection to MPC5746M target established:GTM, ID: 00000000h Please note that the GTM ID is always “0h” after connect, because it is not enabled yet! When all debuggers are launched, UDE is ready for loading the multi-core GTM application Timedemo_GTM.elf.

Preparing the debugger First, to keep overview about all cores, we want to illustrade all of the debugger windows associated with a single core debugger with its own color, so that the associated windows can be better differentiated. Open the menu Config - Debug Server Configuration - Framework - Windows Tabs Color. Select one of the core’s view server and assign a tab color to it. The selected color is now used for each window tab of the selected core debugger.

Loading a multi-core Executable UDE supports several possibilities to handle executables for multi-core architectures: 1. One executable is suitable for each core and there is only a single Elf file. 2. All executables of all cores are combined to a single Elf file. 3. Each core has its own Elf file. UDE handles this requirements via a multi-core / multi-program loader box, where can be selected, which executable is assigned to which core. This can be selected for binaries and symbols. Select from the UDE menu File - Load Program and browse to \SAMPLES\ PowerPC\Freescale_MPC5746\Timedemo_GTM\obj-iRam- MC\Timedemo_GTM.elf. This is an example of a single executable, which can be loaded into each core. That’s why, there is only the entry Timedemo_GTM.elf for all cores assigned. Select the required check marks.

70 of 167 A Multi-Core GTM Debugging Example with PowerPC MPC5746M Getting Started

UDE will load and transfer all binaries into the corresponding core and the symbols to the debugger symbol server. After that step, you can add new windows to each core debugger.

Core selection To select the right core debugger, you can click into a core-specific window (with a colored frame tab) and the focus will be on this core debugger. The state bar below shows the current selected core debugger, too. For example, UDE can be visible as the following screenshot shows: (use the zoom function to get a closer look)

Core2 is halted and is focused, Core0, Core1 (slave cores) and GTM are inactive and not focused. For each core a CPU window is opened. Questions marks indicate, that the core is not enabled yet.

Single-core Breakpoints A simple example is to set a breakpoint to a program location of a single core. Select a core’s program window and set the breakpoint via context menu in this program window. If the source file is not available, opens the CoreX Symbols window and select the source from the Source Files folder.

Getting Started A Multi-Core GTM Debugging Example with PowerPC MPC5746M 71 of 167 In this first example, select Core1, set a breakpoint to line 37, select Core2 (only this core can be started on PowerPC architecture) and run the program via Start Program Execution. This will start the Timedemo_GTM.elf on Core2, and Timedemo_GTM.elf will start Core0 und Core1 automatically. After a short time, Core1 stops, because the breakpoint is reached. Core0 and Core2 are running furthermore. If Core0 and Core2 are also stopped, check if the they are part of a “Run- Control-Group” (see next section “Multi-core Breakpoints and Stepping”). After inspecting of Core1, it can be started via Start Program Execution again.

Multi-core Breakpoints and Stepping A multi-core application may require that in case of reaching of a breakpoint condition in one core, other cores must be halted and after that, the halted cores must be started simultaneously. The Multi-core run group manager helps you to setup the combination of halting and starting of core groups. Open the manager via Config - Multi-core Run Control Configuration. Create a new group Core2 and GTM and add Controller.Core2 and Controller.GTM to this group.

Select the required properties of the run control group via check boxes. Break the program via Ctrl+F5. Core2 and GTM are stopped simultaneously; Core0 and Core1 is still running (because it is no part of a run control group). Remove all breakpoints. Restart Program via F7. The same mechanism works while stepping through the program code.

Inspecting Multi-Channel-Sequencer (MCS) Channels The Generic Timer Module (GTM) contains several modules which communicate over an Advanced Routing Unit (ARU). The ARU connects all GTM modules, including the MCS, to each other. Depending on the GTM version, a different number of MCS cores are available which can be used to modify signals that are routed to them. One MCS core contains thereby its own RAM that is divided up to 8 channel programs. Each channel run its own program, based on special sequencer instructions, which modifies the signals routed to it. This section shows how different MCS cores and channels can be inspected.

72 of 167 A Multi-Core GTM Debugging Example with PowerPC MPC5746M Getting Started At first, restart the Program via F7. If not yet already done, create a new “Run-Control- Group” as mentioned above. Now select Core2 and set a breakpoint to line 71 (behind the initGTM()- function) in main.c. Select Core2 and run the program via Start Program Execution. After a short time, the Core2 and GTM core stop.

Click on the GTM list box to select the desired MCS channel:

Open the Code Window by selecting the coloured tab corresponding to the GTM core to look for the channel instructions as shown below:

The MCS CPU Window shows the current context register values:

After each MCS channel select, the instruction pointer inside the Code Window and the MCS CPU Window contents are updated properly.

Getting Started A Multi-Core GTM Debugging Example with PowerPC MPC5746M 73 of 167 A TriCore MCDS Trace Example This example shows you how to use the Multi-core Core Debug System (MCDS) of the TriCore Emulation Devices TC1767ED and TC1797ED to realize a simple trace of a code range.

Introduction The Multi Core Debug System (MCDS) integrated on the Emulation Extension Chip (EEC) of Infineon’s TC1797ED and TC1767ED is a powerful trace and event generation module. It allows observing and controlling the running system in a very purposeful way. Elaborated filter mechanisms and a high visibility to the system internals (cores and busses) are the key features of MCDS. To make use of them the MCDS has to be configured for each trace task using the “Universal Emulation Configurator” (UCE).

A detailed description about MCDS and its configuration can be found at the MCDS ? Guide from the Help (\Help\mcdsguide.chm). Target Configuration An appropriate target configuration for the TriCore emulation devices is delivered within UDE. Open a workspace and use the default target configuration 'TriBoard with TC1767ED (JTAG/OCDS)'. After establishing the connection to the TC1767ED enable the MCDS add-in via menu Config - Add-In Components - MCDS Trace Support. Load the example code \TC1767\TimeDemo\iRAM\TimeDemo.elf from the UDE sample directory. Open the MCDS trace window using the menu Views - MCDS Trace Window. It can be opened using the button MCDS Trace Window in the toolbar views too.

Preparations Now we will configure the MCDS for a simple code range trace of the function led_init(). The interesting code starts at the address 0xD400'0400 and ends at the address 0xD400'040E.

74 of 167 A TriCore MCDS Trace Example Getting Started To configure the trace task open the configuration window using the context menu (right mouse button) in the MCDS Trace Window and select Trace Config ... The empty configuration window appears Within the configuration window, the trace tasks can be composed from a set of predefined configuration blocks. These configuration blocks are defined in the MCDS configuration libraries. To add a configuration block use the Add button to open the library browser. The browser window shows all available configuration blocks (loaded from mcdslib.ltq as specified before) in the topmost list box. If you select one of these configuration blocks, you will obtain information on the provided functionality and the parameters. The button Add Task adds the selected configuration block to your current trace task configuration. For our example, add the following configuration blocks to your empty trace task configuration:  Use tc1766ed  Trace TriCore PC Range The parameters of the inserted configuration blocks have to be adjusted as follows:  Set the memory to 256 kByte.  Set the Trigger to pre. The trace is started as soon as the interesting code range is entered. Set the lower bound to the start address of the interesting range 0xD400'0400. It is also possible to use symbolic values. Enter led_init+4 to let the UDE calculate the start address by it. Set the upper bound to the start address of the interesting range, in this case 0xD400'040E. Alternatively enter endof(led_init)-3 for automatic calculation of the end address by the UDE. The configuration of our trace task is completed. Following image shows the completed configuration.

Getting Started A TriCore MCDS Trace Example 75 of 167

MCDS Trace 1. Start the trace by selecting Start Trace from the context menu of the trace window. 2. Run the loaded program (Debug - Start Program Execution or press F7). 3. Let the program run for a while and then stop the execution via Debug - Break Program Execution or press CTRL+F5. Due our trigger settings, the trace did not stop automatically. The trace can be stopped using the trace use Stop Trace or Refresh from the context menu of the trace window. The trace window refreshes the trace stream automatically. As result, the program trace is shown in the MCDS Trace window below. The columns can be configured by using the context menu Trace Config ...

76 of 167 A TriCore MCDS Trace Example Getting Started An Example with C166S V2 / XC16x via JTAG/OCDS L1

Starting with Universal Debug Engine In this chapter is shown, how to connect to Infineon's XC16 board using the starterkit mode via LPTx or a high-speed connection using an UAD. First launch UDE and create a new workspace and a target configuration as described above. To switch between the starterkit mode and the communication via UAD you must setup the communication protocol. Open the Edit Target Configuration dialog and select the C166SV2 item in the tree, push the Setup button on the right panel. As 'Access Device' the UAD, the 'Starterkit Driver' and 'DAS' can be selected. After the selection, push Setup to configure details of the communication device. To switch this setting later, use the main menu Config - Target Config. To setup the target configuration to Starterkit mode, the Starterkit Driver JIO_API_XC16x.dll, located in the UDE directory, must be used. If this file is not available and needed, you have to modify the UDE installation including Starterkit support. The Universal Debug Engine will now try to connect to the target system. When the connection is successfully established, the following message will appear in the command window: UDEDebugServer: Connection to XC164CS target monitor established: C166SV2 target, JTAG chip ID 20096083h.

Loading and Starting of an Executable

Load the executable \SAMPLES\XC16x\Timedemo \GNU\Ram\timedemo.out. Please note that the instruction pointer is first placed at the beginning of the start-up code of the loaded application. Start the application.

Automatic Variables Refresh For observing variables while running target UDE supports automatic variables refresh. Open a watch window, insert the variable Buffer [10], and unfold it. Open the context menu of the variable and select Refresh Period. The 'Refresh Period for Watch Entry' dialog allows to setup refresh periods for the selected variable while running and while halted target. Enable the refresh for running target and set the period time to 25ms, close the dialog box. The buffer variable is being refreshed now automatically, you can see how the circular buffer is filled. Changes are marked with red color.

Getting Started An Example with C166S V2 / XC16x via JTAG/OCDS L1 77 of 167 Trigger Functions This chapter demonstrates how the OCDS L1 unit of the XC16x derivative can be used for implementing trigger functionality. Again, the starting point is UDE with the application timedemo.out loaded. We want to create a trigger configuration that stops program execution when a write access to the variable Buffer[0] occurs. The watch window helps you to find out the address location of the Buffer[0] array. The value of the array name is equal the address of the variable. In addition, the tooltip of the variable or its parts shows the address, in this case 0xA02F. Open the 'OCDS L1 Setup' dialog by menu Debug - Setup OCDS unit. In the section Use Trigger for ... , the option 'User Defined Action' must be checked. Then click on the button Trigger Setup.

The Trigger Setup dialog is displayed:

To recognize write access to the variable Buffer[0], we will use the Equal Comparator. Therefore, please select the option Write Address under Event Source in the Equal Comparator. When the trigger condition occurs, the application is stopped in this example. Please select Break User Application in the Event Action field. To select the address to be monitored, click on the button Equal Comparator. In this example, we want to set the address of the variable to be displayed directly. Select Mode I and enter the address of the variable 0xA02F into the field Value. After closing the dialog, the target is halted automatically. In the command view, the reason is written: UDEDebugServer: Target execution - halted by trigger event - program location 0xE00362 Switch the program window to mixed mode view, the instruction pointer shows 0x3C0.

78 of 167 An Example with C166S V2 / XC16x via JTAG/OCDS L1 Getting Started An Example with MPC5567 via JTAG

Starting with Universal Debug Engine

When a new version of UDE is started the first time, a firmware update may be executed on the access device (UAD, UAD2 ...). This may take some more time than usual for the target connect operation. Please DO NOT power off or unplug the access device while ! this time! In this chapter is shown, how to connect to Freescale's MPC5567 board using a high- speed connection via an UAD. First launch UDE, create a new workspace and select the default target configuration for PowerPC/MPC5567 “Freescale MPC5567EVB Evalboard with PC5567”. When the connection is successfully established, the following message will appear in the command window: MSG: Controller0.Core::UDEDebugServer: Connection to MPC5567 target monitor established: PowerPC Target, JTAG-ID: 0x1813401D

Loading and Starting of an Executable Load the timedemo sample executable from \SAMPLES\PowerPc\Freescale_MPC5567EVB\ timedemo\GnuPpc\iRam\timedemo.elf Please note that the instruction pointer is first placed at the beginning of the start-up code of the loaded application. Start the application.

Automatic Variables Refresh For observing variables while running target UDE supports automatic variables refresh. For using this feature with MPC55xx, the Nexus access must be enabled. For that, check the Target Interface Setup dialog page E200 Core via menu Config – Target interface ... – E200 Code with enabled Use NEXUS .. option.

Getting Started An Example with MPC5567 via JTAG 79 of 167 Open a watch window, insert the variable Buffer, and unfold it. Open the context menu of the variable and select Refresh Period. The Refresh Period for Watch Entry dialog allows to setup refresh periods for the selected variable while running and while halted target. Enable the refresh for running target and set the period time to 25ms, close the dialog box. The buffer variable is being refreshed now automatically, you can see how the circular buffer is filled. Changes are marked with red color.

Please note, that in the case of using of the integrated caching mechanism of the PowerPC MCU, the view cannot be fully updated. The changed values are saved in memory and are updated only, when a cache write back is executed. This is done for example, when the program execution will be interrupted by holding.

Trigger Functions This chapter demonstrates how the PowerArchitecture Book E defined triggers of the MPC55xx derivatives can be used for debugging purposes. Again, the starting point is UDE with the application timedemo.elf loaded. We want to create a trigger configuration that stops program execution when a write access to the variable Buffer[0] occurs. Open the Hardware Debug Resources dialog by menu Debug – Setup Trigger unit. Select the rider Data Address. We want use DAC1 as trigger comparator. Enter the address of Buffer[0] into the address box. For simplification C-style expressions could be used, so simple enter &Buffer[0].

Enable User and SV (Supervisor) as Break Mode, select Write Access mode, Effective address and Exact comparator. Start the application.

80 of 167 An Example with MPC5567 via JTAG Getting Started The application stops when the fist write to Buffer[0] occurs. You will find the message MSG: Controller0.Core::UDEDebugServer: halted by trigger event inside of the command view.

Hints for using the MPC55xx via JTAG For accessing target during runtime, the NEXUS functionality is required. The NEXUS module on the MPC55xx allows access to the physical system memory during runtime. Therefore a 1:1 mapping of the MMU is also required, since the MMU cannot be disabled for the core. If a 1:1 mapping is not ensured, the NEXUS feature is not useable! For accessing physical memory resources (e.g. Special function registers) the MMU is analyzed by the debugger to find out the correct effective addresses. If the requested physical address is not mapped, the debugger is able to setup the TLB entries inside the MMU, when the special option Allow MMU setup for physical access inside of the Target Interface's Setup is enabled.

Getting Started An Example with MPC5567 via JTAG 81 of 167 An example for Linux kernel and application debugging This chapter will give you a very short introduction about Linux Debugging with the UDE. You will learn something about debugging a syscall kernel function. At this point we assume that you have installed the UDE successfully and are familiar with it.

Preparations Before the manual starts, please check that your hardware configuration compiles to the configuration on the picture below.

Make sure that the Linux kernel sources are available and correspond to the Linux kernel running on the target system.

Create a new workspace At first, start UDE from your Desktop and create a new workspace. This is done by File – New Workspace. Enter a name for your newly created workspace (e.g. Linux kernel debugging.wsx) and click on open. Load a predefined target configuration by clicking on default. Select your target and load “ with Linux kernel debugging support (JTAG)”.

Save the configuration and click on OK to open the workspace.

82 of 167 An example for Linux kernel and application debugging Getting Started Open the project workspace (Window – Project Workspace) to browse all kernel source files after the kernel ELF file was loaded. Open the CPU window (Views – CPU Window) to check the CPU registers during the debug session. To connect to the target without resetting it each time, an option called “Attach to Service Monitor” must be enabled. Click on Config – Debug Server Configuration – Debug Server – Download.

Now enable the checkbox Attach to Service Mode and click OK. During creation of this workspace, the target was reset because the Service Mode is disabled by default. Please click on Debug – Start Program Execution (F5) to reboot the Linux kernel.

Load the kernel ELF file The kernel ELF file contains symbols like function addresses, function locals, globals and much more. Furthermore this file is needed to show you the function source code corresponding to the assembler code. To load the kernel ELF file click on File – Load Program and choose the kernel ELF image (e.g. vmlinux_MX25_ram.elf).

Substitute kernel path Now the path to all kernel source files has to be substituted to load each source file from the right place. Open Config – Debug Server Configuration – View Server – Program – Path Management and replace the original kernel path with the kernel path from your host PC. The picture below shows an example:

Getting Started An example for Linux kernel and application debugging 83 of 167 Debug a syscall kernel function A syscall function is not an ordinary function. This function is only called when a special exception (a system call) occurs. For example this happens when a command was entered into the system shell (command prompt) and the shell calls an exception to load the corresponding file. In this case the syscall “sys_execve” (and many others) is requested to the kernel. In this section we will debug even this syscall. Open the appropriate source file named “.c” from the Explore Symbols – Source Files list by double-clicking on that file. After the file was opened, use the “Find”-dialog (STRG+F) to search for the “do_execve” function. If the function was found, set a breakpoint to the entry of the function. The target halts after a command was entered in the command prompt. To open a shell (command prompt), click on Views – Simulated I/O Terminal. A white box is appearing. Click right in that box and then left-click on Properties. Select View Server – SimI/O – Terminal and disable “Local Echo”.

Click OK to save this property. Now press Enter to get a shell. Depending on the system configuration you will get a login or a command prompt. If “login” appears, type “root” and press Enter to log in.

If no login appears, type “ls” to get the content of the current directory. Immediately after pressing Enter the target is halted at our previously set breakpoint. Open the locals window (Views – Locals) to check the function parameters that were set. After a double-click on “filename” you see the command that was invoked. “envp” gives you some information about the environment variables. The “regs” structure contains CPU register information like the “Link Register (R14)” or the stack pointer (R13).

84 of 167 An example for Linux kernel and application debugging Getting Started An Example for C166 debugging via 3Pin A highlight of Universal Debug Engine is the possibility of debugging via different communication channels. UDE supports the communication to the target system via a simple 3-wire cable and a ground connection. This proprietary protocol is called 3Pin communication. With the flexibility of the monitor solution, the 3Pin communication can be used with all supported . In the following example, a Phytec miniMODUL-167 as target system is used.

Hardware Requirements Because the 3Pin communication is not a standard communication port directly supported by the microcontroller, the user must adapt the 3Pin port to the used hardware. For a successful connection between the target and the used communication add-on as the Universal Access Device at least 3 pins and the ground potential must be connected. The following table describes the relevant signals:

Pin name Direction from µC Description CLOCK O for synch transmission MODE I/O Direction control of the data transfer / external interrupt for halting the application DATA I/O Data upstream / downstream GND Ground potential In this example, the miniMODUL-167 is equipped with a 10-pin shroud male header. On this way, a simple 10-pin ribbon cable can be used. The pins are connected as following shown:

Universal Access Device mini-MODUL-167 SAB C167CR-LM

CLOCK Pin 3 P3.1 Output Pin

(SAB C167) MODE Pin 7 P3.2 In/Output/Interrupt Pin DATA Pin 5 P3.3 In/Output Pin

Pin 1 GND GND For the bootstrap loading sequence, an additional connection is required between the ASC0 Target connector of the Universal Access Device and the ASC0 connector of the miniMODUL-167 (P1). A simple 1:1 SUB-D9 (M) to SUB-D9 (F) extension cable can be used. ? Further information of the hardware installation is described in the appendix.

Useful hints for 3Pin Debugging An advantage of the combined bootstrap loading/3Pin communication is that the ASC0 interface is available for user purposes after the bootstrap loading sequence. The Universal Access Device features the transparent switching between the bootstrap loading mode and the user application. For that, an additional 1:1 SUB-D9 (M) to SUB-D9 (F) extension cable is required. Please connect this cable with the ASC0 Application connector of the Universal Access Device and the external asynchronous device (RS232).

Getting Started An Example for C166 debugging via 3Pin 85 of 167 Monitor preparations For using the 3Pin interface, a monitor program in the target system is required. Two ways are available for generating and loading of the monitor code:  ROM Monitor Solution: The monitor code may be derived and built from a monitor source library according on the user’s demand. This monitor hex code can be flashed into the non-volatile target memory, i.e. into FLASH or EPROM memory. After this step, the monitor will be executed directly after the power on. For the “flashing” of the monitor code, the integrated FLASH MemTool of the Universal Debug Engine can be used. The monitor source code library is offered by the PLS Development Tools.  Bootstrap loading/RAM Monitor Solution: A configurable predefined monitor may be adapted to the used target hardware. This monitor will be downloaded via bootstrap loading/ASC0 into the target and executed before every debug session. In this example, the 2nd way is described. The advantages of this solution are, that no monitor code must be “flashed” and the ASC interface is available for user’s purposes after the initializing process. In the first step, the predefined monitor must be configured. Please start the Monitor Wizard using “fastmon.exe” from the or the shortcut “Build 3-Pin Monitor” in the UDE start menu. The following dialog will be shown.

Build the monitor by execution of these 6 steps offered by the Monitor Wizard. Choose the controller derivative, the pins for the DATA, CLOCK and MODE signal and the monitor location. For the monitor location 3F000h is a suitable value. In the last step build the monitor with the predefined characteristic. Save the monitor as mm67_3pn.mon.

Starting the Universal Debug Engine Launch UDE and create a new workspace as described above. After creating and saving the new workspace, you will be asked to select a target hardware configuration. UDE comes with a number of prepared target configurations. For this example, an adapted target hardware configuration is available under the entry "C167 Target (Boot/3Pin)". Select this entry and click OK.

86 of 167 An Example for C166 debugging via 3Pin Getting Started The Universal Debug Engine will now try to connect to the target system. MSG: UADCommDev: Connected to UAD 70022 Possibly the BSL/3Pin monitor is not included yet, the connection will fail. The following dialog will be displayed:

Push the button Change... to setup the target interface and follow the next steps.

Setup Target Interface Choose the page Monitor. Check the radio buttons Download Bootstrap Loader Monitor to Target and Use External Monitor File. Browse the generated monitor file “mm67_3pn.mon” and choose 3Pin interface as Debug Communication Channel.

Getting Started An Example for C166 debugging via 3Pin 87 of 167 In the page Connect/Boot, the settings for bootstrap loading sequence are made. Important values are the baud rate and the RS232 Drivers. Choose the suitable values, in this example 57600 Baud (resp. 57600 bps) and Use RS232 Driver. The Execute Initialisation Commands allows setup the start-up values of the target controller.

If no initialization commands are given, click in the input form and enter a new init command. To change an existing entry, click to the entry and edit the value. Following init commands are required for successful working with the miniMODUL-167:

Init Command Description SET SYSCON 0x4 0xFF7F Enable XBUS peripherals SET BUSCON0 0x40E 0xFF3F Configuration of the FLASH-ROM (/CS0) bus window SET ADDRSEL1 0x6 Address window of the RAM (/CS1) bus (256 kByte) COPY BUSCON0 BUSCON1 Copy the Configuration of the RAM (/CS1) bus window from RAM (/CS0) EINIT Execute the EINIT command after initializing

88 of 167 An Example for C166 debugging via 3Pin Getting Started Memory layout of the miniMODUL-167 after initialization

XBCON0 XBUS Active window

BUSCON1 RAM Inactive window

BUSCON0 ROM

0 3FFFF

Close the dialog and start the target interface by pushing the button Single retry. In the target connection dialog failed dialog. When the connection is successfully established, the following message will appear in the Command window: UDEDebugServer: Connection to C167CR target monitor established: monibc67 V3.42 08/00 (C) 1991/2006 pls Programmierbare Logik & Systeme GmbH.

Using the Simulated I/O channel The Universal Debug Engine features the I/O communication of the target application via the debug channel. This means, that the application can use scanf(), printf() and equivalent functions to input and output of text. Requirement is the linking of the SIMIO.C software with your . SIMIO.C is available for the C16x architecture and supports the compilers from Tasking, Keil and HighTec (GNU). The Sieve example from the examples folder demonstrates the using of the simulated I/O. If your hardware preparations are done successful and your target is connected, load the program \SAMPLES\C16X\SIEVE\TASKING\SIEVE.OUT in your target. Open the Simulated I/O Window from the menu Views – Simulated I/O Terminal or use the corresponding button from the tool bar. Start the program via Debug - Start program Execution. The program output will be redirected to the Simulated I/O Terminal. In the last line, you are asked for the input of the count of executions. The program is waiting in the scanf() function until the user press . Activate the I/O Terminal and type in i.e. 20 and press . The program will continue and calculate the primes. In addition, an execution time measurement is done.

Getting Started An Example for C166 debugging via 3Pin 89 of 167 Creating new Target Configurations In the chapters above the starting point was mostly a Starterkit with predefined target configurations. In this chapter, you will learn how you can build a target configuration with your custom specific target hardware yourself. Main goal is to introduce the Target Configuration Wizard. First, you have to define the target hardware that may have multiple different microcontrollers and memories. In this example, a fictitious target equipped with one C167CR and two 29F010 connected to /CS0 of the controller is used. Furthermore, the target has one external 16-bit sRAM connected to /CS1. The communication channel is the ASC0 with RS232 driver. The target controller is started via bootstrap loading.  Controller: C167CR  FLASH: 2x 8 bit FLASH NX29F010 at /CS0  sRAM: 1x 16-bit RAM at /CS1  Communication Channel: ASC0 via RS232  Monitor: Bootstrap Loader Monitor

Creating a new workspace A workspace refers always to one target system. Choose File - New Workspace from the menu and enter a new name for the workspace in the appearing dialog box. Press the OK button to apply the entered name.

Invoking the Wizard The next dialog is the Target Selection Dialog. Press the button New and click Next to create a new target configuration. The next dialog allows both describing the new target and choosing the controller family. If you do not enter a description then the file name will be displayed in this dialog only.

Press the Next button if you have done it.

90 of 167 Creating new Target Configurations Getting Started Select the controller derivative The next step is the selection of the used derivative. With this selection, UDE will be equipped with the correct databases of the used derivative. It is important to select the correct corresponding type of your derivative. Select the C167CR derivative for this example and click Next.

Selecting Target Interface In this step, the target communication interface has to be selected. Because an ASC0 based monitor via bootstrap loading is used, the C16x Debug monitor Interface must be selected. To specify the interface settings e.g. the baud rate and the communication channel properties to the target click Setup.

Getting Started Creating new Target Configurations 91 of 167 Setup the Target Interface The dialog is divided in a number of pages for setup the Target Interface. Please check the content of each page for correct content. the controller by using the bootstrap loading mechanism of the C167CR will be done within three steps. 1. Via the internal bootstrap loading the Second Level Loader is transferred to the internal RAM and will be started. 2. This Second Level Loader loads the primary Boot Code. 3. The Boot Code initializes the controller system and loads the application or monitor code. General Select and setup the used communication hardware.

In this example a special Target Monitor using the bootstrap loading mechanism has to be used. The various offered standard ASC monitors differs only in the location where the monitor is located. For example, C167.ASCMon.BM67C0256 means a C167 ASC0 monitor is located at 3F290h – 3FFFFh, below the 256 kByte RAM memory boundary. Click the "..." button to select another located monitor. Select ASC as Debug Communication Channel.

Connect/Boot In this example, the settings of Connect Option are not relevant, because the UAD cannot cause a reset on your target via an ASC0/TTL line. Leave the Connect Option on default.

92 of 167 Creating new Target Configurations Getting Started In this example, the standard Boot Code is used. Only for a special purpose, a special Use external Boot Code is necessary during the system loading process.

The initialization commands are executed from the Boot Code while the system configuration processing. The commands initialize the memories they are connected on /CS0 and /CS1 via a demultiplexed 16-bit bus. The address range of the /CS1 memory is mapped 0x00000 to 0xFFFFF. Finally, the EINIT instruction will be executed. Refer to the UDE manual for a complete set of initialization commands and to the C167 architecture manual for a description of external bus unit of the C167 microcontroller architecture. Close the Target Interface Setup via the OK button and click Next. If changes are necessary later, you can change these settings within UDE.

Configuring the FLASH memory In the dialog "Target Specify Memories“, you must set the number of memories at least to 1, if you want to use FLASH programming support. Click Next. Enter in the dialog "Special Memories" a unique name for the flash name and the description. The description will be displayed when you select a memory device in the FLASH/OTP Memory Programming Tool. For each special treated memory device, a special Handler is required. Select for FLASH support the "UDE FLASH/OTP Memory Programming Tool". Setup both the bus mode organization of the chips and an address range, where the memory is visible. These settings must correspond with the configuration of the external bus controller done by the initialization command.

Getting Started Creating new Target Configurations 93 of 167

Click Next.

With these steps, the FLASH/OTP Memory Programming is prepared. Further steps are required when you are using the Programming tool. Please refer to the user's manual ! chapter „FLASH Programming“ for further hints of use.

Finish the wizard Enter the name of the file you intend to save the configuration of target. Usually the Target Configuration files are stored in /TARGETS folder. By pressing the Finish button, you apply the settings to the target configuration. The debugger loads all necessary components and connects to the target. If the following message is displayed in the Command View, you were successfully. MSG: UADCommDev: Connected to UAD 70022, FW-Version: 1.1.12 MSG: UDEDebugServer: Connection to C167CR target monitor established: bootmon167 V3.41 07/00 (c) 1991/2000 pls Programmierbare Logik & Systeme GmbH To edit this target configuration you can select the menu Config - Target Configuration. In the appearing dialog you can modify the target configuration.

94 of 167 Creating new Target Configurations Getting Started Using the OCDS L2 Trace Board with the TriCore

Preparations To use the trace board of the Universal Access Device the trace support must be installed. Please refer to the chapters „Installing Hardware“ and „Hardware Description Trace Board“. Please use the TraceBoard Configuration tool to verify the usage of the right trace pod design. The following instructions require that the connection to the TriCore target is established and that the debug version of the program file hello.elf is loaded, i.e. \Samples\TriCore\TriBoard_TC1796\hello\GnuTc\iRam \hello.elf.

Recording the first Samples 1. Load the trace add-in via menu Config - Add-In Components and enable the TriCore OCDSL2 Support. 2. Open a new trace windows Views – Trace Window 3. Open the context menu (right mouse click) of the trace window and select Trace Config... This opens the Trace Setup dialog. 4. Select the radio button Standard. This will instruct the trace unit to record all samples until the target is halted. 5. Set a breakpoint in the first line of the function main. 6. Start the program using the menu Debug - Start Program Execution. As soon as the program stops at the breakpoint, the trace window will be filled. The recorded samples are the instructions of the C start-up code of the file.

Looking what happens when the Function exits This can be done if the recording starts at the exit point of the function. Thus, a trigger that starts the recording at this point has to be set. 1. Determine the address of the RET instruction of the function delay. This can be done using the mixed mode in the program window. 2. Open the context menu (right mouse click) of the trace window and select Trace Config... 3. Select the radio button Standard. 4. Check the box Use Address Trigger and enter the address of the RET instruction in the address field. The address could be similar to 0xD400021E. 5. Set the trigger position to the left side. This means the trigger will be at the beginning of the trace buffer and the recorded samples are after this trigger. 6. Step the program using the menu Debug - Step over Subroutine to step over the start-up code. This is necessary because the C start-up code of the GNU compiler influences the settings of OCDS Level 1 and OCDS Level 2. Stopping the program after the c start-up code enables Universal Debug Engine to restore the settings to the needed values. 7. Start the program using the menu Debug - Start Program Execution. 8. Wait for some seconds until the function has been passed at least once. 9. Stop the program using the menu Debug - Break Program Execution. As soon as the program stops at the breakpoint, the trace window will be filled. The recorded samples are the instructions after and including the return instruction.

Getting Started Using the OCDS L2 Trace Board with the TriCore 95 of 167 Measuring the Interval a Function is called To measure the interval the first instruction of the function in question has to be recorded. This can be done using the "code range trace mode". 1. Determine the address of the first and the second instruction of the function delay. This can be done using the mixed mode in the program window. 2. Open the context menu (right mouse click) of the trace window and select Trace Config... 3. Select the radio button Code Range. This will instruct the trace unit to start the recording at Start Address and stop the recording at Stop Address. 4. Set the values of Start Address to the address of the first instruction of the function delay and the value of Stop Address to the second instruction. 5. Step the program using the menu Debug - Step over Subroutine over the start-up code. This is necessary because the c start-up code of the GNU compiler influences the settings of OCDS Level 1 and OCDS Level 2. Stopping the program after the c start-up code enables Universal Debug Engine to restore the settings to the needed values. 6. Start the program using the menu Debug - Start Program Execution. 7. Wait for some seconds until the function has been passed at least twice. 8. Stop the program using the menu Debug - Break Program Execution. As soon as the program stops at the breakpoint, the trace window will be filled. The recorded samples are the first instructions of the function delay. Each start trace is marked with  in the trace window. Now the interval can be calculated with the time difference of all samples with  in the trigger column.

Conclusion Congratulations! You have learned about the basic features of UDE. This will enable you to load and debug an application using UDE with a Starterkit board as the target system.

You may now create your own applications using the GNU, the Tasking, the Keil or the Greenhills C-Compiler and debug them with UDE. As UDE is constantly improved, please check out our web site at http://www.pls-mc.com for the latest version of UDE. Additionally, if you have any questions or if you need any help regarding your ? development tools we would like to encourage you to contact the PLS Support Team via email at [email protected] or via phone at +49 35722 384 0.

Thank you for using Universal Debug Engine.

96 of 167 Conclusion Getting Started User's Guide

Introduction The Universal Debug Engine (UDE) is one of the most powerful development workbenches available for the C166, XC166, XC2000, XE166, TriCore, PowerArchitecture, PowerArchitecture, Cortex, ARM7, ARM9, ARM11, XScale, SuperH and further microcontroller families. The UDE workbench lets you edit and organize your projects, supports you while building the applications and lets you run and test your software on the supported microcontrollers based customer specific hardware or different evaluation boards in a very convenient and cost-efficient way. The vast capabilities of the UDE High-End Debugger enable you to develop fast and reliable software as well as to get short turn-around times for your microcontroller projects.

Integrated Development Editor Environment

Compiler CASE Tool

R T O universal debug engine S

Target Simulator JTAG ICE Monitor

Evaluation Board Custom Specific Hardware

User's Guide Introduction 97 of 167 Hand-in-hand with our target access hardware the Universal Debug Engine offers a flexible debug platform. It allows...  High-speed and flexible access to target systems  Full-featured on-chip debug modules, OCDS L1, DAP, embeddedICE, CoreSight, SWD support  Program path trace via OCDS L2, ETM, NEXUS and triggered Transfer support  Multi-Core Debugging  Various Operation system support, RTOS and embedded Linux  supports further Third-Party Tools.

Architecture of Universal Debug Engine The Universal Debug Engine (UDE) is a new concept of our cross debugger based on a set of standard components and core specific components. UDE supports different cores and multi core debugging. The system is built based on components to ensure extension with additional cores and development tools. This way, the user is enabled to extend the debug system due to custom requirements.

Debugger Client (Desktop Container)

ViewServer ViewServer ViewServer Custom Program Program2 MultiCore Debugging ViewServer ViewServer Watch HTML

Debug Server Debug Server 2 (Base Functions, Symbol Processing)

Target Server Target Server 2 (Core and Communication Components)

98 of 167 Architecture of Universal Debug Engine User's Guide The UDE concept splits the basic debugger tasks into three independent program parts:  The user interface (debugger client) works as a client for both servers, generates requests for target data access and symbol processing and displays the results of the processed requests after receiving the ready signal.  The symbol engine (debug server) works as an independent server that processes requests to resolve symbolic relations of the program code. If the request is processed, the requesting client receives a message that the resolution is available.  The target communication server (target server) serves all requests for downloading program code into the target and accessing target data to display target system states (program variables etc.). The target core specific debugger engines implement the basic debugger functions of a specific core (e.g. debugger engine for TriCore, PCP, C166 ... ). The partitioning of debugger tasks into client/server architecture significantly enhances the performance of complex debugger tasks. To add debug support for additional cores is very simple due to the client/server architecture. One target communication server and usually one symbol server must be included to add debug support for a particular core. If several cores use the program code of the same application, no additional symbol server is necessary for the core. The multiple independent engines enhance utilization of the host CPU as well as the turn-around cycle of the debug process decreases. Moreover, the architecture of an UDE Debugger contains following parts:  The desktop frame works as a container for several components. The container is based on framework to instantiate views of the basic debugger engines and export interfaces to extend the user interface dynamically (e.g. add menu entries, toolbars).  The views are windows to implement debugger specific views to the target system. The views implement standard debugger functions (program window, watch window, memory windows, register windows etc.), programmable views based on page description languages (HTML) and application specific views (special views based on e.g. COM components).

Using On-line Help The Universal Debug Engine provides an integrated, context sensitive help. To use this help simply press the key. You may also select Help Viewer Window from menu Help for viewing the UDE Manual. This manual introduces the architecture of UDE and describes the UDE main features by examples. Furthermore, please visit our Web site on the Internet at http://www.pls-mc.com. There you can obtain the newest information and download the latest version of Universal Debug Engine.

User's Guide Using On-line Help 99 of 167 Project Management

Working with Projects Projects let you organize your work more efficient by combining all target specific and desktop settings in one workspace. This workspace stores all project relevant files and settings of the UDE Desktop. A main role of the project management plays the source files and their associated binaries. These files are displayed in the workspace window. The view is subdivided into file names and functions. If the workspace window is invisible, select Project Workspace from menu Window to display. In the Explore Symbols window of your current workspace, the source files are grouped under the folder Source files. If the folder content is invisible, click on the [+] item or double-click on the 'Source files' folder to expand it. An easy way to open a new source code window is by double- clicking on the corresponding source file entry. In a similar way, it is possible to view a function of the source code by clicking on the function name displayed in the folder Functions. To collapse a folder in the workspace window click on [-].

Creating a New Project If you want to build a new project, create a new workspace that contains all settings and files of the new project. Select New Workspace from the File menu of UDE Desktop and choose a new file from the file selection box. Usually, the workspace file is located in the project folder. Note the possibility to create new folders in the file selection box: Right-click into an empty area of the file selection field for the context menu and select New - Folders. This way you can create new folders without the need of an additional Explorer window.

When a new version of UDE is started the first time a firmware update may be executed on the access device (UAD, UAD2, ...). This may take some more time than usual for the target connect operation. Please DO NOT power off or unplug the access device while ! this time!

100 of 167 Project Management User's Guide Select Target Configuration After choosing the workspace file, you may select a predefined target configuration or may create or derive an adapted configuration.

Press the Default button to select a predefined configuration delivered with UDE. Press the New button to create a new configuration and follow the Configuration wizard. Select a predefined target configuration and press the Copy button to derive a new configuration from the selected configuration. This is recommending for adaptation of a similar configuration. Select a predefined target configuration and press Edit to change an existing configuration. Please note that the changes are saved permanently.

Loading a Project Open the File menu and select Open Workspace. Select a valid workspace file in the opened file selection box. Usually, workspace files are named with the file extension *.wsx . To load the application binary file use the Load Program from File menu and select the binary file. If you use the multi-core debug feature, please note that momentarily only compilers are supported they build the single core's source into only one binary file.

Saving Project Settings Usually the project settings are stored automatically when the workspace or the UDE Desktop will be closed. However, if you want to create a new project that is derived from a current project you may store the current project under a different path or project name. To do so, choose File - Save Workspace as ... and select a new project path and project name.

Closing a Project To close the current workspace, select from File menu Close Workspace. This will save all settings of the UDE Desktop, view windows and their contents, paths and names of loaded files and will close your current project. The project and its workspace are also saved when the UDE Desktop is closed.

User's Guide Project Management 101 of 167 Command line options of UDE UDE can be parameterized via command line interface and started automatically to open or create a workspace and execute a start-up script. Synopsis: UDEDesktop[.exe] [ -p file] [ -s file] Options: -p ... open or create a workspace -s ... run a startup script -d ... write diagnostic output into file

Preparing a binary File The Universal Debug Engine supports the compiler tool chain of various compiler manufacturers. Please see the compatibility list for selection the suitable compiler and the compiler manual for correct usage of the compiler.

Compiler Support

The recommended file extension for the output file are *.out (C166 derivatives) and *.elf (all supported derivatives). If you want use the HLL source code-debugging feature in the debugger, the corresponding debug information must be linked to the executable file. See the compiler manual for the correct options.

Note: If you use the multi-core debugging functionality of UDE, the software for both cores is downloaded and initialized by the debugger automatically. Momentarily UDE supports compilers joining the parts for the multi-cores to one single binary file only. The debugger takes the job of relocating the separate core programs.

! Attention: If the debugger is not used the user application is responsible for correct relocation and initialization of the core programs! Otherwise, the programs will fail.

Compiler Support for C16x, XC166, XC2000, XE166 The Universal Debug Engine supports the Tasking OUT format, the GNU OUT format and the Keil OMF166 format for binaries. To build such a file applies the following compiler switches: Compiler Command line options for output Tasking C/C++ Compiler Compiler: "–g"

Keil C Compiler Compiler: "DEBUG"

GNU C/C++ Compiler (HighTec) Compiler: "–g"

The recommended file extension for the output file is *.OUT.

102 of 167 Preparing a binary File User's Guide Compiler Support for TriCore The Universal Debug Engine supports the ELF/DWARF 1.1 , ELF/DWARF 2 format containing both the binary target pattern and the debug information. To build such a file applies the following compiler switches: Compiler Command line options for ELF/DWARF output Tasking C/C++ Compiler for Compiler: "–g" TriCore PCP Assembler: “–gal” Locator: "–f4" GNU C/C++ Compiler for TriCore Compiler (gcc): "–g –O0" (HighTec) PCP Assembler: “–Wa, ––gdwarf2” Wind River C/C++ Compiler for Compiler: "–g –O0 " TriCore Greenhills C/C++ Compiler for Compiler (cctri): "–G –dwarf" TriCore

Compiler Support for PowerArchitecture The Universal Debug Engine supports the ELF/DWARF 1.1 , ELF/DWARF 2 format containing both the binary target pattern and the debug information. To build such a file applies the following compiler switches: Compiler Command line options for ELF/DWARF output GNU C/C++ Compiler for Compiler : "–g –O0" PowerArchitecture Wind River C/C++ Compiler for Compiler: "–g –O0 " PowerArchitecture Freescale C/C++ Compiler for Compiler: "–g" PowerArchitecture Byte Craft eTPU Compiler Compiler: "–g"

Compiler Support for Cortex, ARM7, ARM9, ARM11, XScale The Universal Debug Engine supports the ELF/DWARF 1.1 , ELF/DWARF 2 format containing both the binary target pattern and the debug information. Compiler Command line options for ELF/DWARF output RealView MDK-ARM and Compiler: "DEBUG" RealView Development Suite for Assembler: “––debug ––dwarf2” Cortex, ARM7, ARM9, ARM11 GNU C/C++ Compiler for ARM7, Compiler: "–g –O0" ARM9, ARM11 (HighTec) Wind River C/C++ Compiler for Compiler: "–g –O0 " Cortex, ARM7, ARM9, ARM11 C Compiler for ARM7, ARM9, Compiler: "–g" ARM11 (ImageCraft) The recommended file extension for the output file is *.elf.

HexFile Support In addition, the simple Intel hex file and the S record format are supported.

User's Guide Preparing a binary File 103 of 167 Downloading the binary File Before debugging an application, the binary executable file must be downloaded into the target. For that, a communication channel must be chosen. The following chapter gives you an overview about the offered solutions of the Universal Debug Engine and its add- ons.

Examples of Debug Communication Channels

Communication Channel via JTAG JTAG is supported for XC166, XC2000, TriCore, PowerArchitecture, Cortex, ARM7, ARM9, ARM11 derivatives based on an on-chip IEEE1149.1 module.

Communication Channel via DAP The Universal Debug Engine supports DAP as debug interface for TriCore AUDO Future and upcoming 16-bit and 32-bit microcontrollers.

Communication Channel via SWD The Universal Debug Engine supports DAP as debug interface for TriCore AUDO Future and upcoming 16-bit and 32-bit microcontrollers.

Communication Channel to via ASC interface The Universal Debug Engine supports an asynchronous communication to the target system. The communication hardware is RS232 compatible. Optional an unbuffered 5 Volts TTL-compatible asynchronous interface for direct hardware access is available by the add-on Universal Access Device. The ASC monitor is available as RAM monitor for bootstrap loading or as ROM monitor. Requirement for the ROM monitor solution is the Monitor Development Tool offered by the PLS Development Tools.

Communication Channel via 3Pin interface The Universal Debug Engine for C16x features a 3Pin communication channel between the target system and the debugger. The communication is done via a proprietary protocol and uses 3 port pins of the microcontroller. The 3Pin monitor is downloaded via the on-chip bootstrap loader of the C166 microcontroller into the target system RAM or is located in the target’s non-volatile memory (FLASH or EPROM) as ROM monitor. In the case of bootstrap loading the ASC interface is free available for the application after the load sequence. Requirement for the ROM monitor solution is the Monitor Development Tool offered by the PLS Development Tools.

Communication Channel via SSC interface The Universal Debug Engine supports a synchronous communication to the target system. The SSC monitor is available for C16x as RAM monitor for bootstrap loading or as ROM monitor. Requirement for the ROM monitor solution is the Monitor Development Tool offered by the PLS Development Tools.

Communication Channel to via CAN interface The Universal Debug Engine supports a communication to the target system via CAN bus. The CAN monitor is available as RAM monitor for bootstrap loading or as ROM monitor. Requirement for the ROM monitor solution is the Monitor Development Tool offered by the PLS Development Tools.

104 of 167 Downloading the binary File User's Guide Selection of a Hardware Communication Channel The Universal Debug Engine is capable to communicate with the target hardware via various communication channels. For the physical target access, the hardware add-ons as the Universal Access Device provide various hardware communication channels. In the table below offered debug solutions are described. For further information, please refer to the chapter „Hardware Description“ of the add-on.

Hardware Channel Target Monitor Description DAP TriCore not required Connection via DAP to the OCDS L1 XE166 module JTAG / OCDS TriCore not required Connection via JTAG to the OCDS XC166 L1 module XC2000 JTAG Cortex not required Connection via JTAG to the ARM7 EmbeddedICE ARM9 ARM11 PowerPC XScale SWD Cortex not required Connection via SWD to the CoreSight ASC C16x, ST10 RAM / ROM Connection via ASC XC16x SSC C16x, ST10 RAM / ROM Connection via SSC

CAN C16x, ST10 RAM / ROM Connection via CAN

3Pin C16x, ST10 RAM / ROM Connection via a proprietary 3Pin interface LPT Onboard JTAG TriCore not required Connection via onboard JTAG adapter adapter to the OCDS L1 module LPT Onboard JTAG XC166 not required Connection via onboard JTAG adapter XC2000 adapter to the OCDS L1 module XE166

User's Guide Downloading the binary File 105 of 167 Overview about the Monitor programs Usually a running monitor on the user's target hardware is required, except the communication via a specialized on-chip debug module (OCDS L1). The following table gives an overview about the various monitor versions:

Monitor Version Communication Description Target access via The monitor code is loaded via the on-chip bootstrap loading or the a RAM-Monitor OCDS L1 module into the target and executed before every debug session. The switching between the ASC-bootstrap loading and the debug communication channel appears transparently. Target access via The target monitor code is located in the non-volatile target system a ROM-Monitor memory and executed directly after the power on. Advantageous is that the monitor is running as soon as the board is powered on. This allows a multi-target debugging, i.e. debugging several nodes in a CAN network. Access without a Target hardware supported by a specialized on-chip debug support Monitor (i.e. OCDS L1, EmbeddedICE, and CoreSight) does not require an additional monitor.

Preparing the Communication To open the communication channel some preparations are required. The primary selection of the communication channel is done by choosing a suitable configuration, saved as *.CFG. You can select a new target configuration file while creating a new workspace or you can setup an existing configuration via the Setup Target Config button in the ‘connection failed dialog’ or the menu entry Config - Setup Target.

Select configuration While creating a new workspace you can choose a new configuration for your target hardware. The Universal Debug Engine is equipped with some predefined configurations already. With this configuration, you have a short way to the first example with the Starterkits, and you can derive a user-defined configuration from an existing Starterkit configuration file, i.e.

Select a RAM based monitor program The Universal Debug Engine provides a set of target monitors as binary images. The user may adapt the monitors to the demands of the target system. The monitor will be downloaded via the on-chip bootstrap loading or a specialized on-chip debug module into the target system RAM before every debug session. Select an ASC monitor program Several predefined ASC monitors are available as standard monitor in the internal monitor database. The difference between the monitors is the location of the monitor code and its data area. For selection the monitor program use the Target Interface Setup dialog, page Monitor and check Download Bootstrap Loader to Target and Use Standard Monitor. With the ... button you can browse a suitable monitor from the database. The monitor code will be downloaded via bootstrap loading sequence. The properties as baud rate and TTL-RS232 driver usage will be taken from the bootstrap loading settings. To change this properties use the page Boot and Init.

106 of 167 Downloading the binary File User's Guide Custom defined monitors are possible with the help of the Monitor Development Tool. Use such monitors as external monitor in the page Monitor. Note, that the correct type of monitor must be selected as Debug Communication Channel.

Select a CAN monitor program Select the CAN monitor as Debug Communication Channel. Furthermore, you have to setup the correct baud rate and CAN-ID. Additional make sure, that the bootstrap loading and initialization settings are correct in the page Boot and Init. Select a 3Pin monitor program Because the 3Pin monitor is more configurable, an additional step for monitor building is required. Use the 3Pin Monitor Wizard “flashmon.exe“ from the for building a user defined monitor. Select the three pins for communication and setup the monitor location. Use this generated monitor as external monitor code in the page Monitor. Note, that the correct type of monitor must be selected as Debug Communication Channel. Additional make sure, that the bootstrap loading and initialization settings are correct in the page Boot and Init.

Select a ROM based monitor ROM monitors are located in the target’s non-volatile memory (FLASH or EPROM) and will be started by power on of the target board. The build of a ROM monitor is supported by the Monitor Development Toolkit, offered by the PLS Development Tools. This toolkit provides the source code of our monitors prepared for the supported compilers. On this way, the user can build its “own” monitor program. Before you can debug the application with a ROM monitor, the monitor code must be flashed into the non-volatile memory of the target system. For that, you can use a bootstrap loading based communication, i.e. the ASC Boot monitor. Switch your hardware to bootstrap loading mode and use the internal FLASH MemTool of Universal Debug Engine for programming the monitor code.

Monitor-less solutions On principle for the JTAG/OCDS L1 communication, no monitor is required.

Note: Because of the internal architecture, the C166CBC derivatives require a monitor still. In the page Monitor the location of monitor and vector table can be adjusted. However, the monitor will be loaded into the target system transparently via JTAG/OCDS ! L1.

User's Guide Downloading the binary File 107 of 167 Connect the target system After the preparations of the communication channel, you can connect the debugger with your target hardware. Make sure, that the hardware is reset and correct initialized. Push the button Single retry and the debugger will connect the target via the new communication channel. After the successful connection, the following message is shown: UDEDebugServer: Connection to C167CR target monitor established: monibc67 V3.42 08/00 (C) 1991/2000 pls Programmierbare Logik & Systeme GmbH.

Download the application To download the application select Load Program from menu File. In the following file selection box you can browse to a binary file and open it. After that, the program is downloaded into the target and the debugger is ready to go through the program. The instruction pointer is set to the default entry point of you program, usually the start-up code. The start address depends from your used target architecture.

Viewing Program Code The Universal Debug Engine features the viewing of program code in C/C++ and Assembler level and provides the view of the program from three different standpoints. It shows the source files, the functions and the sections of the loaded program. The workspace window helps you to navigate into the parts of the program.

Note: UDE provides the view of the source code parts located in the program sections by default. For viewing of code outside of the program location, you may use the single ! program window view.

Workspace The workspace window shows all program specific information and makes the navigation through the parts of the program easier. The project is shown as tree control with source files, functions and sections. You can expand the view to the content by left clicking on the [+| -] Symbol. If no workspace window is visible, open it via Window - Project Workspace.

Source files The folder Source files lists all sources of the current project. With double-click you can open the source or bring the source window to the top.

Functions In the folder Functions all C/C++ functions of the loaded program are displayed. By double-clicking on an entry in the workspace window, the cursor is set to the corresponding line in the source code windows.

Sections Sections are consecutive memory areas of code or data blocks. In the folder Sections all allocated memory areas are listed, also the non-C/C++ parts of the program as the start- up code, vector table and so on.

108 of 167 Viewing Program Code User's Guide Program Window In the program window, the source code is displayed. The Universal Debug Engine supports a C/C++/Assembler source oriented view mode and a disassembly view mode. Both display modes may be merged. If no C/C++/Assembler code is available UDE shows disassembled instruction only. The switch between the view modes C/C++ and C/C++/Assembler is made via the context menu and the Mixed Mode entry.

C/C++ oriented view mode

The yellow pointer indicates the current location of the instruction pointer. After each step, the position is updated. The solid red circle shows that a breakpoint is located at this position. You can only set breakpoints to C/C++ source line indicated with a small blue dot or to assembler lines. The small blue dot means that the compiler has generated machine code for this C/C++ source line.

C/C++/Assembler mixed mode The picture below shows the upper example displayed in the mixed mode. Each C/C++ source line is shown with the corresponding count of machine code lines. The breakpoint indication is set to the real address location in the machine code.

User's Guide Viewing Program Code 109 of 167 Single Program window mode One program window shows the target memory content as machine code with symbolical information (code labels, C/C++ source lines) if available. The display position can be moved by keyboard and mouse. If a source file was not found by the debugger automatically, the file name and source line number will be displayed. In this case, a mouse double click on this line opens a file dialog to browse in the file.

The Single program window mode can switched on/off in menu Views - Single Program Window and with a corresponding toolbar button.

Disassembly view mode The Disassembly view mode is only used, if no source is available.

110 of 167 Viewing Program Code User's Guide Printing of program code Via menu File - Print or the shortcut the content of the program code window can be printed via the system printers. It is possible to print all pages, a set of pages or selections. All view modes are supported.

Running a program After the successful downloading of the program into the target, the program can be started. The instruction pointer is set to the first instruction of the code. For example in the C166 architecture, the address 0x0000 is used. To start your program, use the menu Debug - Start Program Execution, or the key. Your program will stop under following conditions: 1. A breakpoint is reached. 2. A manual user break is made via menu Debug - Break Program Execution.

Note: Usually the compiler implements code for the case that the program returns from the main function. Often it is implemented as an infinity loop, so that the program will continue running after the main's return. A solution for that problem is using a breakpoint ! at the last return instruction.

Inline Assembler The integrated inline assembler allows the change of several machine instructions. It is available in program windows in mixed mode or disassembly mode only. To input a new machine instruction set the mouse cursor to the assembler line and use the context menu. The entry Integrated Assembler allows to start the Inline Assembler. In the following dialog box you may input the new machine instruction. Push the button OK and the new instruction will be written into the target's memory.

Attention: If the new instruction does not fit in the alignment and length of the code, a further instruction line is inserted with non-valid instructions. Be careful that non-valid ! instructions are not occurred in the code.

User's Guide Running a program 111 of 167 Viewing and Modifying Registers The Universal Debug Engine enables you to display and modify the complete register set of the current microcontroller derivative on different ways. In addition to the predefined CPU window and to the configurable SFR window UDE offers the feature of a user- definable HTML based extension window.

Kinds of Register Views

Description of SFR, CSFR and GPR Registers Core Special Function Registers (CSFR) control the operations of the microcontroller core and provide status information about core operation. The General Purpose Registers (GPR) complete the CSFRs with a set of multifunction registers. All other registers of the used derivatives (except the CSFRs and GPRs as stated) are denoted as Special Function Registers (SFR).

CPU View The CPU window displays a selection of CSFR and GPR registers of the target controller. It allows a fast access to the PSW, IP, Address and Data Registers. It is not possible to configure the view of the register set for the CPU window.

SFR View The SFR window allows a more flexible view to the registers. You can select any free collection of CSFR, SFR and GPR registers that are displayed in the SFR window. This way, a simple custom specific view is possible.

HTML View Maximum customization is offered by the HTML window. It allows creating customer- specific HTML documents where UDE ActiveX-controls, user components and access to the UDE Object Model are embedded. This allows you to visualize and control aspects of your target system in a more understandable and attractive way.

CPU View To open the CPU view use the menu View - CPU window. A predefined selection of CSFR and GPR registers of the target controller will be shown.

Changing the register content To modify the value of a register in hexadecimal mode move the mouse cursor over the target register content and double-click. An edit box with the content will open and allow you to modify the register value. To enter the value push the key or click with the mouse outside of the register box.

Color coding The register values appear in three colors indicating the current state of the value. Register Value Color State of the Register Value Red Value has been modified by the program during the last step Blue Value was changed by the user, but not yet written into the target Black Value was not changed

Note: For writing the user-changed value into the target, click outside the edit box, but inside the CPU window or push the key. Otherwise, the value will not be ! written into the target.

112 of 167 Viewing and Modifying Registers User's Guide SFR View

Creating or changing a SFR view In the SFR View all registers of the CSFR-, GPR- and SFR-sets of the current microcontroller can be displayed and modified. To open a SFR View, select Views - SFR Window from the menu. For selecting or deselecting the registers, simply use the context menu via a right- click on the SFR window. Now click on the Browse menu item to open the Register Selection dialog window. All available registers of the current microcontroller will be displayed in that window. They are assorted according to the peripherals they belong. To select a register, expand the list and scroll to the special entry for that register. Click on Select or simply double-click the entry to insert it into the SFR window. A ToolTip will give you a short description of every register in the list. If the Expand checkbox is activated then the new register is automatically expanded in the SFR window. If a register is already in the SFR window, it is marked bold. To remove a register from the SFR window move the mouse over the register and open the context menu via right click. Then select Delete to remove the SFR.

Changing the layout The SFR window displays the registers and the values in a table format. The two columns on the left show the name and the current value of the whole register. If you move the mouse over the name, a short tool tip will show you the address, the reset value and a short description of the register. If you expand a register, the belonging fields and bits will be shown in columns right to the name and current value of the register. The names of the fields are the same like in the controller manual. The current value of each field is shown in a translated form. That means you will not see the hexadecimal value but the meaning of the setting. An example SFR view shows the following figure. There are some SFRs added to the window. The PLL_CLC register is expanded and you can see all the bit fields and the meaning of the current setting.

It is possible to display more than one bit field per row. This is useful if the register has a great number of fields (e.g. port registers). You can select 1, 2, 3 or 4 fields per row. To change the layout you can use the context menu and go to Layout. In the submenu select one of the alternatives. You can also change the order inside the SFR window. Move the register per Drag ’n Drop from one location to that place that you want. The layout of the SFR view content can be exported and imported via Content from the context menu.

User's Guide Viewing and Modifying Registers 113 of 167 Changing the register content To change the register content you have two possibilities. The first one is to change the complete value for one register. To do this, select the register (complete row will be marked blue) and move the mouse cursor over the register value (second column). After that open the context menu via right click. Select Change will prompt a cursor inside the value. Now you can modify the data. Press return to accept the new data and to write it into the target. As a shortcut simply press ‘F2’ to enter the change mode. The second possibility is to change not the whole registers, but only one bit field. Expand the register to display all fields of it. Then select the field that you want to change, move the mouse cursor over the value and open the context menu. Now you can select one possible setting for this special field from the menu or select change to enter a hexadecimal value manually. To enter the change mode you can use the shortcut ’F2’

Note: Some registers have a lock symbol left to their name (e.g. the BIV register in the figure above). That means that these registers are EndInit protected. To change their ! values you must first unlock them. For that registers a new option Write protect is in the context menu. If this option is disabled the lock symbol is also in an unlocked state. Now you can change the data. The Debugger performs a special access cycle in this case.

Saving and Restoring If you want to save your current window configuration for later use or for other projects, you can use the Content option from the context menu. Select Save from the submenu opens a file dialog where you specify the filename. Later or in other projects, you can load the SFR window content by selecting Load from the context submenu.

Color coding The register values appear in three colors indicating the current state of the register value.

Register Value Color State of the Register Value Red Value has been modified by the program during the last step Black Value was not changed

HTML View based on the UDE Object Model The HTML view is suitable for visualizing and controlling of contexts of custom specific target hardware.

Note: All HTML views are interactive only when they are running under the UDE desktop ! control. That is why the HTML window for viewing must be used. The online help system contains a detailed description of the UDE object model illustrated with many examples. The documentation can be found at \Help\UdeObjectModel.chm

114 of 167 Viewing and Modifying Registers User's Guide Watching Variables The Universal Debug Engine features two kinds of windows for viewing the contents of C/C++ variables. 1. The content of the Watch View can be defined by the user. All types of variables (automatic, static and global) are possible. 2. The Locals View shows all-automatic and function/block local static variables that are valid in the current scope.

Watch View

You may open the Watch View by clicking Views - Watch. The Watch View content can be defined by the user. Adding of variables may be done via right clicking in the Name column and using the context menu entries Browse or Expression. Alternatively, you push the button for selecting a variable from the variable list or the button for editing the name of the variable. Expandable variables, i.e. pointer and array, are shown with a + / - flag in front of the variable. Use this flag to collapsing and expanding of the variable's elements. The variable view format can be selected from decimal, hexadecimal and ASCII. For this purpose, two value columns are displayable. The physical address of the variable part is also displayable. Variable values can be easily changed by clicking in the value area and typing in the new value. Additionally, the context menu entry Change and the button are usable.

Note: In the first line of an expandable variable the value means the base address of the variable. In the example above, the abyBuffer variable is an array. The first line value ! entry 0x4001 points to the base address of abyBuffer in the target's memory.

Watch Expressions In the previous section, the selection of variables to view from a list by its name was described. Beside this, it is also possible to define watch expression, which means the manual selection of variables and parts of its structures.

Global Variable description

Syntax VariableName (global) VariableName# The second form is for compatibility reasons to fast-view66 only.

Example g_nCount (global)

User's Guide Watching Variables 115 of 167 Module static variable description

Syntax VariableName [source_file]

Example nLastTime [time.c]

Function static variable description

Syntax VariableName [source_file]:{function}

Element Description Example source_file Name of source file with extension and without ..\time.c path (A relative or absolute path from the v:\time.c command line of compiler is also possible but has to match exactly) function Function name

Example nLocalCount [time.c] : {timer_overflow}

Global, static variables and parts of it Global and static program variables means all variables with a fix address, which means not stored in registers or on the stack. Such variables and parts of it can describe in common C-Syntax, as the expression would used in a C program.

Syntax ?()

Examples ?(abyBuffer[5]) ?(timeStruct) ?(timeStruct.hour) ?(arrayOfTimeStructsInstance[4].hour)

Real expressions Real expressions means expressions that value do not have a fix address. Therefore, these expressions consist of two or more global or static program variables and may contain constants. They can describe in common C-Syntax, as the expressions would used in a C program.

Syntax ?()

116 of 167 Watching Variables User's Guide For compatibility reasons to former products functions following inline function in expressions is supported

fconvert("[,]",)

and are in %G syntax. default value is 0. is integer expression. This inline function will be converted after input to following expression

()*-

Examples ?(timeStruct.hour*60) ?(timeStruct.hour*60+timeStruct.minutes) ?(arrayInstance[i]) ?(arrayOfTimeStructsInstance[i+1].hour) ?(i+3)

Please note, that 'i' can be a variable of global or static scope.

Real expressions with alias name Real expressions with alias name mean the same like real expressions in paragraph 2. In addition, an alias string can be assigned.

Syntax ?("", )

Input Examples Output Examples ?("%d minutes left", timeStruct.hour*60+timeStruct.minutes) 73 minutes left ?("Temperature: %G °C",((a+b)*2)/30) Temperature: 47.21 °C

Description of watch view content in a file It is possible to describe the watch window content in a text file. The file can Load/Save via the context menu in watch window.

Syntax description

Every line contains one watch variable description or watch expression like explained in chapter II and III of this document. Blank lines and comment lines are also allowed. Comment lines start with a semicolon character (';') as the first non-whitespace-character of the line.

Adding Variables and Expressions using Select Watch Dialog This sizeable dialog makes it possible to add static and global variables (all variables with fixed address) and complex expressions using these variables of loaded program to watch window.

User's Guide Watching Variables 117 of 167 The dialog contains two tabs:

 Variables Tab: This dialog page enables to add variables to the current watch window. Variables are sorted by scope: Global variables, Module static variables, Function static variables, All static variables and a list of all. Within lower hierarchy levels the entries are sorted in alphabetical order.  Expressions Tab: The expression tab is the viewer for the global debugger “Expression Clipboard”. It shows user defined expressions from Watch and Graph window and expressions loaded via 'Load' button from *.wat or *.wax files . An expression can added to the Watch or Graph window from here.

If expressions contain only one integer variable, this variable is extracted automatically and can be selected separately. This expression itself allows enables an additional display feature, which is called Advanced Expression Resolution:

This means the parallel display of multiple values for the expression, which contains only one integer variable. This makes it possible to display the calculated value of the expression and of the corresponding integer variable. Following additional implicit functions are available for such expression:  Formula simplification  Recognition of such formula type  Automatic extraction of integer variable  Changing of expression and variable possible  Recalculation and changing of integer variable in target if expression value is changed

118 of 167 Watching Variables User's Guide Locals View Open the Locals View by clicking Views – Locals. The Locals window displays all automatic and function/block local static variables defined by C/C++ scope rules. This view is not configurable, but refreshed automatically. The variables are shown comparable with the Watch view and the values can be changed in the same way.

Automatically variable content refresh UDE can refresh the variable content during all states of the target, assumed that the target is in a connected state. Via the context menu the automatic refresh period can be setup. A manual refresh is also possible.

Stepping and Breakpoints

Overview In general breakpoints are used the stop a running target system. On the one hand, breakpoints help you to follow the program flow and on the other hand, they allow you to see the actual program and processor status. Shortly, they are helpful to observe the behaviour of the watched program. With the support of the OCDS L1 modules of C166CBC and TriCore UDE offers some new features of debugging. The OCDS L1 module can be programmed as a user defined trigger and supports hardware breakpoints, stops the microcontroller when a target read/write access occurs and stops in dependency of the ALU result.

Following the program flow The Universal Debug Engine supports the stepping through the program on a very comfortable way. Many features are available for controlling the program flow. You may use the menu Debug or the task bar for selecting the matching feature. Step into Subroutine Step into the Subroutine means that all code lines are executed step by step. Step over Subroutine Step over the Subroutine means that subroutines are executed, without the inside of the Subroutine is shown. Step out Subroutine If the IP is located within a subroutine the Step out command jumps to the calling procedure of the subroutine. Run Program to Cursor The program is started and is run until the instruction pointer reaches the location defined by the current cursor location.

User's Guide Stepping and Breakpoints 119 of 167 Stop the program at a specified location The Universal Debug Engine allows setting breakpoints in the program manually. These breakpoints stop the execution of the program, when the microcontroller reaches this location. Fundamental you can differentiate between conditional and absolute breakpoints. Additionally data breakpoints are supported.

Absolute Breakpoints Absolute breakpoint means a program stop at a specified target location without any conditions. Setting of breakpoints can be done via the context menu of the program window. Set the cursor to the program line and open the context menu via right clicking. The entry Insert/Remove Breakpoint set or reset a breakpoint to the specified program line. As a result, a solid red circle is shown on the left side of the program line. The entry Enable Breakpoint enables or disables the specified Breakpoint. Disable breakpoints are shown as red circles. The breakpoint dialog reachable via menu Debug - Breakpoints gives you an overview about all breakpoints.

Conditional Breakpoints Conditional breakpoints are used to halt a program because of a predefined condition. To setup the conditional breakpoints use the breakpoint dialog, reachable via menu Debug - Breakpoints ...

Data Breakpoints UDE supports the usage of data breakpoints if on-chip debug support on target MCU is available (e.g. OCDS L1). This means that the program will break when a read or write access to a memory location is happen. Data breakpoints can be set in Watch View and in Memory View. The context menu of a Watch Window serves to set data breakpoints. This option is available only if the connected target supports data breakpoints. It can use at a one or more selected main and child entries in all columns except the . The memory range for the data breakpoint will build up from the start address and the length of the selected entry. If a head entry of a complex data type (e.g. structure or array) is selected a data breakpoint at the length of the whole type is set. The breakpoint can be set on Write, Read or Read/Write accesses. All data breakpoints can be enabled, disabled or cleared together. Data breakpoints can be used in the Memory Window similarly, the same context menu is available. These breakpoints are shown with red mark analog code breakpoints.

120 of 167 Stepping and Breakpoints User's Guide Breakpoint dialog

Hardware/Software Breakpoints Corresponding to the used target controller hardware and software breakpoints can be used.

Software breakpoints are special microcontroller instruction that will cause an interrupt or trap. To set a software breakpoint the program code must be modified. Because of that the program part for debugging must be located in a RAM memory area. Hardware breakpoints are only available with the support by specialized hardware architecture. For example, the C166CBC, the C166S and the TriCore microcontroller feature the OCDS L1, the On-chip Debug Support module, which allows hardware breakpoint. With using of hardware breakpoints, the program code can be located in all kinds of memory systems.

Note: The hardware breakpoints are a limited resource. That is why, not all breakpoint constellations are solvable with hardware breakpoints, i.e. breakpoints in complex case ! expressions.

Loop qualified breakpoints At this time loop qualified breakpoints are available. This means that the breakpoint will cause a microcontroller stop after a predefined count of loops over the breakpoint location. In the example above the Breakpoint 0 has been reach zero times and will stop the microcontroller after eight loops. The start point and end point are defined in the breakpoint dialog. The checkbox Loop enables the condition for the selected breakpoint. The value shows the current loop count and the Goal box defines the endpoint. Both values are editable and shown in the upper list box in the columns Max. Loops and Curr. Loops. Counting the loops is done at the host side, thus the user application is stopped and restarted if the passes the given location. Condition Here a C-Expression can be entered. This expression is evaluated each time the program counter passes the location of the breakpoint. If the result of the expression is not equal to zero then the user application is halted. Macro If the user application is halted due to the breakpoint then the macro with the specified name will be executed. Please refer to macros and UDE Object Model how to write and load macros. The buttons Add and Change show sub dialogs for adding and changing of breakpoints. You can set or move breakpoints to functions and code locations directly.

User's Guide Stepping and Breakpoints 121 of 167 Breakpoint identifier Assembler Breakpoints are defined via its physical address location on assembler level. However, High-Level-Language Breakpoints have a reference to the source code, specified via module, function, source code line and so on. That is why the breakpoint description of a HLL-Breakpoint is more difficult.

Syntax description 'function {source_file}.line[+]';module[,module2...];line_range; line_offset;[address_offset];

'label [+ address_offset]';module;

address

Element Description Example function Function name quick_sort source_file Source file name sort.cpp line Line number - A plus sign (optional) means that 50 the breakpoint is near the corresponding address only and it is not an high level language breakpoint (Assembler breakpoint). Assembler breakpoints have one address only. module Module name - Module names separated by SORT commas.

line_range High-level language breakpoints at source lines can cover different code ranges. This is the position number of the corresponding code range. The number starts with one and increases with growing addresses. line_offset This is the line number offset from start of function to the breakpoint line. This saves the breakpoint description against source file changes around the function.

address_offset For Assembler breakpoints, this parameter describe the address offset from the corresponding line or label address to the breakpoint address. Can be null (0x0) to describe an Assembler breakpoint at a line address. label Label name. quick_sort address Pure hexadecimal address with 0x prefix. 0x200

122 of 167 Stepping and Breakpoints User's Guide Viewing Memory Locations For viewing and modifying of the target's memory locations, the Memory Window is usable. It is available via menu Views - Memory Window or the corresponding tool bar button. The leftmost column displays the address of the data, and the columns beside the address column show the data in the selected format. You may specify the format using the context menu as Byte for 8 bit data, Word for 16 bit data and DWord for 32 bit data. Independent of the data width, an entry named Decimal in the context menu allows toggling between hexadecimal and decimal display. To change values simply overwrite the selected location with the desired value. The Memory Window ignores the input if a key is pressed which is out of range for the current format (for example, if typing in the letter X in any but ASCII format range). The size for editing addresses is limited to 8 chars. Addresses in integer based modes must be entered in hexadecimal form without any extensions like '0x' or 'h'. This differs from entering addresses in floating point modes.

Please note that you can also type in symbolic names of programs object into the address field.

Writing data to target There are two modes to write data to the target. The first one - Auto Write - writes the user-modified data as soon as the user moves the cursor to a different location (address) while in the second mode the user is responsible to write the data to the target using the context menu entry Write explicitly. Data modified by the user, but not written into the target system, is displayed in blue color.

Note that data marked in blue color might differ from the data in the target.

Toggling between these modes is done with the context menu entry Auto Write. When writing to the target, the values will be verified. If the read value has the expected value, the color is changed from blue to black. When writing has failed, the color is changed to red.

Updating data from target Updating is done when the user application switches from running to stop and when the Memory Window is scrolled. In each case, the entire previous snapshot is discarded. If the data has not changed, the new snapshot is compared against the old one and modified data will be displayed in red color. Data coloring for different states of the entries:

! Register Value Color State of the Register Value Red on White Value has been modified by the program during the last step Blue on White Value was changed by the user, but not yet written into the target Black on White Value was not changed White on Red Data Breakpoint enabled Black on-pink Data Breakpoint disabled White on Blue Data Range selected

User's Guide Viewing Memory Locations 123 of 167 Printing of memory locations Via menu File - Print or the shortcut the content of the program code window can be printed via the system printers. It is possible to print all pages, a set of pages or a selection. All view modes are supported.

Viewing Data as Scientific Chart The UDE graphical window displays target program data as series of a scientific chart. It is a powerful visualization tool, which helps to accelerate the evaluation of complex target program data from process environment and by the verification of complex software algorithms. It can be used with all microcontroller families supported by UDE. The UDE window displays pre-processed target system data as data series of a 2- dimensional scientific diagram. This feature makes it easier to visualize and evaluate target data to accelerate the verification of complex software algorithms and input from process environment.

Basic features of the Graphic Display Window  Multiple curves in one diagram window  Separate x- and y-axis for each curve  Flexible calculation of curve data points from target program data with UDE expressions  Update of data after program hold or with programmable refresh rates during running and stopped target program  Save and restore of complex settings in UDE workspace and separate file For using the Graphic Display Window the window is available via menu Views - Graphic or the corresponding tool bar button.

Using Expressions The typical application of Graphical Display Window displays target data, which are stored in target program’s data arrays. The description, which parts from target array data is displayed, is held flexible.

124 of 167 Viewing Data as Scientific Chart User's Guide The detailed description of the expression syntax can be found at \Help\UdeGraphWin.chm chapter „Reference/Using Expressions“.

Graphical Display Window Properties The context menu allows following modifications: Zoom changes the cursor to cross cursor to select the Zoom range. Push the left mouse button down at the diagram position, where the zoom rectangle has to start, hold the button down and pull the zoom rectangle to the opposite endpoint. If the button is released, the zoom operation occurs. The nested zoom state is saved and could be recovered with Zoom out function or via the Reset function to return to un-zoomed original state immediately. To release the zoom operation mode, re-open context menu and activate the Select function. If a nested zoom-out operation is pending, the context menu contains an additional Zoom out entry. Zoom out restore last previously stored zoom state or the original window state, if all nested zoom states are restored. Enter the Pan mode and change the cursor into a typical move cursor. If the left mouse button is held down, the whole diagram can be dragged from current view position into another view position. The axis coordinates are changed according to the new position. The Reset function restores the original window state. To release the pan operation mode, re-open context menu and activate the Select function. The Cursor mode opens a line cross over the whole diagram area and an additional window, that displays the x- and y- values of all corves at the current line cross center. To release the cursor operation mode, re-open context menu and activate the Select function. Load external opens the file open dialog and asks for a file name that contains a complete set of current graphical view settings. The current content of the graphical view windows will be deleted and the window restores the content from graphical view storage file.

Viewing Call Stack The Call Stack window displays the calling hierarchy of the program. The top entry shows the actually IP location and the name of the currently executed function, if available. The entries below list the return addresses in the sequence of their occurrence. With a double-click to a stack entry, the corresponding location is shown in the program window. So, an easy navigation through the current program hierarchy is supported.

Once a line is selected the default context in UDE is changed to this location and all information in watch, locals and in the CPU window is related to the selected context.

In the example above the actual IP location is 0xD40041F0 in the timer_handler() function. This function was called by an interrupt occurring while execution of the main() function. The function will return to the address 0xD4004230 in the main() function. The section between the two functions means the interrupt handling code. The entry at the bottom shows the return point in the startup code. Because the startup code is not a high-level-language part of the program no function name is displayed.

User's Guide Viewing Call Stack 125 of 167 Program Execution Time Measuring Program execution time measuring is supported by UDE via  Trace unit on target. Please refer to the chapter about time measuring  Timer unit on target. To use time measuring via target timers the feature has to be enabled in the target interface. Connect to the target and open the target interface setup. Open the page Monitor respectively the page Debug and enable the Program execution time measuring. Select the timers for usage if available. Open the toolbar Config, double-click to the right field, labeled with Function disabled per default. A properties dialog will be opened. Enable the time measuring in this dialog. Select the adequate working mode:  Continuous mode - the timer accumulate the lapsed time  Single step mode - the timer shows the lapsed time of the last single step of UDE.

126 of 167 Program Execution Time Measuring User's Guide Trace, Visualization and Analyzing Hard real-time debugging requires close interaction with the processor. Tracing shall provide a chronological picture of a system's inner workings up to, starting from or in the vicinity an event, mainly to guide a human in understanding a faulty program. MCDS, Nexus, CoreSight, ETM and OCDS L2 were defined for this purpose. These trace ports are available on the TriCore, PowerArchitecture and ARM derivatives. OCDS L2, NEXUS and ETM trace are supported by the Universal Access Device 2+ - and Universal Access Device 3+ -Trace Board add-on. MCDS and ETB are embedded trace ports including the trace buffer on-chip, which reduces the requirements of an external trace analyzer to a minimum. Triggered Transfer is a feature of TriCore and XC2000/XE166 micrcontrollers for high performance polling of target memory. Memory Transfer means the transfer of data via debug channel. Cortex can provide trace event messages via the Serial Wire Output SWO or Instrumentation Trace Messages ITM.

Trace Sources

MCDS Nexus CoreSight ETM OCDS L2

Processor EmulationDevice Automotive TriCore ED, Power ARM, Cortex TriCore, PCP support XC2000 ED Architecture Event Event Event Pipeline Output format Messages Messages Messages States

Message Message Message Processor Time accuracy1 Tick Tick Tick Tick TraceAddon: TraceAddon: TraceAddon: On-Chip Memory: + + + Trace memory UAD2 - 5 MByte UAD2 - 5 MByte UAD2 - 5 MByte up to 768 kByte UAD3+ - 4 GByte UAD3+ - 4 Gbyte UAD3+ - 4 GByte Instruction Trace Instruction Trace Instruction Trace Instruction Trace Trace covering Data Trace Data Trace Data Trace Data Trace Continuous trace, Advantages complex trace Continuous trace Continuous trace Continuous trace filter Limited by size of Limited by size of Limited by size of Limited by size of Disadvantages trace board buffer trace board buffer trace board buffer trace board buffer

Trace Sources (cont’d) Triggered Memory ETB ITM / SWO Transfer Transfer Processor TriCore, XC166, All except ARM ARM, Cortex Cortex support XC2000, XE166 Data Signal and IP Pipeline Event Output format Snapshots Snapshots States Messages

Endless Trace Endless Trace Processor Endless Time accuracy1 ≥ 100ms ≥ 1ms Tick Trace

Buffered in Buffered in On-Chip Memory: Buffered in Trace memory UAD2, UAD3 UAD2, UAD3 up to 6 kByte UAD2, UAD3

IP and Data Instruction Trace Trace covering Data Trace Data Trace Trace Data Trace

Endless trace Endless trace Endless trace Advantages Continuous trace possible possible possible

Non-continuous Non-continuous Limited by size of Non-continuous Disadvantages trace trace trace board buffer trace

1) depending from target system

User's Guide Trace, Visualization and Analyzing 127 of 167 Trace Analyzing Features and Views Analyzing of traced data is one of the features supported by UDE. The analyzing functions support the viewing, profiling and detecting of the recorded data and is realized by different views of Universal Debug Engine to display the results of recorded IP trace and data trace.

Trace Visualization and Analyzing

Trace Profiling

FunctionTime View format Statistical chart Statistical chart Flow chart chart OCDS L2, MCDS OCDS L2, MCDS Trace source Memory Transfer Nexus, ETM, Nexus, ETM, MCDS ETB, CoreSight ETB, CoreSight Displays Displays hits of Displays recorded IP Exact sampled IP recorded IP addresses hits Method of measurement of addresses addresses hits assigned to runtime of Visualization assigned to assigned to function ranges selected function function ranges function ranges or hexadecimal addresses Minimum, Endless trace, Exact profiling Graphical display maximum and good results over the of IP trace average of approximation recorded time records to get a function runtime- Advantages about most range of IP better global needs periodic runtime- addresses in overview about behaviour of consuming trace buffer program flow program flow for program parts best results

Trace Visualization and Analyzing (cont’d) Code Trace View Signal Trace Coverage

View format Message Log Indicator Flow Chart Message Log

MCDS Nexus, ETM, OCDS L2, MCDS ITM, Trace source Memory Transfer ETB, CoreSight, Nexus, ETM, ETB Trigger Transfer OCDS L2, ITM Displays all Displays values Displays all Displays all recorded of a variable or recorded Method of executed information expression in information instruction in Visualization contained in raw time scale contained in raw program window trace data window trace data Raw trace, flow of Flow of recorded recorded IP data IP addresses, Endless trace, full Raw trace, flow of Advantages related to detection of scaling of time recorded data appropriate incompleted and value interval source code execution of code

128 of 167 Trace, Visualization and Analyzing User's Guide Trace Profiling as Statistical Chart The Instruction Pointer Profiling page debug displays profiling results of occurrence of instruction pointer samples inside of functions of a running program. As trace sources Triggered Transfer, MCDS, Nexus, CoreSight, ETM and OCDS L2 Trace can be used.

Configuring the IP Trace Window as Statistical Chart (Triggered Transfer) A Statistical Chart over all functions is available based on the Triggered Transfer functionality of UDE. Triggered Transfer with TriCore and XC2000/XE166 microcontrollers uses a feature of these microcontrollers to reach a high polling performance and is only available with these microcontrollers. Using the UAD2, a sampling period in the range of 1 millisecond (1 ms) is assured for snapshots of the actual content of the instruction pointer in a selectable period during running target program. Open the trace window by menu Views – Instruction Pointer Trace Profiling.

The chart displays the actual statistics of instruction pointer sampling results. The hits of the samples are assigned to the function or sections of the current loaded program. The accumulated hits for each range will be displayed in percent of hits of the appropriate range to the count of all accumulated instruction pointer samples. The CPU execution time will be calculated from approximated execution time based on period between two samples. The refresh period can be changed at the setup section.

User's Guide Trace, Visualization and Analyzing 129 of 167 The details of instruction pointer profiling data can be obtained from profiling result table section.

Configuring the IP Trace Window as Statistical Chart (MCDS, Nexus, CoreSight, ETM, OCDS L2) The Statistical Chart view is also available based on the MCDS, Nexus, CoreSight, ETM and OCDS L2 trace functionality of UDE. Open the corresponding trace window by menu Views - MCDS Profiling window, for example. The usage is comparable to the behaviour above. The window content is updated when the corresponding Trace View has recorded new items.

130 of 167 Trace, Visualization and Analyzing User's Guide Configuring the Profiling Window as Statistical FunctionTime Chart Based on the Trace recording of MCDS, Nexus, CoreSight, ETM and OCDS L2 trace, the Function Time of used function can be statistical measured. Enable the Profiling add-in via menu Config - Add-In Components and select Profiling. Open the Profiling view via menu View - Show Profiling View. In this example, a XC2000ED with MCDS support and the timedemo from the example directory will be used. ! Please note, that all settings from the MCDS Trace View must be removed. Open the dialog via menu Tools - Setup Profiling. Add the functions timer_handler in the tab Function. Select FunctionTime in the tab Measurement. In the Options tab, the maximal measurement time can be change. Close the dialog. Select now FunctionTime from the selection form on the top of the Profiling Windows. Run the program and start the Profiling via Tools - Run Profiling. After a short time, the result is displayed in the Profiling Window.

The resulting chart shows the statistical information about the measured value of avarage, minimum and maximum execution time of the selected function.

User's Guide Trace, Visualization and Analyzing 131 of 167 Trace Profiling as Flow Chart The UDE window displays pre-processed target instruction pointer trace stream system data as data series of a 2-dimensional scientific diagram. This feature makes it easier to visualize and evaluate target data to accelerate the verification of complex software algorithms and input from process environment. The Scientific Chart view can be used with all targets which support hardware trace - MCDS, Nexus, CoreSight, ETM or OCDS L2 trace.

Features of the Graphic Display Window Instruction Pointer Trace The Instruction pointer mode (left image) displays the instruction pointer trace as data series of hexadecimal addresses. The Function trace mode (right image) displays the instruction pointer trace assigned to the high level language function ranges. For switching between the two modes, open the context menu and select the mode using Change mode of graphical view. A Find function is available to enhance the search- and zoom-function to find specific trace samples and zoom into specific sample ranges recorded via MCDS, Nexus or ETM trace channels. For that, the chart has to switch into Zoom mode via context menu. Double click to switch to program code. If current cursor position is snapped to a valid code address, a double mouse click at this position switches to a open program window or opens a new program window, which contains the appropriate source of the trace sample recorded by MCDS, Nexus or ETM trace channels.

Configuring the IP Trace Window as Flow Chart At least, one of the UDE add-in MCDS, Nexus, CoreSight, ETM or OCDS L2 Support must be enabled. Open the trace chart by menu Views – Instruction Pointer Trace Chart.

The trace data visualization will be updated, if new trace data are decoded and if they are available for all trace data sinks. Therefore it is not necessary to define additional settings then program the appropriate trace source to enable trace of instruction pointer values. A complete example, how to setup UDE to generate an instruction pointer trace, is available in a former chapter of this manual (see chapter “A TriCore MCDS Trace Example”).

132 of 167 Trace, Visualization and Analyzing User's Guide Code Coverage UDE supports the Code Coveraging via analyzing of recoreded trace streams.

Configuring and Run Code Coverage in Program Window Based on the Trace recording of MCDS, Nexus, CoreSight, ETM and OCDS L2 trace, code coverage information can be displayed in the Program Window via green markers on each executed code line or executed instruction which was covered by the trace. Open a Trace View, e.g the MCDS Trace Window, and configure the settings of trace corresponding to your requirements. This sample uses the MCDS trace of an XC2000ED.

Start now MCDS and run the program. The trace buffer will be filled. Stop the MCDS recording by selecting Refresh from the context menu of the Trace Window. As result, the Program View is updated and shows green markers on the left side, which indicate executed instructions. A yellow marker indicates an incomplete execution of a function. Using the Mixed Mode of the Program Window can help to indicate the affected instructions. Please note that the covered ranges depend only from the settings of the used trace hardware. For correct settings see the chapters above.

User's Guide Trace, Visualization and Analyzing 133 of 167 MCDS, Nexus, CoreSight, ETM, ETB, OCDS L2 Trace View MCDS trace and ETB trace can be used without any additional hardware add-on. Using the Nexus, CoreSight, ETM, OCDS L2 trace features with UDE is only possible with installed and Trace Board add-on. Please contact PLS Development Tools if your Universal Access Device is not equipped with a Trace Board. The following connectors are supported for Nexus, CoreSight, ETM, OCDS L2 trace:  Nexus High-Speed Connector; AMP Mictor  CoreSight, ETM High-Speed Connector; AMP Mictor  OCDS L2 Connector; AMP System 50 104549-6  OCDS L2 High-Speed Connector; SAMTEC QSH-030-01-F-D-A

Before using an UDE trace add-in, the Trace Board must be calibrated for using the ! correct Trace Pod. Please refer to the Hardware Appendix to setup the Trace Board. Configuring the Trace Window The UDE add-in MCDS, Nexus, ETM, CoreSight or OCDSL2 Support must be enabled first. Then, open the trace window by menu Views - Trace Window. The trace configuration can be opened by using the right mouse button for context menu of the trace window. Start / Stop Trace activate/deactivate the trace manually. Before the trace can be started, the trace properties must be set up correctly.

Note: If the window only shows rows with addresses then the window keeps old samples as long as there is no overflow of the trace buffer and the addresses are continuous. Clear History deletes the old samples that are kept. In the mode, where also empty rows are displayed, Clear History has no effect. Clear Screen deletes all samples so the window is completely empty after execution of this command.

Show Trace from helps you to navigate to the top, the bottom and the trigger position. For a finer resolution use the Find options. The Hide / Show Empty Rows menu-point toggles the display mode of the window. The trace buffer contains often many empty samples (Pipeline holes). For the choice of a compact view of the program trace hide the empty rows. For an isochronous view, choose the empty rows for showing. Show all Rows shows all hidden rows. Use the Save As ... to save the displayed samples to a file. Two formats are possible: columns tabulator separated (*.tab) or formatted with space characters (*.txt). With Find ... you can search for a term in the specified column of trace buffer. The Line Format specifies the view format of lines in the trace window. The trace buffer contains many empty samples (Pipeline holes). For the choice of a compact view of the program trace select 'Hide empty rows'. This mode suppresses lines without an assigned code line. This enables also the step history. If normal back trace is used then new samples are appended to the old ones. Thus stepping over two source lines will result in the executed code of both lines. For an isochronous view, choose 'Show empty rows'. Specify the format of timestamp. It is possible to view the timestamps of a trace sample in [ns], [us] or based on a hexadecimal index. Select it via Timestamp Format.

134 of 167 Trace, Visualization and Analyzing User's Guide Configures the trace window properties via the Properties ... entry.

This dialogs allows showing and hiding the columns of the trace window. In addition, the format of the view can be changed. Hardware settings of the trace board can be changed via the menu Config - Debug Server Configuration - Add-In – MCDS, Nexus, ETM or OCDSL2. The trace board can hold up to 1MSamples. However, a large number on trace samples will result in a large amount of time depending on the UAD host communication, PC speed and memory equipment. Max. Sample Count specifies the number of samples that are displayed in maximum. Please adjust the suitable count by trying. To many sample counts will lead to inconvenient working.

Please refer to the chapter of the TriCore/PCP, PowerArchitecture and ARM Target Interface.

User's Guide Trace, Visualization and Analyzing 135 of 167 Trace View The Trace View displays the tracing information recorded with the trace board from your microcontroller.

The Trigger column indicates the position of the selected trigger within the trace buffer. In case of tracing ranges (code ranges or ranges defined by events) the trigger indicates the start of a new range. The trigger indicator is displayed as the trigger occurs in the samples. Thus, the trigger indicator might be hidden in filtered mode. The PC column displays the address of an executed instruction. Because the OCDS L2 and the ETM ports do not provide all address information of the running program, it is required to calculate all addresses. Sometimes the calculation does not result in an absolute address, but in a relative address offset. Therefore, there are two forms of displaying addresses:  absolute address, i.e. 0xD400'0282  relative offset address, i.e. + 0x0 Reasons for the impossibility of address calculating could be:  the trace buffer overruns  Trace on Trigger with Pretrigger position is selected  Advanced Range or Advanced Single Trigger is selected and only offset addresses are asserted by the TriCore trace unit.

The Disassembly Code column displays the assembly instruction that is related to the absolute address. It is only available if an absolute address is assigned. The Source Code column displays the line of the source code that is related to the absolute address in the row. If the file cannot be found then the filename and the line number are displayed. The Timestamp column displays the time difference in ns [nanosecond] of a sample related to the triggered sample. The XPort data column displays XPort data's. See the „Hardware Description“ chapter of the UDE Manual for more information of using the XPort implemented on the trace pod.

136 of 167 Trace, Visualization and Analyzing User's Guide Trace Buffer Find Dialog Value defines the string to find in a column. The string is case sensitive and any row that contains the value as substring in the selected column will be found. The entered value is saved in a history to be used in additional searches. The history is accessible with the drop down box. Select the Column that has to contain the search string. This value is preselected corresponding to the right-click position automatically. The Up and Down specifies the direction to search for. The search starts at the selected row. Find Next starts the search. If no row is found then the dialog box keeps open. If a row is found then the dialog is automatically closed and the window is located at the row found which is additionally highlighted.

Trace Unit Setup Dialog The trace unit provides different trace modes depending from the used trace implementation and microcontroller derivative. The distinction is made only in the interpretation of the provided data. The Off settings are made neither to the Universal Access Device trace board nor to the trace unit / port. The Standard setting enables the trace unit, trace port and the Universal Access Device trace board. No settings for events or start and stop are necessary. Everything in between the user application is started and stopped is traced. Use Address Trigger to specify the address, where the trace will start, stop or where the trace is around. Address is the address that has to be passed to emit the trigger. Select the Trigger Position in the trace buffer. Left position means the trace starts on the event and samples the status signal after the event until the buffer is full or the user application is halted. Middle position means the trace unit runs and the samples are available around the trigger. Right position means the trace unit will be run and stopped when the event occurs or the user application is halted. This option used in cases where the history before the trigger is needed.

User's Guide Trace, Visualization and Analyzing 137 of 167 The Code Range setting enables the TriCore trace unit, TriCore trace port and the Universal Access Device trace board. The trace recording is started if the start address is passed and is stopped if the stop address is passed. This repeats as many times the addresses are passed and the trace buffer is not full. All code that is executed in between these passes is recorded. Thus, also function calls that exceed the range called from within this range are recorded. The Start Address specifies the address that has to be passed to start the trace recording. The Stop Address specifies the address that has to be passed to stop the trace recording.

Advanced Single Trigger The Advanced Single Triggers are available at TriCore derivatives only. It enables the trace similar to the standard trace. The trigger is not restricted to code addresses but can be every OCDS Level 1 Debug Event. The Trigger On OCDS Event specifies the OCDS Level 1 Debug Event that omits the trigger. Break Input Event is issued because of activating the external BRK_IN-pin. Core Register Access Events are issued because of an access to the TriCore core via MTCR and MFCR instructions. The Breakpoint event occurs when the program is halted on a breakpoint. The Trigger 0 Event occurs when the OCDS L1 Trigger 0 occurs and the Trigger 0 Event occurs when the OCDS L1 Trigger 1 occurs. The Setup OCDS Events button is a Shortcut to the OCDS Level 1 Setup Dialog explained above.

Measuring time differences To measure time differences of samples select the row that has to be the reference and hover over the trace sample the time difference is in question. The difference will be displayed in the ToolTip as shown in the screenshot above.

Locating source files and sections Source files and sections can be located by double clicking the row in question. If the row does contain an absolute address then a source file or a section will be displayed. If the absolute address relates to a source file then it is displayed otherwise the section containing this address is opened.

Note: Because of the synchronous sampling, the time is measured once by the UAD trace unit and is applied to all samples. If the EBU clock provided by the TriCore changes ! then the timestamp is incorrect.

138 of 167 Trace, Visualization and Analyzing User's Guide Signal Trace - Real-Time Graphical Monitoring The UDE graphical display window supports real-time graphical-monitoring of target program variables. It lets you monitor and analyze the values of variables and complex expressions calculated from multiple variables in your real-time application while the application is running. You can use this mode of the graphical display window to track down performance problems, “glitches,” and program errors. It can be used with all microcontroller families supported by UDE, which support real-time memory access (currently available for TriCore, XC166/XC2000 families, for PowerArchitecture targets, which support the IEEE-ISTO Nexus 5001 compliance classification classes 3/4 and for ARM Cortex targets). For using the Graphic Display Window the window is available via menu Views - Graphic or the corresponding tool bar button.

The variable browse dialog of New Signal Wizard or Expression Property Page allows to select expression from new Expression Clipboard (see Adding Variables and Expressions using Select Watch Dialog) as curve signals. New expression created by New Signal Wizard or Expression Property Page are always saved to the UDE global expression clipboard, if scientific time traced signal chart mode is active. For better navigation of the current display range in the whole pane of available data samples the legend display will be extended, if Zoom-, Cursor- or Move Data Window Mode is active. This extended legend contains additional information, which part of available data will be covered by actual display range of the chart window. A Tooltip popup window displays all summary information about the curve data or axis data range of the appropriate cursor position.

Using Expressions The main difference between the expressions for Real-time Monitoring Mode and for the Memory Locations Display Mode of the graphical display window is:  The expression memory locations display mode shows multiple data point at the same time because this mode displays a snapshot of different memory locations of the target program to the same system time. Therefore, these expressions contain an additional part that calculates the iteration counter to address the point of the curve.  The real-time monitoring mode calculates the same expression periodically the display the changes of the expression over the time. Therefore, it does not require the expression syntax for an iteration counter.

User's Guide Trace, Visualization and Analyzing 139 of 167 Typical for real-time monitoring expressions can be consisting of:  Simple basic program variables from type signed / unsigned character signed / unsigned short, signed / unsigned long of single or double precision floating point.  Expressions, which describes member of complex variables from type signed / unsigned character, signed / unsigned short, signed / unsigned long of single or double precision floating point.  Expressions, which calculates results from type signed / unsigned character, signed / unsigned short, signed / unsigned long of single or double precision floating point from any expression of the multiple basic variables or basic member of complex types. The main advantage of using complex expressions is, that real physical values, which must be calculated from multiples program variables, can be collected and displayed in real-time. This includes the ability to access to basic members of complex types and dynamically access to array member and to the controller special function registers. The detailed description of the expression syntax can be found at \Help\UdeGraphWin.chm in chapter „Reference/Using Expressions“.

Setting up Real-Time Monitoring Mode The real-time monitoring mode requires fulfilling two requirements:  The target debug interface must enable to access to target memory locations during running target program with a minimum of real-time violation by this target access  Due to the minimum sample period of 1 millisecond the data collection and pre- processing (expression calculation) is be executed by the firmware of the access- device. The switch between the two modes of the graphical display window can be reached via graphical display window local menu entry Properties. The scientific chart page contains all settings cover global user interface settings (colors), the global chart settings and the global data management settings: Array mode, which enables the display of a collection or array of data based on a variable index. Real-time monitoring mode, which enables display expressions (single variables or expressions calculated from multiple variables) over the time by polling target data periodically during running target program. This mode is called Time Sample Mode in the dialog boxes and property sheets of the graphical display window.

If Cursor Mode is active, the Snap to cursor to nearest curve flag enables to snap current cursor location to the nearest valid curve coordinates. If Double buffering is on, the curve data are stored double buffered. Double buffering avoids flicker effects during re-paint operations.

140 of 167 Trace, Visualization and Analyzing User's Guide The trace results of the graphical display window can be stored in an XML based data set collection. A new data set will be generated after each measurement period (depends from selected display mode). The Result storage object path of this XML file can be selected. If Array Mode is selected, the measurement period is closed after each update of the curve (typically an update of an array). If time Sample Mode is selected, the measurement period starts with the first program code run after program download. It will be closed by termination of debug session or program reload or new program download. A new data set, which was generated after each measurement period, can be added to an existing data set collection or it can discard earlier generated data set via Append data set to existing data storage.

ITM Trace Instrumentation Trace Messages (ITM) is a feature of the Cortex microcontrollers. UDE can visualize the output messages in a Log View. Enable the ITM Trace add-in via menu Config - Add-In Components - ITM Trace and open the Log View via menu Views - Trace Window. To setup open the context menu of the Trace Window and select Trace Config ... The following dialog allows access to all features of ITM. This is an example for using ITM as IP trace.

A double-click to an address entry in the Trace Window opens the corresponding source line in the program window.

User's Guide Trace, Visualization and Analyzing 141 of 167 Measuring time differences To measure time differences of samples select the row that has to be the reference and hover over the tick column of the trace sample the time difference is in question. The difference will be displayed in the tooltip.

Activating and Using Add-Ins UDE is a component-oriented development workbench. UDE desktop as the working environment of UDE can be extended with Add-Ins to expand the functionality of the UDE development workbench. Each Add-In can be activated individually for each project workspace. When a new project workspace is created, no further add-ins are activated by default.

Activating an Add-In To activate an Add-In within your project workspace and to write your application into a programmable memory device please follow these steps: 1. Run UDE Desktop and load your project workspace. 2. Use menu Config - Add-In Components to open the UDE Add-In Manager. The manager dialog shows a list of all UDE Add-Ins that are available within your UDE installation. A checkbox shows whether an Add-In Component is already loaded into the current workspace.

3. Mark the checkbox left of the Add-In to activate. 4. Use the OK button to close the Add-In manager dialog. 5. The add-in inserts new menu entries. Please see the reference of the add-in for more information using the add-in.

Removing an Add-In To remove an Add-In from your project workspace use menu Config - Add-In Components to open the UDE Add-In Manager. Now uncheck the entry of the used Add- In.

142 of 167 Activating and Using Add-Ins User's Guide Triggered Transfer Recorder UDE TTF Recorder uses the Triggered Transfer Feature of Infineon microcontrollers. Triggered Transfer is part of the on-chip debug support implemented on these controllers. It allows the transfer of a value of a single memory location via the JTAG debug interface. The transfer is triggered by a debug event of the on-chip debug support (OCDS) unit. There are several types of debug events, which can trigger the transfer, depending on the actual type of controller. A typical use case provided by all supported controller types is to trigger on write accesses on a single variable and to transfer the new value of the variable. The recording is done while the target system is in running state.

Setup For setup the TTF recorder, use the context menu. Enable/disable the recording of transferred values Address of the memory location to be transferred when the trigger event has occurred. Depending on the data wide of the transferred value, this has to be a valid 16-bit or 32-bit address. Trigger Setup Show the trigger setup dialog of the underlying target interface to define the debug event that forces the triggered transfer to be recorded.

User's Guide Triggered Transfer Recorder 143 of 167 FLASH / OTP Programming The UDE Memory Programming Tool supports handling of on-chip FLASH, OTP and EEPROM memory on Infineon C16x, TriCore and ARM7 microcontrollers and external FLASH memory devices. According to the capabilities of the respective programmable memory device this tool allows to erase, program, verify and protect the module. The Intel-Hex and Motorola-Sre format are supported. There are two versions of UDE MemTool: 1. an integrated UDE Debugger Add-In used within an UDE Workspace,  build-in component of the UDE architecture  can use all communication channels supported by the UDE Debugger 2. a stand-alone application used outside of the UDE Debugger  contains a separate front-end with direct access to all programming functions  offers additional batch- and remote functions  allows target communication via ASC bootstrap loading and Host PC serial port additionally

Supported Functions Depending on the capabilities of the memory device (and the driver used to handle the device), MemTool provides functions to handle the device:  a chip erase function, that deletes the contents of the whole memory device  a sector erase function, that deletes the contents of one or more sectors of the device  a program function to write data into the memory device. This function also takes care about certain data alignment requirements of the device  a verify function that is implemented using the read functions of the target interface  a query state Function that can read the state registers of the memory device  a protect function that can be used to install, enable and disable read and write protection mechanisms

Basic Concept UDE MemTool is intended to handle on-chip and external memory devices that do not permit direct and random write accesses unlike a RAM device permits. Typically, on-chip FLASH/OTP memory devices and external FLASH are of this type. A target may contain several on-chip and external memory devices that can all be handled by MemTool. At a given time, only one device is activated. For each memory device, a Memory Device Handler inside UDE MemTool handles all accesses to the corresponding device. These Memory Device Handlers may be activated and deactivated individually. Programming of the memory device is done by the Memory Device Driver which is a small application executed by the target MCU. MemTool uses functions provided by the UDE Target Interface to load and run this driver application.

144 of 167 FLASH / OTP Programming User's Guide Memory mapping variants To understand how MemTool programs a user application into a programmable memory device it is necessary to consider the two memory mapping types used by MemTool. It defines the memory mapping variants "Program Time Mapping" and "Run Time Mapping". To understand the difference between these two mapping types consider the following scenario: Imagine a target system with the C16x, 1 MByte external RAM and 256 kByte external FLASH. After a target reset, the program code is fetched from the FLASH memory at segment 0 (physical address 0x00'0000). That is why the RAM is located by the initialization code at segment 8 (physical address 0x80'0000). This constellation is called "Run Time Mapping". The program, which is in development state, is located at segment 0 (physical address 0x00'0000). For debugging purposes the on-board RAM is mapped to segment 0, therewith breakpoints can be handled e.g. When the development stage is finished, the program is programmed into the FLASH at segment 0, so that the power-on execution can be done from the FLASH program content. However, at this moment the FLASH is not visible at segment 0, because the RAM overlaps the FLASH range. That's why the UDE MemTool remaps all program code sections to another visible range of the FLASH for FLASH programming, in this case at segment 8 ( physical address 0x80'0000). This constellation is called "Program Time Mapping".

Run Time Mapping

Mapping type is used when the user application is executed.

RAM e.g. visual range

FLASH PROGRAMROM CODE buried range visual range

0 0x80'0000 0x90'0000

visible memory range

invisible memory range

Program Time Mapping

Mapping type used when the user application is about to be programmed into the Memory Device,

RAM e.g. PROGRAM CODE Remapped by MemTool

FLASH buried range visual range visual range 0 0x80'0000 0x90'0000

To configure this example in UDE following settings must be done: The FLASH memory must be defined in the target configuration as memory device with a visible address range: 0x80'0000-0x8F'FFFF. To allow the remapping of the program code sections the MemTool must be setup with a different start address: 0x00'0000 (via Setup of FLASH/OTP Device dialog).

Please see the next chapter for more detailed information about the configuring of FLASH ! memory devices.

User's Guide FLASH / OTP Programming 145 of 167 Target Communication In the stand-alone UDE MemTool, mini-monitors for communication and FLASH programming are used only. These mini-monitors are using on-chip resources, so that the programming works without external RAM. “Single-Chip Systems” are supported. This integrated UDE Debugger Add-In uses the debug communication channel for communication, debugging and FLASH programming. These debug-monitors require external RAM per default. An exception is the target communication via JTAG, which needs no external RAM and supports the 'Single-Chip Systems' too. The following table gives an overview about all available communication channels supported by the integrated and the stand-alone UDE MemTool:

Target µController and Host Serial Host Parallel Universal fast-PC6x communication interface RS232 EPP Access Device3 Interface Card C16x, ST10, XC16x, XC2xx, 1   TriCore, MPC55xx via ASC-BSL ST10, XC16x, XC2xx, TriCore via   CAN-BSL C166, ST10, XC16x, XC2xx,   TriCore via K-Line XC16x, XC2xx, TriCore, PowerArchitecture, ARM, XScale 2  via JTAG

1) only available with the stand-alone UDE MemTool 2) JTAG on-board JTAG adapter required 3) all variants.

Supported FLASH/OTP Memory Devices On-chip FLASH/OTP memory devices on ...  Infineon TriCore family  Infineon C16x family, STMicroelectronics ST10Fx derivatives  Infineon C166CBC family (EasyUTAH, SDA6000 ...)  Infineon C166S V2 family (XC166, XC2000, XE166 ...)  PowerArchitecture family (MPC55xx ...)  Cortex , ARM7, ARM9, ARM11, XScale derivatives (Cortex-M3, Cortex-R4, Cortex-A9 ...)  SuperH SH-2A derivatives External FLASH-EPROM's ...  AMD Am29Fxxx, M29Wxxx family and 100% compatible types  Atmel AT29Cxxx, AT49Cxxx family  SST39VFxxx, SST39LFxxx family  M58BWxxx family, ST58BWxxx family  Intel i28Fxxx family  I2C 24LCxx family  all JEDEC Standard Command Set compatible For the list of supported external memory devices, see the file EXTFLASH.DAT within the UDE installation folder. If newer FLASH devices are available, which are not supported by UDE MemTool, please contact the PLS Support Team at support@pls- mc.com to receive a newer version of the FLASH database. ! 146 of 167 FLASH / OTP Programming User's Guide Please note: Versions of UDE MemTool shipped with UDE Starterkits are limited to memory devices provided by the respective Starterkit hardware.

Definition of external FLASH Memories Before FLASH programming is possible, the external FLASH devices must be defined in target configuration of UDE. This can be done while creating a new Target Configuration, but while editing an existing configuration too.

Create a new Target Configuration with FLASH support Create a new target configuration and specify the count of FLASH memory devices in page 'New Target Specify Memory'. Define the device with name and description in page 'New Target Special Memory' and select as Handler 'UDE FLASH/OTP Memory Programming Tool'. Setup the used Bus Mode of the FLASH device, the FLASH Type, which means the family of FLASH devices and the Start and End Address, where the FLASH device is visible completely.

Edit an existing Target Configuration with FLASH support When the target is connected, open the 'Edit Target Configuration' dialog via menu Config - Target Configuration and select the controller item in the target tree. Via the Add and Modify button you can change the list of registered memory devices. Use Remove for deleting of entries. Push Add to setup a new memory device. Enter a name and a description of the FLASH memory and enable the handling by UDE FLASH/OTP Memory Programming Tool. Select the used Bus Mode of the FLASH device and the FLASH Type, which means the family of FLASH devices. Add a new address range, where the FLASH device is visible completely.

Definition of on-chip FLASH Memories The on-chip FLASH devices are registered automatically. The requirement is that the correct controller derivative is selected in the target configuration. In this case, an additional memory device labeled with PFLASH or DFLASH is included. Please check, that the on-chip FLASH is enabled on the property sheet of the device.

Please note: For programming on-chip FLASH modules of C16x and ST10Fx derivatives, the on-chip FLASH module must be activated (SYSCON.ROMEN=1) and mapped to starting address 0x10000 (SYSCON.ROMS1=1). To run the FLASH driver software, ! XRAM must be enabled (SYSCON.XPEN=1).

User's Guide FLASH / OTP Programming 147 of 167 Definition of Memory Access Filters A memory access filter is used like a FLASH Memory Device with the difference, that no FLASH programming functionality is provided, but various memory access filter functions. Memory access filters are useful, when devices, visible in the address range of the microcontroller, must not be read/written by UDE. A memory access filter reserves an address range and can be specified as  Block any access  Block any write access  Notify user on write access Define the memory access filter as new memory device with name and description in page 'New Target Special Memory’ of the target configuration and select as Handler 'Memory access filter'.

Enabling the FLASH Programming The UDE Memory Programming Tool is an Add-In of UDE and must be activated. This is done via the Add-In Manager, menu Config - Add-in Components. Enable the entry UDE FLASH/OTP Memory Programming Tool.

The detailed description about Add-Ins is contained in the chapter 'Activating and Using Add-Ins'.

When the UDE FLASH/OTP Memory Programming Tool is enable, a new menu entry is created in UDE menu Tools - FLASH programming. Open this dialog and the main front-end of MemTool will be opened. Choose the FLASH device and try to enable it. If all settings were correct, a list of FLASH sectors will displayed as shown below.

If not, please check carefully all FLASH device settings, the target hardware and the content of the SYSTEM and BUSCONFIG registers again. The FLASH device must be visible in full size. Use the memory window to verify your assumption about the hardware in terms of the address ranges of RAM and FLASH. As shown above a list of FLASH sectors is displayed. These sectors are located on the FLASH addresses adjusted to the corresponding physical address ranges defined in the target configuration. Because the program code is mostly located at 0x0, the 'Program Time Mapping' must be activated. Push the button Setup button to set the Use different Start Address to 0x0. Now the 'Program Time Mapping' is selected within UDE and the code range filter will be activated from physical address 0x0 with the size of the FLASH device.

148 of 167 FLASH / OTP Programming User's Guide

FLASH Programming If the UDE FLASH/OTP Memory Programming Tool is enabled, all registered FLASH devices are installed with special filters. These filters watch the download stream for address ranges met with a registered FLASH device. If the filters detect, that a code section is loaded, which is destined for the FLASH device, the code section will be marked for FLASH programming. For the practical work it means, that you have to load the FLASH/ROM version of your program code File - Load Program only. After loading the program code sections, the FLASH Programming Tool will open the main dialog and will offer the erasing, programming and verifying of code sections.

The Erase ... button allows the erasing of single FLASH sectors or complete FLASH devices. Because of the FLASH architecture, a FLASH sector has to erased before new FLASH programming. Before starting the Erase Function, the Select FLASH Sectors for Erase dialog is shown. One or more sectors to be erased are selected here. If the current Memory Device supports a Chip Erase Function, you may choose Erase whole FLASH Module to execute this function. Otherwise, Sector Erase Function is used. Program immediately starts to write all sections loaded into the current Memory Device Handler. It presents the Execute Command Box showing the function progress. Canceling the operation is also provided.

User's Guide FLASH / OTP Programming 149 of 167 The Verify function immediately starts to compare all sections loaded into the current Memory Device Handler against the contents of the Memory Device on target. It presents the Execute Command Box showing the function progress. Canceling the operation is also provided. As the result, after the function has finished the number of different is shown. Setup ... lets you setup FLASH programming options. The Info ... window shows information about the current Memory Device and the Memory Device Driver used to handle the device.

Setup FLASH Programming options Mapping If Run Time Memory Mapping and Program Time Memory Mapping are not equal check the Use different Start Address checkbox and enter a valid Run Time Mapping start address for the Memory Device. Driver The Driver page allows the replacement of FLASH drivers and is destined for special purposes. Changes have to be only done in accordance with the PLS Support Team.

Program The options Automatic Chip Erase Before Program and Automatic Sector Erase Before Program allows the automatic erasing of sectors or devices before programming with new data's. With Simulate Random Access Mode, all sectors to be programmed with new data are completely read out into buffers. Then, these sectors are erased. Now the buffered data is merged with the new data to be programmed and the result is written back to the memory device. The verify function is started after programming has finished when Automatic Verify after Program is enabled.

150 of 167 FLASH / OTP Programming User's Guide UDE CAN Recorder

Supported Functions The UDE CAN Recorder is an Add-In of UDE and can send and record CAN messages from a CAN network. Following features are supported:  Configuring the CAN controller  Edit and Send CAN messages (CAN bus stimulation)  Receive CAN messages (CAN bus observation) with filter mechanism  Symbolic representation of CAN messages

Enabling the CAN Recorder The UDE CAN Recorder is an Add-In of UDE and must be activated. This is done via the Add-In Manager, menu Config - Add-in Components. Enable the entry UDE CAN Recorder. When the UDE CAN Recorder is enable, a new menu entry is created in UDE menu Views - CAN Recorder. Start the CAN Recorder via this menu entry.

Send and Record CAN Messages Before using the CAN Recorder it has to setup. Use the context menu and click on Setup Recording. Specify the baud rate of the CAN bus in the tab Timing. Setup the CAN message format and mask in the tab Recording. To record messages from the CAN network use the context menu and enable the Record entry. All messages are recorded and shown that corresponds to the defined filter mask. To send a message type in the ID and Data form and push the Send button.

User's Guide UDE CAN Recorder 151 of 167 UDE RTX Viewer

Supported Functions The UDE RTX Viewer is an Add-In of UDE which give a detailed overview about the RTX RTOS internals. These internals can be:  Tasks overview including all states  Queue overview (per Message/Semaphore/Mutex Control Block information)  Timers overview (name, timer count, unique callback information)  Signals overview (waiting/active events mask)

Enabling the RTX Viewer The UDE RTX Viewer is an Add-In of UDE and must be activated before it can be used. To activate it, open the Add-In Manager, menu Config - Add-in Components. Enable the entry RTX Awareness. After the UDE RTX Viewer was enabled, a new menu entry is created in UDE menu Views - RTX Support. Open the RTX Viewer by clicking on this menu entry.

Depending on the functions enabled in the RTOS configuration file the RTX viewer window immediately shows a snapshot of the current system state:

The green line inside the RTX viewer marks the task which was active/running before the system was halted by the debugger. Please note, because the RTOS creates the tasks at runtime, maybe not all tasks are displayed if the system was breaked immediately after first go/step.

Using the RTX Viewer To work with the RTX viewer, first a RTX RTOS application AXF file must be loaded. The RTX RTOS application itself can be built using the Keil compiler. Please also note that the RTX RTOS version must be greater than or equal to v4.x. After the RTX application was loaded the RTX must be initialized and all needed tasks must be created. This is normally done by an “init” function. The init function itself is therefore called by “os_sys_init” inside the main-function. If the initialization was performed successfully, all created tasks are listed in the RTX viewer as shown above. By setting breakpoints inside the application the behaviour of each task can now be introspected by using the RTX viewer.

152 of 167 UDE RTX Viewer User's Guide UDE rcX Viewer

Supported Functions The UDE rcX Viewer is an Add-In of UDE which give a detailed overview about the rcX RTOS internals. These internals can be:  Tasks overview including all states  Queues overview (name, fill level, memory usage)  Mutexes overview (name, owner task)  Semaphores overview (name, modes, state, callback)  Interrupts overview (name, type, priority, ISR)  UARTs overview (name, state, speed, callbacks)

The functions are mostly similar to the RTX viewer above.

Enabling the rcX Viewer The UDE rcX Viewer is an Add-In of UDE and must be activated before it can be used. To activate it, open the Add-In Manager, menu Config - Add-in Components. Enable the entry rcX Awareness.

After the UDE rcX Viewer was enabled, a new menu entry is created in UDE menu Views - rcX Support. Open the rcX Viewer by clicking on this menu entry.

Depending on the functions enabled in the RTOS configuration file the rcX viewer window immediately shows a snapshot of the current system state:

The green line inside the rcX viewer marks the task which was active/running before the system was halted by the debugger. Please note, because the RTOS creates the tasks at runtime, maybe not all tasks are displayed if the system was breaked immediately after first go/step.

Using the rcX Viewer To work with the rcX viewer, first a rcX RTOS application ELF file must be loaded. The rcX RTOS application itself can be built using the GNU ARM compiler. Please also note that the rcX RTOS version must be greater than or equal to v2.x. After the rcX application was loaded the rcX RTOS must be initialized and all needed tasks must be created. This is normally done by an “init” function. The init function itself is therefore called by “rX_SysEnterKernelExt” inside the main-function. If the initialization was performed successfully, all created tasks are listed in the rcX viewer as shown above. By setting breakpoints inside the application the behaviour of each task can now be introspected by using the rcX viewer.

User's Guide UDE rcX Viewer 153 of 167 Eclipse IDE for UDE

Prepare Eclipse IDE for UDE Integration Package The UDE Eclipse Integration Package must satisfy following requirements:  Java JRE 6 Update 10 or higher  Eclipse Platform Ganymede 3.4.x / Eclipse Platform Galileo 3.5.x / Eclipse Platform Helios 3.6.x / Eclipse Platform Indigo 3.7.x  CDT Ganymede Releases 5.0.x / CDT Galileo Releases 6.0.x / CDT Galileo Releases 7.0.x  UDE 3.2.2 or higher

Install UDE Eclipse Integration Feature for Eclipse 3.4 Ganymede  Install Universal Debug Engine 3.2.2 or higher  Start Eclipse Ganymede IDE  Open the Software Update dialog of the Eclipse Help menu  Select tab Available Software  Select button Add...

 Select button Archive... and browse for UDEEclipseIntegration.zip from UDE root installation directory.  Select Universal Debug Engine Eclipse Integration for installation.

 Press Install... button  Finish installation of Universal Debug Engine Eclipse Integration feature.

154 of 167 Eclipse IDE for UDE User's Guide Install UDE Eclipse Integration Feature for Eclipse 3.5 Galileo, Eclipse 3.6 Helios and Eclipse 3.7 Indigo  Start Eclipse Galileo/Helios IDE  Open the Software Update dialog of the Eclipse Help menu  Uncheck Group items by category  Select button Add...

 Select button Archive... and browse for UDEEclipseIntegration.zip from UDE root installation directory.  Check Universal Debug Engine Eclipse Integration package in the list control of available software packages

 Select Next button for installation  Press Install... button  Finish installation of Universal Debug Engine Eclipse Integration feature.

User's Guide Eclipse IDE for UDE 155 of 167 Launching UDE Debug Session in Eclipse IDE

Creating UDE Eclipse Platform Launch Configuration The integration of Universal Debug Engine into Eclipse IDE for C/C++ developers enables to launch an UDE debug session by a specific debug configuration of a C/C++ project. This launch configuration can be created from local menu of the appropriate C/C++ project:  Change to C/C++ perspective  Click with right mouse button into the project tree root of the "Project Explorer" view to open local menu  Select Debug As menu, submenu Debug Configurations... to open Debug Configurations dialog

 Select the Universal Debug Engine launch configuration type  Press the New Launch Configuration button to create a new launch configuration for the selected project.

156 of 167 Eclipse IDE for UDE User's Guide

 The Main, Source and Common tabs are common elements of each C/C++ launch configuration dialog.  The UDE Startup tab contains all settings, which are necessary for a specific UDE launch configuration.  The two settings for UDE Workspace File and UDE Target Configuration File are required for a valid UDE launch configuration.  The selection of an UDE Diagnostic Output File is optional. The directory of an UDE Workspace File for an UDE Eclipse launch configuration is the C/C++ project directory subdirectory ../.UDE. The default location of the UDE Target Configuration File is the C/C++ project file system location subdirectory ../.UDE/.TARGET. The additional functions allow to import or export existing UDE workspaces and UDE target configurations to or from default or common location of Universal Debug Engine from or to the relative paths of the Eclipse C/C++ project locations. Detailed descriptions of all buttons contain the UDE help system.

Steps to start Debug Session with UDE Eclipse Launch Configuration The newly created UDE launch configuration allows launching a debug session using UDE via Debug button of Eclipse IDE toolbar. Use the Debug button of the toolbar of the Run menu Debug item (shortcut ) to start the created launch configuration, which opens the UDE perspective, loads the selected workspace file and uses the selected target configuration to connect to the target debug system.

User's Guide Eclipse IDE for UDE 157 of 167 Add UDE Sample Project to Eclipse Helios C/C++ IDE

Creating Eclipse Makefile Project from UDE TimeDemo Sample UDE sample makefile projects can be easily imported as Eclipse C/C++ projects using the Eclipse import wizard:  Change to C/C++ perspective  Open the Import.. wizard of Eclipse File menu.  Select C/C++ -> Existing Code as Makefile Project

 On the next wizard page use browse button to select UDE sample directory ( e.g. C:\\pls\UDESamples\TriCore\Triboard_TC1796\TimeDemo\GNUTC )  Add an appropriate project name  Check the Languages checkbox C only  Select as tool chain

 Push Finish button

158 of 167 Eclipse IDE for UDE User's Guide  The TimeDemo Tc1796 Eclipse C/C++ will be created  Select TimeDemo TC1796 project in the project explorer to prepare start of debug session  Press bug toolbar button or select menu item “Run” submenu item “Debug” ( or F11 )  The “Debug as” dialog will be opened to select the type of launch configuration to start debug session

 Select Universal Debug Engine as appropriate launch configuration type to start the debug session  Press Ok to open the dialog to select to binary file for loading to target

 The “C Local Application” dialog allows selecting the binary file, which will be loaded by the launch configuration into target system. Select the appropriate binary file of current build configuration.

 After selecting elf file of active build configuration, the launch configuration “Edit Configuration” dialog has to complete by choosing the UDE target configuration, which contains the settings of the actual used target system.

 The UDE launch configuration is now ready for use

User's Guide Eclipse IDE for UDE 159 of 167 UDE Object Model

Overview With the UDE object model built on the Microsoft COM technology you can access the target, control the Universal Debug Engine and MemTool, start and stop programs running on the target, set breakpoints, flashing code and much more. The UDE object model is completely scriptable and not only in Visual Basic as a very wide range of script languages is supported. Examples are: tcl/tk, Perl, Python, JavaScript ... A detailed documentation of UDE object model can be found at \Help\UdeObjectModel.chm ? Please contact [email protected] for more samples of using the UDE object model.

Example for TriCore Looking at special function registers and calculating the values that are really needed takes a lot time. The HTML page below provides a user-friendly view to the ASC module of the TriCore. It shows the frequency used by the ASC module and calculates the baud rate with the values of the related register. Of course, the values needed for the calculation are read from the target.

This HTML view based on the UDE object model provides a user-friendly view of the ASC module.

160 of 167 UDE Object Model User's Guide User Definable Enhancements The UDE concept allows extending the debugger functions by additional components in the following levels:  HTML scripts based on UDE ActiveX™ controls, customer specific controls and access via the UDE object model to display consumer-defined views with UDE HTML view server. For a description of these features, see the chapter about Viewing and Modifying Registers and the UDE object model.  Programming a custom view server can solve complex problems and can provide detailed and optimized target related views, e.g. for integrating specific RTOS, CAN views ..  The UDE desktop client may be substituted by a customer GUI for production and field maintenance purposes, e.g. for Service Tools, Matlab or CASE tool integration. The functionality of the core debugger can be extended or even reduced to enable essential views and features only. Please see for further information the chapter about the UDE object model.

Please contact [email protected] for more information and examples about the UDE ? extensions.

User's Guide User Definable Enhancements 161 of 167

Reference

The Reference of the Universal Debug Engine (UDE) is available via the Window's Help system. To use the help, please open UDE and press or browse to the UDE installation menu and select UDE Help.

Reference 163 of 167

JTAG 14, 16, 18, 104 JTAG ARM 17 JTAG-Extender 21 JTAG-Pod 24, 31 OCDS L1 14, 16, 18 OCDS L1-Extender 21, 31 Index SSC 25, 26, 28, 104 SWD 20, 104 SWD-Extender 23 Compiler ARM11 103 ARM7 103 ARM9 103 C166 102 C166S-V2 102 C16x 102 3 PowerPC 103 3Pin 8, 27, 85, 86, 104 Support 102 Monitor 86 TriCore 103 XC166 102 A XC2000 102 Add-In XE166 102 Activating and Using 142 XScale 103 Removing 142 COMx 11, 15, 47 Alias names 117 Connect the Target 108 Analyzing 127 Cortex 55 Application 82 CPU View 60, 112 Architecture of UDE 98 Creating new Workspace 56, 63, 100 ARM11 55 ARM7 55 D ARM9 55 DAP 8, 19, 22, 104 ASC 8, 25, 26, 28, 104 Debugging Assembler 111 Aurix 65 C166S V2 77 B C16x 85 Blocking Memory Access 148 Multi-Core 63 Breakpoints 59 PowerPC 79, 81 Absolute 120 TriCore 56 Condition 120, 121 Delivery Contents 9 Data Breakpoints 120 Demo version 8, 12, 14, 15, 16 Dialog 121 Download 108 Hardware/Software 121 Downloading a Binary File 102 Identifier 122 Driver Loop 121 fast-PC6x 46 Macro 121 Starterkit 47 BSL 25, 26, 27, 28, 29 UAD 37 UAD2 37 C UAD3 37 C165 55 USB-JTAG-Port 44 C167 55 USB-Key 45 Call Stack View 125 CAN 8, 25, 26, 29, 104 E CAN Recorder 151 Eclipse 154 Code Coverage 133 Debug Configuration 156 Command line 102 Galileo 155 Communication Channels 105 Ganymede 154 3Pin 27 Helios 155 3Pin Communication 104 Integration Package 154 ASC 15, 25, 26, 28, 104 Launch 156 Bootstrap loader 15 Emulation Device 74 CAN 25, 26, 29, 104 Enabling FLASH Programming 148 DAP 19, 104 EPP 11 DAP-Extender 22 ESD 13

164 of 167 Index

Ethernet 24, 26, 27, 30, 31, 41 J ETM 8, 30 JTAG 8, 17, 18, 21, 24, 31, 79, 104 Evaluation Kit 8 Protector 32, 33 Examples 55 Expression clipboard K Add Expression 118 Keil 102 external FLASH 147 Kernel 82

F L fast-PC276C/PCI 28, 29 Leaving the Project 62 fast-PC67C/PCI 28, 29 License Manager 48 Firewire 11 License Node-locked 49 FLASH Linux 7, 82 Concept 144 Login 84 Configuration 93, 150 Shell 84 Program Time Mapping 145 System Call 84 Programming 144, 149 Loading of an Executable 58, 66, 70, 77 Run Time Mapping 145 Locals View 119 Following the Program flow 119 Locating source 138 Function static Variable 116 LPT 11 Functions 108 M G Macro 121 Getting Started 55 MaxSim 8 Global Variable 115 MCDS 74 GNU 102 MDK 103 Graphical Display Window Measuring time differences 138 Basic features 124 Memory Access Filter 148 Local Menu 125 Memory View 62, 123 Real-Time Data Collection 139 Module static Variable 116 Real-Time Graphical Monitoring 139 Monitor 106 Setting up 140 3Pin 104 Using Expressions 124 3Pin 86 Using Expressions 139 Access without a Monitor 107 Greenhills 103 ASC 104 CAN 104 H RAM 106 Help ROM 107 On-line Help 99 Monitor Wizard 86 Hex File 103 Motorola S 103 HighTec 102 Multi-core Debugging 65 Host ID 49 N I Nexus 30 IEEE1394 11, 21, 22, 23, 26, 27, 30, 38 Node-locked licensing 49 IEEE1394b 24, 31, 39 ImageCraft 103 O Inline Assembler 111 Object Model 114 Installing OCDS L1 8, 14, 16, 18, 21, 24, 31 fast-PC6x 46 Trigger 78 Hardware 13 OCDS L2 8, 30 Software 35 View 95 Starterkit 47 OHCI 38 UAD 37 on-chip FLASH 147 UAD2 37 Overvoltage 13 UAD3 37 USB-JTAG-Port 44 P USB-Key 45 Parallel Port 14, 37 Intel Hex 103 PCI 11, 28, 46 Interface 11 PowerArchitecture 55 IP Trace 129 PowerPC 55, 79 ITM Trace 141 Trigger 80 Printing

Index 165 of 167

Memory Locations 124 Triggered Transfer 143 Program Code 111 View 95, 129, 130, 131, 132, 134, 136 Program View 108 Visualization 128 View Mode 109 TriCore 55 Program Window 133 MCDS 74 Project Management 100 Trigger 78, 80 Triggered Transfer Trace 143 R Trouble Shooting 53 rcX Viewer 153 TSIM 8, 34 Real expressions 116 Tux 82 RealView 103 Reference 163 U Refresh 119 UAD2 18, 19, 20, 25 Register View 112 JTAG Protector 32 Reinstalling Software 52 UAD2+ 21, 22, 23, 26, 27 Requirements 11 JTAG Protector 33 RTX Viewer 152 UAD2compact 17 Run a Program 59, 64, 111 UAD2pro 18, 19 UAD3+ 24, 31 S UDE Object Model 114, 160 Samples 55 UHCI 40 Sections 108 Uninstalling Software 52 Sentinel USB SuperPro 45 USB 11, 34, 40, 44, 45 SFR View 61, 113 USB 2.0 11, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, Signal Trace 139 26, 27, 30, 31 Simulated I/O 89 USB-JTAG adapter 8, 11 Simulator 8, 34 USB-to-Serial Converter 15, 47 Single-Chip Systems 146 User defined 161 Source Files 108 SSC 8, 25, 26, 28, 104 V Stack View 125 Variables 116 Starterkit 8, 12, 14, 15, 16, 47 View 61 Starting UDE 56 Versions of UDE Static Electricity Precautions 13 Simulator 8 Stepping and Breakpoints 119 Standard Stop the Program at a specified Location 120 fast-PC67 8 SuperH 55 UAD2 8 SWD 8, 20, 23, 104 UAD2+ 8 syscall 84 UAD2compact 8 System Requirements 11 UAD2pro 8 UAD3+ 8 T Starterkits 8 Target Configuration 90 View Mode Select 101 Assembler 109 Wizard 90 C/C++ 109 Target Interface Disassembly 110 Controller 91 Mixed 109 Select 91 Single Program 110 Setup 92 Viewing and Modifying Registers 112 Target Interface Setup 87 Viewing Program Code 108 Tasking 102 Views TC1130 55 Call Stack 125 TC1796 55 CPU Register 60, 112 TCP/IP 41 Graphical Display Window 124, 139 Time measuring HTML 112 OCDS L2 96 Locals 119 Timers 126 Memory 62 Trace 8, 127 OCDS L2 95 Analyzing 128 Program 108 Find 137 Program Window 133 ITM 141 SFR Register 61, 112, 113 Signal 139 Simulated I/O 89 Sources 127 Stack 125

166 of 167 Index

Trace 95 Variables 61 Watch 115 Visualization 127

W Watch Expressions 115 Watch View 115, 117 Advanced Expression Resolution 118 Expression 117 Expression Clipboard 118 Variable 117 Website 53 Workspace 100, 108

X XC166 55, 77 XC2000 55, 77 XE166 77

Index 167 of 167