# Using TRACE32
## Overview
This chapter describes various issues related to using TRACE32. It
covers the following topics:
- Error messages “debug port fail” or “debug port time out”
- Debugger window displays flickering data
- Using wildcards in the symbol browser
- Warning message when stepping into functions
- Error message “running(off)”
- Error message “Emulation debug port fail…”
- Debugging exceptions in the target application
- TRACE32 fails with message “bus error”
- TRACE32 fails with message “access timeout, processor running”
- TRACE32 terminates with request for license file
- Running the debugger without the GUI
## Error messages “debug port fail” or “debug port time out”
The TRACE32 debugger command system.up is typically the first command
executed in a debug session.
If this command generates the error message “debug port fail” or
“debug port time out”, open the debugger AREA window to view any
additional messages that might have been generated (for example,
“target processor in reset” is simply a follow-up error message).
The “debug port” error messages can be generated for a number of
reasons:
- The target system has no power, or the debug cable is not connected
to the target. This results in the additional error message “target
power fail”.
- The command system.cpu was specified with an invalid processor type.
- The JTAG interface experienced an electrical problem – check the
schematic.
- The debug features need to be enabled (jumpered) on the target. For
example, the debugger will not work if signal nTRST is directly
connected to ground on the target side. (This is a known issue on
some SURF boards.)
- The target system is in an unrecoverable state – re-power it and try
again.
- The target system cannot communicate with the debugger while in
reset. If this occurs, instead of using the system.up command try
using system.mode attach followed by break, or alternatively
“system.option enreset off”.
- The default JTAG clock speed is too fast, especially when the target
processor is emulated or when using an FPGA-based target. In this
case try using the command “system.jtagclock 50kHz”; then after the
target is working, try gradually increasing the specified clock
speed.
- The target processor needs adaptive clocking. In this case specify
RTCK mode with the command “system.jtagclock rtck” (which is typical
for ARM cores).
- The debugger multicore settings are missing when the target is a
daisy-chained multi-core system. To check this, enter the command
“diag 3400” and then view the AREA window:
- The value “ir\_width > 5” indicates that the multicore settings are
necessary.
- The value “ir\_width = 4” (ARM9) indicates that the multicore
settings are unnecessary.
- If no value is displayed, there may be a problem with the JTAG
interface.
- The target processor has no clock.
- The target processor is held in reset.
- A watchdog timer exists which needs to be deactivated.
## Debugger window displays flickering data
If the data in a debugger window is flickering, try one of the
following solutions:
- Ensure that turbo mode is disabled (using the command “system.option
turbo off”).
- The default JTAG clock speed may be too fast. Try using the command
“system.jtagclock 50kHz”; then if the flickering disappears, try
gradually increasing the specified JTAG clock speed.
- Check that the MMU is correctly programmed. If not, the data
displayed may not be the data you think it is.
## Warning message when stepping into functions
When the TRACE32 debugger breaks/steps into a function, it attempts
to read source code information based on the debug symbols it
encounters in the newly-entered function. If the source code
information can’t be found, the debugger will generate a warning
message.
If a warning message appears while you are debugging a program, two
options are available for helping TRACE32 find the correct source
path:
### Solution 1:
Use the following command to remove six path variables and replace
them with a string containing the path to the source code files. For
example:
d.load.elf ..\..\build\ig_server.reloc /STRIPPART 6 /PATH L:\user\tools
Copy to clipboard
#### Solution 2:
Use the command symbol.sourcepath to directly specify the source
file. For example:
symbol.sourcepath + L:\user\tools\rtos\okl-1.3.4\libs\qurt\src\qmsgq\sys-iguana\qMsgQClient.c
Copy to clipboard
## Error message “running(off)”
If the TRACE32 debugger displays the message “running(off)” after you
click on Continue, this indicates that a thread continued executing
past a stop instruction. (Note that a thread normally cannot execute
past a stop.)
The most probable cause for this event is that the target application
crashed, which then caused the RTOS kernel to execute an assert which
stopped all the threads. To debug the cause of the assert, use the
procedure described in [Debugging exceptions in the target application](https://docs.qualcomm.com/doc/80-N2040-28/topic/using-trace32.html#debug-exception-target-app).
## Error message “Emulation debug port fail…”
If the TRACE32 debugger displays the message:
`Emulation debug port fail. Unable to set up debugging, ISDB clock off`
…this means that no clocks are reaching ISDB (as indicated by the
ISDB enable register field ISDB\_CLK\_OFF being set to 1).
This usually indicates is that no clocks are being driven to the
Hexagon at the point where the debugger tries to access ISDB. The
debugger sets JTAG\_ISDB\_EN and then polls ISDB\_CLK\_OFF; if it does
not see the value flip to zero after a period of time, the debugger
gives up.
By default the debugger polls ISDB\_CLK\_OFF 100 times before giving
up. The poll count can be changed by using the command “DIAG 3003.
xxx”, where xxx specifies the poll count.
Note
Changing the poll count will affect other timeouts, and may
result in strange behavior if the count is set too high. Note also
that the DIAG command is not supported by Lauterbach.
## Debugging exceptions in the target application
Optimally, the RTOS kernel would respond to a user page fault or
unhandled exception in the target application by performing the
following actions:
1. Stop all other executing threads
2. Flush memory
3. Report the register state of the current hardware thread
4. Stop itself
However, hardware limitations in the Hexagon V2 processor prevent the
current hardware thread from immediately stopping the other hardware
threads.
Therefore, the best method for catching these exceptions is to set
breakpoints on the following label symbols:
- hexagon\_page\_fault
- hexagon\_error\_exception
When the breakpoint is hit, use the debug tools to obtain the
necessary register and thread information from the TCB (thread
control block).
The following table shows the memory structure of the TCB.
**Table A-1 TCB structure**
| **Field** | **Description** |
| --- | --- |
| myself\_global | Thread global ID |
| thread\_state | Thread state
running (0x2): Thread running or runnable if context = -1
waiting_forever (-1): Thread waiting to receive IPC from
other threads
waiting_timeout (0x5): Thread waiting to receive IPC notify
from other threads
polling (0xb): Thread waiting to send IPC to another thread,
which is not ready to receive the IPC
halted (0xd): IRQ thread waiting to receive interrupt