RTOS Debugger for CMX

Similar documents
RTOS Debugger for RTX-ARM

RTOS Debugger for ChibiOS/RT

RTOS Debugger for MicroC/OS-III

RTOS Debugger for FreeRTOS

RTOS Debugger for ThreadX

RTOS Debugger for MicroC/OS-II

RTOS Debugger for MQX

OS Awareness Manual Sciopta

OS Awareness Manual OSE Epsilon

OS Awareness Manual OSEK/ORTI

RTOS Debugger for RTXC Quadros

RTOS Debugger for RTXC Quadros

Hypervisor Awareness for Wind River Hypervisor

OS Awareness Manual OSE Delta

RTOS Debugger for Windows Standard

RTOS Debugger for LynxOS

OS Awareness Manual uclinux

RTOS Debugger for RTX51 tiny

RTOS Debugger for Windows CE6/EC7/EC2013

RTOS Debugger for psos+

RTOS Debugger for OS-9

Integration for CodeWright

TRACE32 Documents... ICD In-Circuit Debugger... Processor Architecture Manuals... TriCore... TriCore Monitor... 1

RTOS Debugger for QNX - Run Mode

Application Note for the SNOOPer Trace

TRACE32 Glossary Terms, Abbreviations, and Definitions... 2

TRACE32 Getting Started... ICD In-Circuit Debugger Getting Started... ICD Introduction... 1

The CMXBug Manual. The CMXBug Manual

Run Mode Debugging Manual Symbian

RTOS Debugger for Linux - Run Mode

embos Real-Time Operating System embos plug-in for IAR C-Spy Debugger Document: UM01025 Software Version: 3.0 Revision: 0 Date: September 18, 2017

ARM Application Note for MXC Chips

TRACE32 Documents... ICD In-Circuit Debugger... Processor Architecture Manuals... NS NS32000 Monitor... 1

embos Real-Time Operating System embos plug-in for IAR C-Spy Debugger Document: UM01025 Software Version: 3.1 Revision: 0 Date: May 3, 2018

TRACE32 Debugger Getting Started... ICD Tutorial About the Tutorial... 2

An unrivalled feature-set and unprecedented integration

What s An OS? Cyclic Executive. Interrupts. Advantages Simple implementation Low overhead Very predictable

Introduction to the ThreadX Debugger Plugin for the IAR Embedded Workbench C-SPYDebugger

Trace Getting Started V8.02

Tracking the Virtual World

General Commands Reference Guide O

Advanced Debugging using the Ashling MPC5500 tools

Native Process Debugger

The ThreadX C-SPY plugin

Chapter 12 Visual Program Debugger

Converter from GEL to PRACTICE

_ V Renesas R8C In-Circuit Emulation. Contents. Technical Notes

API for Auxiliary Processing Unit

Process Context & Interrupts. New process can mess up information in old process. (i.e. what if they both use the same register?)

Integration for Rhapsody in C/C++

Efficient and Large Scale Program Flow Tracing in Linux. Alexander Shishkin, Intel

MPLAB SIM. MPLAB IDE Software Simulation Engine Microchip Technology Incorporated MPLAB SIM Software Simulation Engine

Rudi Dienstbeck June 07, ARM TrustZone and Hypervisor Debugging

Eclipse-Based CodeWarrior Debugger

Renesas 78K/78K0R/RL78 Family In-Circuit Emulation

_ V ST STM8 Family On-Chip Emulation. Contents. Technical Notes

Integration for Visual Basic Interface

BASICS OF THE RENESAS SYNERGY PLATFORM

Operating Systems Design Fall 2010 Exam 1 Review. Paul Krzyzanowski

Debugging INTRODUCTION DEBUGGER WHAT IS VBA'S DEBUGGING ENVIRONMENT?

Lab 3-2: Exploring the Heap

TRACE32 Documents... ICD In-Circuit Debugger... Processor Architecture Manuals... MCS08... MCS08 Debugger... 1

NEW CEIBO DEBUGGER. Menus and Commands

Lecture notes Lectures 1 through 5 (up through lecture 5 slide 63) Book Chapters 1-4

Training Android Debugging

Resource 2 Embedded computer and development environment

embos Real Time Operating System CPU & Compiler specifics for ARM core with ARM RealView Developer Suite 3.0 Document Rev. 1

RTX64 Features by Release IZ-DOC-X R3

NEC 78K0- Family On-Chip Emulation

TRACE32 Documents... TRACE32 Instruction Set Simulators... Simulator for ARC... 1

NEWS 2018 CONTENTS SOURCE CODE COVERAGE WORKS WITHOUT CODE INSTRUMENTATION. English Edition

file://c:\documents and Settings\degrysep\Local Settings\Temp\~hh607E.htm

BASICS OF THE RENESAS SYNERGY PLATFORM

ZAP Cross Debuggers for Motorola Microcontrollers

embos Real Time Operating System CPU & Compiler specifics for RENESAS SH2A CPUs and KPIT GNU compiler Document Rev. 1

1. Introduction Document organization and format Technical support Software Installation...3

Integration for CodeBlocks

Simulator for TriCore

Application Note for the Trace.Find Command

Debugging in Small Basic is the process of analysing a program to detect and fix errors or improve functionality in some way.

Contents. Cortex M On-Chip Emulation. Technical Notes V

ARM DS-5. Using the Debugger. Copyright 2010 ARM. All rights reserved. ARM DUI 0446A (ID070310)

embos Real Time Operating System CPU & Compiler specifics for RENESAS M16C CPUs and IAR compiler Document Rev. 5

What is this? How do UVMs work?

BASICS OF THE RENESAS SYNERGY TM

Simulator for H8/300, H8/300H and H8S

embos Real Time Operating System CPU & Compiler specifics for RENESAS M16C CPUs and HEW workbench Document Rev. 1

The CMXTracker Manual. The CMXTracker Manual

U-Boot and Linux Kernel Debug using CCSv5

CS370 Operating Systems

TRACE32 Documents... ICD In-Circuit Debugger... Processor Architecture Manuals... Andes... Andes Debugger... 1

ICE Performance Analyzer User s Guide

embos Real Time Operating System CPU & Compiler specifics for RENESAS SH2 CPUs and RENESAS HEW4 Document Rev. 1

A brief intro to MQX Lite. Real work: hands-on labs. Overview, Main features and Code Size

H8 C-SPY. User Guide WINDOWS WORKBENCH VERSION

Introduction. This tutorial introduces the following SingleStep features:

April 4, 2001: Debugging Your C24x DSP Design Using Code Composer Studio Real-Time Monitor

H8S and H8/300H Monitor

A Quick Introduction to MPLAB SIM

Integration for Xilinx Vivado

Transcription:

RTOS Debugger for CMX TRACE32 Online Help TRACE32 Directory TRACE32 Index TRACE32 Documents... RTOS Debuggers... RTOS Debugger for CMX... 1 Overview... 2 Brief Overview of Documents for New Users... 3 Supported Versions... 3 Configuration... 4 Manual Configuration 4 Automatic Configuration 4 Quick Configuration Guide 4 Hooks & Internals in CMX 5 Features... 6 CMXBug Terminal Emulation 6 Display of Kernel Resources 6 Task Stack Coverage 6 Task Related Breakpoints 7 Dynamic Task Performance Measurement 8 Task Runtime Statistics 8 Task State Analysis 9 Function Runtime Statistics 10 CMX specific Menu 12 CMX Commands... 13 TASK.DCyclic Display cyclic timers 13 TASK.DMailbox Display mailboxes 13 TASK.DQueue Display queues 14 TASK.DRes Display resources 14 TASK.DSema Display semaphores 15 TASK.DTask Display tasks 15 TASK.TASKState Mark task state words 16 CMX PRACTICE Functions... 17 Frequently-Asked Questions... 17 RTOS Debugger for CMX 1

RTOS Debugger for CMX Version 06-Nov-2017 Overview The RTOS debugger for CMX contains special extensions to the TRACE32 Debugger. This manual describes the additional features, such as additional commands and statistic evaluations. RTOS Debugger for CMX 2

Brief Overview of Documents for New Users Architecture-independent information: Debugger Basics - Training (training_debugger.pdf): Get familiar with the basic features of a TRACE32 debugger. T32Start (app_t32start.pdf): T32Start assists you in starting TRACE32 PowerView instances for different configurations of the debugger. T32Start is only available for Windows. General Commands (general_ref_<x>.pdf): Alphabetic list of debug commands. Architecture-specific information: Processor Architecture Manuals : These manuals describe commands that are specific for the processor architecture supported by your debug cable. To access the manual for your processor architecture, proceed as follows: - Choose Help menu > Processor Architecture Manual. RTOS Debuggers (rtos_<x>.pdf): TRACE32 PowerView can be extended for operating systemaware debugging. The appropriate RTOS manual informs you how to enable the OS-aware debugging. Supported Versions Currently CMX is supported for the following versions: CMX-RTX 4.0 on Infineon 8051, C16x and Zilog Z180/64180 CMX-RTX 5.3 on Infineon C16x, Renesas H8/300H, H8, SH and NEC V850 CMX-RTXS 1.0 on Infineon C166/C167 RTOS Debugger for CMX 3

Configuration The TASK.CONFIG command loads an extension definition file called cmxrtx.t32 (directory ~~/demo/<processor>/kernel/cmx_rtx ). It contains all necessary extensions. Automatic configuration tries to locate the CMX internals automatically. For this purpose all symbol tables must be loaded and accessible at any time the RTOS debugger is used. If a system symbol is not available or if another address should be used for a specific system variable then the corresponding argument must be set manually with the appropriate address. This can be done by manual configuration which can require some additional arguments, too. If you want to have dual port access for the display functions (display On The Fly ), you have to map emulation memory to the address space of all used system tables. Manual Configuration Manual configuration is not necessary for CMX RTOS debuggers. Automatic Configuration For system resource display and analyzer functionality, you can do an automatic configuration of the RTOS debugger. For this purpose it is necessary, that all system internal symbols are loaded and accessible. Each of the task.config arguments can be substituted by '0', which means, that this argument will be searched and configured automatically. For a full automatic configuration omit all arguments: Format: TASK.CONFIG cmxrtx If a system symbol is not available, or if another address should be used for a specific system variable, then the corresponding argument must be set manually with the appropriate address. Quick Configuration Guide To access all features of the RTOS debugger you should follow the following roadmap: 1. Run the demo script (~~/demo/<processor>/kernel/cmx_rtx/cmx.cmm). Start the demo with do cmx and go. The result should be a list of tasks, which change continuously their state. 2. Make a copy of the cmx.cmm PRACTICE script file. Modify the file according to your application. 3. Run the modified version in your application. This should allow you to display the kernel resources and use the analyzer functions. RTOS Debugger for CMX 4

Hooks & Internals in CMX No hooks are used in the kernel. For detecting the running task, the variable 'activetcb' is used. RTOS Debugger for CMX 5

Features The RTOS debugger for CMX supports the following features. CMXBug Terminal Emulation The terminal emulation window can be used to communicate with the target resident CMX debugger, called CMXBug. The communication is done via two memory cells, requiring no external interface. See the TERM command for a description of the terminal emulation. On request we can provide you with the source code for the target interface routine. Display of Kernel Resources The extension defines new PRACTICE commands to display various kernel resources. Information on the following CMX components can be displayed: TASK.DCyclic TASK.DMailbox TASK.DQueue TASK.DRes TASK.DSema TASK.DTask Cyclic timers Mailboxes Queues Resources Semaphores Tasks For a detailed description of each command refer to the chapter CMX Commands. If your hardware allows accessing the memory, while the target is running, these resources can be displayed On The Fly, i.e. while the application is running, without any intrusion to the application. Without this capability, the information will only be displayed, if the target application is stopped. Task Stack Coverage For stack usage coverage of the tasks, you can use the TASK.STacK command. Without any parameter, this command will set up a window with all active tasks. If you specify only a magic number as parameter, the stack area of this task will be automatically calculated. To use the calculation of the maximum stack usage, flag memory must be mapped to the task stack areas, when working with the emulation memory. When working with the target memory, a stack pattern must be defined with the command TASK.STacK.PATtern (default value is zero). RTOS Debugger for CMX 6

To add/remove one task to/from the task stack coverage, you can either call the TASK.STacK.ADD rsp. TASK.STacK.ReMove commands with the task magic number as parameter, or omit the parameter and select from the task list window. It is recommended, to display only the tasks, that you are interested in, because the evaluation of the used stack space is very time consuming and slows down the debugger display. Task Related Breakpoints Any breakpoint set in the debugger can be restricted to fire only, if a specific task hits that breakpoint. This is especially useful, when debugging code which is shared between several tasks. To set a task related breakpoint, use the command: Break.Set <address> <range> [/<option>] /TASK <task> Set task related breakpoint. Use a magic number, task ID, or task name for <task>. For information about the parameters, see What to know about Magic Numbers, Task IDs and Task Names (general_ref_t.pdf). By default, the task related breakpoint will be implemented by a conditional breakpoint inside the debugger. I.e., the target will always halt at that breakpoint, but the debugger immediately resumes execution, if the current running task is not equal to the specified task. NOTE: Task related breakpoints impact the real-time behavior of the application On some architectures it is possible to set a task related breakpoint with on-chip debug logic that is less intrusive. Specify additionally the option /Onchip to use this. The debugger then uses the on-chip resources to reduce the number of breaks to the minimum, by pre-filtering the tasks. E.g. on ARM architectures, if the RTOS serves the ContextID register at task switches, and if the debug logic provides the ContextID comparison, you may use this register for less intrusive task related breakpoints: TrOnchip.ContextID ON will enable the comparison to the whole ContextID register. TrOnchip.ASID ON will enable the comparison to the ASID part only. If TASK.List.tasks provides a trace ID (traceid column), the debugger will use this ID for comparison. Without the trace ID, it uses the magic number (magic column) for comparison. For a general description of the Break.Set command, please see its documentation. When single stepping, the debugger halts on the next instruction, regardless which task hits this breakpoint. When debugging shared code, stepping over an OS function may lead to a task switch and coming back to the same place - but with a different task. If you want to stick the debugging within the current task you can set up the debugger with SETUP.StepWithinTask ON to use task related breakpoints for single stepping. In this case, single stepping will always stay within the current task. Other tasks using the same code will not be halted on these events. RTOS Debugger for CMX 7

If you want to halt program execution as soon as a specific task is scheduled to run by the OS, you can use the Break.SetTask command. Dynamic Task Performance Measurement The debugger may execute a dynamic performance measurement by evaluating the current running task in changing time intervals. Start the measurement with the commands PERF.Mode TASK and PERF.Arm, and view the contents with PERF.ListTASK. The evaluation is done by reading the magic location (= current running task) in memory. This memory read may be non-intrusive or intrusive, depending on the PERF.METHOD used. If PERF collects the PC for function profiling of processes in MMU based operating systems (SYStem.Option MMUSPACES ON), then you need to set PERF.MMUSPACES, too. For a general description of the PERF command, refer to General Commands Reference Guide P (general_ref_p.pdf). Task Runtime Statistics Out of the recordings done by the Trace (if available), the debugger is able to evaluate the time spent in a task and display it statistically and graphically. Using this feature requires that the on-chip trace generation logic can generated task information. For details refer to OS-aware Tracing (glossary.pdf). To evaluate the contents of the trace buffer, use these commands: Trace.List List.TASK DEFault Trace.STATistic.TASK Trace.Chart.TASK Trace.PROfileSTATistic.TASK Display trace buffer and task switches Display task runtime statistic evaluation Display task runtime timechart Display task runtime within fixed time intervals statistically RTOS Debugger for CMX 8

Trace.PROfileChart.TASK Trace.FindAll Address task.config(magic) Trace.FindAll CYcle owner OR CYcle context Display task runtime within fixed time intervals as colored graph Display all data access records to the magic location Display all context ID records The start of the recording time, when the calculation doesn t know, which task is running, is calculated as (unknown). TRACE32-ICE and TRACE32-FIRE use a completely different mechanism to record task information. See the trigger program below: ; Mark the magic location with an Alpha breakpoint Break.Set TASK.CONFIG(magic)++(TASK.CONFIG(magicsize)-1) /Alpha ; Program the Analyzer to record only task switches Analyzer.ReProgram ( Sample.Enable if AlphaBreak&&Write ) Task State Analysis NOTE: This feature is only available, if your debugger equipment is able to trace memory data accesses (program flow trace is not sufficient). The time different tasks are in a certain state (running, ready, suspended or waiting) can be evaluated statistically or displayed graphically. RTOS Debugger for CMX 9

This feature needs recording of all accesses to the status words of all tasks. Additionally, the accesses to the current task pointer (=magic) are needed. Adjust your trace logic to record all data write accesses, or limit the recorded data to the area where all TCBs are located (plus the current task pointer). To do a selective recording on task states with state analyzers (ICE or FIRE), use TASK.TASKState, if available, to mark the status words with Alpha breakpoints. Run the following PRACTICE script: ; Mark the magic location with an Alpha breakpoint Break.Set task.config(magic)++(task.config(magicsize)-1) /Alpha ; Mark all task state words with Alpha breakpoints TASK.TASKState ; Program the Analyzer to record task state transitions Analyzer.ReProgram ( Sample.Enable if AlphaBreak&&Write ) To do a selective recording on task states with flow traces (ICD, e.g. ETM and NEXUS trace), just enable the recording of all data write cycles. To evaluate the contents of the trace buffer, use these commands: Trace.STATistic.TASKState Trace.Chart.TASKState Display task state statistic Display task state timechart The start of the recording time, when the calculation doesn t know, which task is running, is calculated as (unknown). Function Runtime Statistics NOTE: This feature is only available, if your debugger equipment is able to trace memory data accesses (program flow trace is not sufficient). All function related statistic and timechart evaluations can be used with task specific information. The function timings will be calculated dependent on the task, that called this function. To do this, additionally to the function entries and exits, the task switches must be recorded. RTOS Debugger for CMX 10

To do a selective recording on task related function runtimes with state analyzers (ICE and FIRE), use the following PRACTICE commands: ; Mark the magic location with an Alpha breakpoint Break.Set TASK.CONFIG(magic)++(TASK.CONFIG(magicsize)-1) /Alpha ; Mark the function entries/exits with Alpha/Beta breakpoints Break.SetFunc ; Program the Analyzer to record function entries/exits and task switches Analyzer.ReProgram ( Sample.Enable if AlphaBreak BetaBreak Mark.A if AlphaBreak Mark.B if BetaBreak ) To do a selective recording on task related function runtimes with flow traces (ICD, e.g. ETM and NEXUS trace), based on the data accesses, use the following PRACTICE command: ; Enable flow trace an accesses to the magic location Break.Set TASK.CONFIG(magic) /TraceData To do a selective recording on task related function runtimes with flow traces, based on the context ID, user the following PRACTICE command: ; Enable flow trace with context ID (e.g. 32bit) ETM.ContextID 32 To evaluate the contents of the trace buffer, use these commands: Trace.ListNesting Trace.STATistic.Func Trace.STATistic.TREE Trace.STATistic.sYmbol /SplitTASK Trace.Chart.Func Trace.Chart.sYmbol /SplitTASK Display function nesting Display function runtime statistic Display functions as call tree Display flat runtime analysis Display function timechart Display flat runtime timechart The start of the recording time, when the calculation doesn t know, which task is running, is calculated as (unknown). RTOS Debugger for CMX 11

CMX specific Menu The file cmx.men contains an alternate menu with CMX specific topics. Load this menu with the MENU.ReProgram command. You will find a new pull down menu called CMX. The topic CMXBug Terminal (if available) brings up a terminal emulation window, which communicates with the preconfigured CMXBug debugger. Break to CMXBug activates CMXBug. The Display topics launch the kernel resource display windows. The Stack Coverage submenu starts and resets the CMX specific stack coverage, and provides an easy way to add or remove tasks from the stack coverage window. The Trace->List pull-down menu is changed. You can additionally choose for an analyzer list window showing only task switches (if any) or task switches and defaults. The Perf menu contains the additional submenus for task runtime statistics, task related function runtime statistics and statistics on task states. RTOS Debugger for CMX 12

CMX Commands TASK.DCyclic Display cyclic timers Format: TASK.DCyclic Displays information about all cyclic timers. The display is similar to the CMXBug 'CYCLIC TIMER' dump. For an explanation of the items, see the CMXBug manual, CYCLIC TIMERS function. A corresponding task is displayed with its name, if available. Otherwise the task ID is displayed. TASK.DMailbox Display mailboxes Format: TASK.DMailbox <mailbox> Displays a table with all CMX mailboxes or one specific mailbox in detail. The display of this table is similar to the CMXBug 'MAILBOX' dump For an explanation of the items, see the CMXBug manual, MAILBOXES function. The task are displayed with their names, if available. Otherwise the task IDs are displayed. The 'magic' field is mouse sensitive, a double click on it will give you detailed information about this specific mailbox. RTOS Debugger for CMX 13

For a detailed information you can also specify a magic of a mailbox as argument to this function. You will get a list with all messages in this mailbox. The message address is mouse sensitive. Double clicking on it shows a memory dump of this address. TASK.DQueue Display queues Format: TASK.DQueue Displays a table with all CMX queues. The display is similar to the CMXBug 'QUEUE' dump. For an explanation of the items, see the CMXBug manual, QUEUE function. The 'address' field is mouse sensitive. Double clicking on it shows you a 'dump' window of this address. TASK.DRes Display resources Format: TASK.DRes Displays all resources specified in CMX. The display is similar to the CMXBug 'RESOURCE' dump The task are displayed with their names, if available. Otherwise the task IDs are displayed. A maximum number of five waiting tasks will be shown. An ending 'more ' will indicate that there are more than five waiting tasks. RTOS Debugger for CMX 14

TASK.DSema Display semaphores Format: TASK.DSema Displays a table with all CMX semaphores. For an explanation of the items, see the CMXBug manual, SEMAPHORE function. TASK.DTask Display tasks Format: TASK.DTask Displays the task table of MQX. The display is similar to the CMXBug 'TASK' dump. The magic specifies the value, with which the RTOS debugger identifies a specific task. The task name is only displayed, if the task was named with the 'cxtname' function. The stack column shows the stack bottom (high) address; this field is mouse sensitive. For an explanation of the other items, see the CMXBug manual, TASKS function. The fields magic, addr and stack are mouse sensitive, double clicking on them opens appropriate windows. Right clicking on them will show a local menu. RTOS Debugger for CMX 15

TASK.TASKState Mark task state words Format: TASK.TASKState This command sets Alpha breakpoints on all task status words. The statistic evaluation of task states (see Task State Analysis) requires recording of the accesses to the task state words. By setting Alpha breakpoints to this words, and selectively recording Alpha s, you can do a selective recording of task state transitions. Because setting the Alpha breakpoints by hand is very hard to do, this utility command sets automatically the Alpha s to the status words of all tasks currently created. It does NOT set breakpoints to tasks, that terminated or haven t yet been created. RTOS Debugger for CMX 16

CMX PRACTICE Functions There are special definitions for CMX specific PRACTICE functions. TASK.CONFIG(bottom, <task>) TASK.CONFIG(magic) Returns the stack bottom (upper) address Returns the address for the magic number TASK.CONFIG(magicsize) Returns the size of the magic number (1, 2 or 4) TASK.CONFIG(pointer, <task>) TASK.STACK(<item>, <task>) Returns the stack pointer of the task Reports stack information of a task Frequently-Asked Questions No information available RTOS Debugger for CMX 17