“ With QTrace you don’t need to be a high‐end user with a big budget or wait until you encounter a really nasty bug before deciding to purchase a trace system.”...
Page 7
RACE ANUAL A USB 3.0 connection from on the development PC is used to power the QTrace probe and to stream trace data from it. A standalone Windows application, QTrace Analyser, configures the probe then decodes and displays its streamed trace data.
(not supplied) Figure 3 Example QTrace hardware connection 1.3 Supported target devices The QTrace probe will support any Cortex M3/M4/M7 based device with ETM that complies with the ARM timing specifications. Currently QTrace Analyser currently supports the following devices: Manufacturer...
Section 1 - Overview RACE ANUAL 1.4 Supported IDEs A number of debugger scripts are supplied with QTrace Analyser to support most common IDEs: Version Tested See Section Atmel Studio V7.0 14.3 Cypress ModusToolbox V1.1 14.5 IAR Embedded Workbench V8.20 14.6...
3) Do not force the USB lead connector into the QTrace probe. If it does not mate easily then the USB lead connector may be damaged and the lead should be replaced.
(2) this device must accept any interference received, including interference that may cause undesired operation. Any changes or modifications to this equipment not expressly approved by PDQLogic Limited may cause harmful interference and void the user's authority to operate this equipment.
ANUAL 2. QTrace Analyser QTrace Analyser is a standalone application that runs on 64-bit Microsoft Windows 7, 8.1, 10 and 11. It interfaces to the QTrace probe via a USB3 connection and configures it for the chosen target device. The analyser then decodes and displays streamed trace data, independently of the IDE.
Reload the ELF specified in the trace configuration Reset Trace Probe Reset the QTrace probe Power Cycle Trace Probe Emulate reconnecting QTrace probe USB lead Import Interrupt Handlers... 5.1.2.1 Define ISRs when vector table is defined in RAM Delete Interrupt Handlers...
RACE ANUAL 3. Live Coverage This is the default view for QTrace Analyser and is shown in Figure 9. It is split into 3 resizable windows: 1. Function tree-view 2. Source window showing live code coverage 3. Multi-tabbed Setup/status window Figure 9 Live coverage view 3.1 Function tree-view...
Because QTrace Analyser does not have access to the JTAG port it cannot flush the buffer and thus there will be latency in execution count updates. This does not result in any trace data being lost however.
Figure 17 Smart function search 3.2.6.3 Find function from clipboard When switching between the IDE and QTrace Analyser there is an option to find a function implementation from a name saved on the Clipboard. In the IDE copy the function name of interest to ...
20. This view will also show the locations of any WFE/WFI sleep instructions that have been detected by QTrace Analyser. These instructions will cause erratic tracing behaviour because they suspend the trace signals and should be disabled in builds to be traced.
A report will only be generated when the target CPU is halted. NOTE: If QTrace and associated tools are used as part of a software verification process, PDQLogic Limited cannot be held liable for any direct, indirect or consequential loss resulting from inaccuracies in any generated data.
The trace interface allows a very convenient, low overhead, way of passing debug data from the target application to QTrace Analyser for viewing in a console window. This is achieved in firmware by simply writing to a reserved memory location at 0xe0000000, Port 0 Stimulus Register in the ARM Cortex-M Instrumentation Trace Module (ITM) .
Page 26
ITMDebug_Setup() to the end of the trace configuration procedure in the selected debugger script. Note: Any ITM debug support built into the IDE should be disabled when using QTrace. The ITM console window is shown via the menu option View ITM Console…...
Table 9 ITM debug settings summary 3.5.2 Debugger Connection A Localhost TCP connection to the debugger is optionally used by QTrace Analyser to allow the setting of real-time breakpoints when a GDB based debugger is used (see section 3.5.2.1) and to extract information about RTOS objects that are only known at run time (see RTOS viewer in section 6).
Page 29
IDE. Also, when a breakpoint set in this way is hit, execution cannot be resumed until it is cleared. To avoid this, QTrace Analyser constantly monitors target execution via the debugger TCP connection and if the CPU stops on one of its breakpoints it will automatically remove the breakpoint in the debugger.
RACE ANUAL 3.5.4 General Settings There are a number of QTrace Analyser settings that are accessible from the Settings tab at the bottom of the source window: Figure 32 General settings These settings are persistent and are summarised in the table below:...
ANUAL 4. Code Capture QTrace Analyser will continually decode trace data streamed data from the QTrace probe. It maintains a buffer of up to the last 64 million instructions traced and can freeze the buffer at any time. This is referred to as code capture.
Only one trace point can be defined and, unlike the other four triggers, the trace point: 1. is deleted when it triggers 2. will not be reinstated when QTrace Analyser is restarted 3. does not cause code capture to be disabled when it triggers 4.
When a trace configuration is created (see section 8, page 70), a series of code capture triggers is also created for the exception handlers. QTrace Analyser determines the locations of the handlers from the vector table (specified in the trace configuration) and configures triggers to cover all instructions in the handlers.
Once configured, the blocks will generate exception entry/exit events, timestamps and synchronisation frames which are then multiplexed with the main ETM trace data and streamed to the QTrace probe. The frames are decoded by QTrace Analyser and presented as minimum and maximum execution times for all interrupt handlers.
The manually specified vectors are also used by QTrace Analyser to automatically set the fault exception handlers which it monitors for execution and triggers a code capture if detected, see section 4.1.5.
To avoid manually locating all interrupt handlers when the vector table is defined in RAM, a CSV file can be imported into QTrace Analyser to define handlers in bulk. The first vector is the reset handler which starts at 1. The number of entries can be a subset or all of the interrupt sources as defined in the relevant datasheet.
This will output a list of vectors and their addresses to the ITM console window which can then be copied and pasted into a CSV file for importing into QTrace Analyser (menu option is shown in Figure 70). The function is triggered in the application e.g. a button press, when it is known that all vectors have been configured.
Threads should not be deleted (support will be added in a future release) QTrace has no direct access to the target JTAG interface and so the RTOS viewer requires a TCP connection to the debugger to extract information that is only known at run time. Currently OpenOCD and J-Link debuggers are supported.
There are a few minor changes required to a firmware project to support the RTOS viewer. The changes are essentially: 1. Copy five files supplied with QTrace Analyser to the project folder 2. Optionally update the project include path 3. Add two of the copied source files to the project build 4.
Page 63
/* start FreeRTOS tracing */ traceSTART(); /* Initialise QTrace RTOS viewer */ osKernelInitialize(); If using VisualGDB refer to the note in ‘Debugger’, Table 13 Enable the RTOS viewer via a checkbox at the bottom left corner of the trace configuration dialog, see Figure 101 on page 70.
The Cortex-M architecture provides 32 separate ‘ports’ for transferring application specific data to the host debugger or, in this case, QTrace Analyser. The ports are also referred to as stimulus registers and are accessed via reserved memory locations in the range 0xE0000000 – 0xE0000007F. Port 0 is accessed at 0xE0000000, port 1 at 0xE0000004 and so on.
1ms intervals. With 10,000 points per cycle and using the default QTrace Analyser circular buffer size of 60,000 points per port, this results in 6 cycles per waveform being displayed, the equivalent of a 1 minute history. The CPU temperature data is read, filtered and transmitted as <time>,<data>...
The maximum is 100,000 points. 7.4.4 ITM Port Configuration Each user port to be graphed should first be configured in QTrace Analyser. Double clicking the selected ‘ITM stimulus port’ in the ‘ITM Display Settings’ dialog (Figure 96) will display the ‘Port-x Settings’ dialog: Figure 99 ITM user port configuration These settings are used to configure both the graphed waveform and its associated numeric display.
Section 7 - ITM Graphing RACE ANUAL 7.5 Configuring firmware for ITM graphing QTrace Analyser provides examples of how to configure and write to the ITM user ports in the following source files: C:\Users\Public\PDQLogic\QTraceAnalyser\Firmware\QTrace_Library\ITM\ITMDebug.c/.h C:\Users\Public\PDQLogic\QTraceAnalyser\Firmware\QTrace_Library\ITM\ITMGraphDemo.c/.h The function ITMGraphDemo_Thread() in ITMGraphDemo.c shows examples of writing data to user ports.
This is a drop-down list of the supported devices for the selected manufacturer. Refer to section 1.3 for the devices currently supported by QTrace Analyser. Each entry in the drop-down list may be a specific device or a range of devices. This is dictated by the device feature set and the interrupt vector sources.
Each manufacturer offers different ROM sizes and because the device definition files do not detail every single device, ROM size has to be entered manually. The ROM start address and size are used by QTrace Analyser to determine if an address decoded from trace data is valid.
Each entry can be selected as a path relative to the configuration file or an absolute path which is useful for library files. QTrace Analyser will try to locate all source files but occasionally these can’t be found either because they’re not on the file system e.g. library source files, or because there was not enough information in the ELF file.
Page 74
Open File dialog file name to the search text box to initiate a Windows search for the file. If the file was found, simply double click on its file path in the Open File dialog and QTrace Analyser will then remove the entry from the missing files list.
Figure 107 Additional code range dialog If an image file is selected then QTrace Analyser will attempt to disassemble it to create a database of instructions to allow QTrace Analyser to decode trace data for the additional code range e.g. instruction size, branch address, etc.
GPIO configuration registers or to the trace hardware registers as this will likely cause tracing to fail. 8.1.17 Trace port voltage The QTrace probe supports two nominal voltage ranges, 1.8V and 3.3V. Refer to Table 3 on page 9 for minimum and maximum voltage levels.
Before target execution is started, the IDE will run the specified debugger script (section 8.1.16, page 76) to configure the target trace interface. Once this is done, and QTrace Analyser has detected a valid trace data stream, the display will change to that shown in Figure 111. If QTrace Analyser is unable to synchronise with the trace data stream then an error message will be displayed.
Page 79
Figure 111 QTrace Analyser configured and ready to trace When the target is commanded to run by the IDE, it will start streaming trace data which QTrace Analyser will decode and display. The CPU speed and coverage in the status bar will be updated to reflect their new values.
Section 10 - Self Test Mode RACE ANUAL 10. Self Test Mode QTrace Analyser has a self-test mode which allows the QTrace probe to be exercised without a target processor being connected. It is selected from the Help Self Test menu option.
Disable instruction simulation when using a Segger J-Link, see section 14.2. Connect a second screen to display QTrace Analyser so that it can be viewed side by side with the IDE/debugger. Do not place breakpoints on exception handlers. The buffered trace data is several instructions behind the current instruction and a breakpoint will prevent the exception being decoded.
12.1 ETM Decode Rate The key indicator of how QTrace Analyser is performing is the average decode rate. It is displayed as a multiplier next to the ETM data rate in the status bar (see Figure 7 on page 15). This multiplier shows how much faster the trace data is being processed compared with the incoming data rate.
Try a different USB3 port and USB3 hub, check 'PDQLogic found issue QTrace' is found in device manager No visible trace USB3 communication Power cycle USB3 hub or reboot PC if QTrace probe is activity but trace issue connected directly hardware buffer overflows...
PC peripherals/drivers added. Next, unplug the 20 way trace connector from the target then power cycle the target board, JTAG adapter and QTrace probe and retry. If the problem persists, try running an example project on a demonstrator board to eliminate a target hardware issue.
M7 devices because of their increased performance. When tracing a Cortex-M7 device, it is recommended that QTrace Analyser is run on a fast PC with 16GB+ RAM and at least 4 CPU cores to ensure it can keep up with the streamed trace data.
After configuring the target trace interface, a debugger script will run a short section of code in target RAM to allow the QTrace probe to synchronise with the trace data stream. In some scenarios, the probe may not always be synchronised in time for the target Cortex-M7 CPU to begin executing from reset.
The internal bandwidth of the ITM and DWT functions in the Cortex-M can become a constraint when transmitting significant amounts of data. As a result, the ITM may indicate an overflow and/or QTrace Analyser may lose synchronisation with the incoming ITM data frames.
Figure 120 QTrace probe hard reset 13.4 USB Errors Erratic behaviour with the QTrace probe can be caused by USB communication issues. If underlying errors are detected with the USB link they will be displayed in the status bar as shown below in the...
Although every IDE performs the same basic functions, each one has a different way of interacting with the target. This section details how to configure the debugger scripts supplied with QTrace Analyser for a number of common IDEs. These scripts eliminate the need for any modifications to target code.
14.3 Atmel Studio 7.0 Atmel Studio 7.0 supports the SAM-5x series of ARM Cortex-M based devices from Atmel (now Microchip). A Python based debugger script is supplied with QTrace Analyser for use with SAM-5x devices, see C:\Users\Public\PDQLogic\QTraceAnalyser\Debugger Scripts\Atmel Studio7 Unlike most IDEs, there are no settings required in the GUI. Simply copy the script file to the project debug folder and Atmel Studio will detect its presence and load it.
Page 93
(as of V9.3). As a result, QTrace Analyser will not detect a target reset and will not automatically clear its internal state, including code coverage.
14.5 Cypress ModusToolbox The Eclipse based ModusToolbox IDE from Cypress is used to develop applications for the dual-core CY8C63xx Bluetooth based devices. The Cortex-M4 core can be traced using QTrace Analyser (the CM0+ core doesn’t support ETM trace). An application note on using QTrace with the CY8C6347 is available at: www.pdqlogic.com/documents/QTrace-Application-Note-002.pdf...
Figure 139 Segger Embedded Studio debugger script settings Note: Make sure there is no XXX_Target.js file included in the project as this will take precedence over the QTrace script file. Also, after entering debug mode and re-programming the target, it may be necessary to press ('Restart' button) in Embedded Studio to ensure trace is initialised.
CPU after FLASHing or after it has been reset via the toolbar reset button. Halting at reset gives QTrace Analyser sufficient time to prepare for tracing from the reset vector. Note: Ensure the ‘Resume’ check box is un-ticked. The CPU may still not always halt at the temporary breakpoint when the target reset toolbar button is pressed.
ANUAL Appendix A Manual driver installation A USB3 driver is included with the QTrace Analyser installation and the installer will request Administrator privileges to do this. If the request fails then this will prevent the driver from being installed and a manual installation process is required.
Page 112
1) Connect the QTrace probe to a USB 3.0 port 2) If a Windows update message is displayed then cancel it 3) When no driver is installed, QTrace will be identified as ‘WestBridge’ in the Device Manager: Figure 149 QTrace probe shown as 'WestBridge' Right click on WestBridge and select the option ‘Update Driver Software…’...
If the source is unavailable e.g. part of a library file, then a command line utility called NoSleep.exe supplied with QTrace Analyser can be used to replace WFE/WFI instructions in an ELF file with NOP instructions.
(1) this device may not cause harmful interference, and (2) this device must accept any interference received, including interference that may cause undesired operation. Part 15.21 Any changes or modifications to this equipment not expressly approved by PDQLogic Limited may cause harmful interference and void the user's authority to operate this equipment. Part 15.105 This equipment has been tested and found to comply with the limits for a Class B digital device, pursuant to part 15 of the FCC Rules.
Need help?
Do you have a question about the QTRACE and is the answer not in the manual?
Questions and answers