Difference between revisions of "J-Trace"
(→Trace related) |
(→Pinout / Trace debug interface) |
||
(15 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | <!--- TBD: |
||
− | * Ozone & J-Trace infos are partially redundant on the homepage, e.g. see [[#J-Trace]]. |
||
− | * Backtrace does not have a link yet. |
||
− | * Check articles for redundant information and update them. |
||
− | * Remove all articles that are not required anymore. |
||
− | ---> |
||
[https://www.segger.com/products/debug-probes/j-trace/ J-Trace] is a SEGGER debug and trace probe, specialized on live instruction tracing. |
[https://www.segger.com/products/debug-probes/j-trace/ J-Trace] is a SEGGER debug and trace probe, specialized on live instruction tracing. |
||
Line 23: | Line 17: | ||
** [[ETB]] |
** [[ETB]] |
||
** [[TMC]] |
** [[TMC]] |
||
− | * [https://www.segger.com/products/debug-probes/j-trace/technology/setting-up-trace/ Arm trace specification and timings] |
||
== Available Trace features == |
== Available Trace features == |
||
Line 40: | Line 33: | ||
* [https://www.segger.com/products/debug-probes/j-trace/technology/real-time-code-coverage/ Live code coverage] <!--- REDUNDANT INFO WITH: https://www.segger.com/products/development-tools/ozone-j-link-debugger/technology/code-coverage/ ---> |
* [https://www.segger.com/products/debug-probes/j-trace/technology/real-time-code-coverage/ Live code coverage] <!--- REDUNDANT INFO WITH: https://www.segger.com/products/development-tools/ozone-j-link-debugger/technology/code-coverage/ ---> |
||
* [https://www.segger.com/products/debug-probes/j-trace/technology/real-time-profiling/ Live code profiling] <!--- REDUNDANT INFO WITH: https://www.segger.com/products/development-tools/ozone-j-link-debugger/technology/code-profiling/ ---> |
* [https://www.segger.com/products/debug-probes/j-trace/technology/real-time-profiling/ Live code profiling] <!--- REDUNDANT INFO WITH: https://www.segger.com/products/development-tools/ozone-j-link-debugger/technology/code-profiling/ ---> |
||
+ | * [[Backtrace]] |
||
− | * Backtrace - Gap less instruction "time machine": When the target is halted all the recorded data will be read from the recording buffer. Currently this buffer is limited to the J-Trace memory (64 MB). Unlimited (host side buffering) is coming soon. |
||
* [[J-Link_Command_Strings#TraceFile | Trace to file]] |
* [[J-Link_Command_Strings#TraceFile | Trace to file]] |
||
* [[Automated_Tests_with_Ozone#Trace_example | Trace automation with Ozone]] |
* [[Automated_Tests_with_Ozone#Trace_example | Trace automation with Ozone]] |
||
Line 50: | Line 43: | ||
Together with the J-Trace Pro, a trace reference board is shipped. |
Together with the J-Trace Pro, a trace reference board is shipped. |
||
− | For this board, a trace tutorial project is available on the [https://www.segger.com/products/development-tools/ozone-j-link-debugger/technology |
+ | For this board, a trace tutorial project is available on the [https://www.segger.com/products/development-tools/ozone-j-link-debugger/technology/ozone-trace-tutorial/ SEGGER homepage]. |
== Setting up Trace with J-Trace == |
== Setting up Trace with J-Trace == |
||
<!--- TBD: Compare with https://www.segger.com/products/debug-probes/j-trace/technology/setting-up-trace/ ---> |
<!--- TBD: Compare with https://www.segger.com/products/debug-probes/j-trace/technology/setting-up-trace/ ---> |
||
− | If no example project is available for a specific device |
+ | If no example project is available for a specific device an example project can be requested via the [https://www.segger.com/support/technical-support/ official SEGGER Technical support]. Alternatively, support can also be added manually which is explained below. |
=== Pinout / Trace debug interface === |
=== Pinout / Trace debug interface === |
||
Line 61: | Line 54: | ||
The trace pinout (19-pin) used by J-Trace can be used with JTAG and SWD: |
The trace pinout (19-pin) used by J-Trace can be used with JTAG and SWD: |
||
− | * [[ |
+ | * [[19-pin_JTAG/SWD_and_Trace_Connector | Trace pinout]] |
* [[How_to_connect_JTAG_nTRST_when_using_19-pin_trace_header | Connect nTRST using 19-pin trace header]] |
* [[How_to_connect_JTAG_nTRST_when_using_19-pin_trace_header | Connect nTRST using 19-pin trace header]] |
||
+ | |||
+ | ====Trace pin initialization==== |
||
The pins, clocks, etc. required for tracing can be initialized either via the device application, or via a [[J-Link_script_files | J-Link Script file]]. |
The pins, clocks, etc. required for tracing can be initialized either via the device application, or via a [[J-Link_script_files | J-Link Script file]]. |
||
− | Using a J-Link script file is generally recommended, as otherwise the init section of the code will not be traced when initializing trace from the target application. Another benefit is that by using a J-Link Script file you guarantee that not debug code gets overlooked and |
+ | Using a J-Link script file is generally recommended, as otherwise the init section of the code will not be traced when initializing trace from the target application. Another benefit is that by using a J-Link Script file you guarantee that not debug code gets overlooked and accidentally stays in your final product code. In some rare cases it might also be the case that the Arm specific registers may not be written by the J-Trace probe before they have been clocked by a chip specific init. So doing the init via the target application would be way to late. The J-Link script makes sure everything is initialized at the correct time to avoid such issues. |
* [[How_to_configure_JLinkScript_files_to_enable_tracing | Guide how to initialize trace pins via J-Link Script file]]. |
* [[How_to_configure_JLinkScript_files_to_enable_tracing | Guide how to initialize trace pins via J-Link Script file]]. |
||
Line 77: | Line 72: | ||
* [[Keil_MDK-ARM#Trace_support | KEIL MDK]] |
* [[Keil_MDK-ARM#Trace_support | KEIL MDK]] |
||
* [[Renesas_e%C2%B2studio#Enabling_Trace| e2Studio]] |
* [[Renesas_e%C2%B2studio#Enabling_Trace| e2Studio]] |
||
+ | * IAR: See IAR documentation for reference. Trace settings and inits are completely handled via the IDE. |
||
− | * IAR - TBD. |
||
+ | |||
+ | === Technical specification === |
||
+ | * [[Arm trace technical specification]] |
||
+ | * [[SiFive Nexus Trace technical specification]] |
||
+ | * [[Trace board design recommendations]] |
||
+ | * [[Debug setup considerations when tracing]] |
||
== Trouble shooting == |
== Trouble shooting == |
||
Line 83: | Line 84: | ||
=== Trace related === |
=== Trace related === |
||
− | * [ |
+ | * [[Adjusting trace timings and general troubleshooting]] |
* [[Ozone_Debug_and_Trace_with_RAM_Functions | Debug & Trace with RAM Functions / reading into trace cache]] |
* [[Ozone_Debug_and_Trace_with_RAM_Functions | Debug & Trace with RAM Functions / reading into trace cache]] |
||
* [[J-Trace_overflow_error | Handling J-Trace overflow errors]] |
* [[J-Trace_overflow_error | Handling J-Trace overflow errors]] |
||
Line 94: | Line 95: | ||
=== FAQ === |
=== FAQ === |
||
* [[J-Trace vs. J-Trace_PRO | Reasons to upgrade your older J-Trace CM model to a J-Trace Pro]] |
* [[J-Trace vs. J-Trace_PRO | Reasons to upgrade your older J-Trace CM model to a J-Trace Pro]] |
||
+ | * [[Setting_up_Ethernet_interface#Setting_up_direct_connection_without_DHCP_to_the_host_PC.27s_Ethernet_interface | How to connect the J-Trace Pro directly via Ethernet to host PC without a router or switch]] |
Latest revision as of 14:05, 5 June 2023
J-Trace is a SEGGER debug and trace probe, specialized on live instruction tracing.
For the full feature set and best performance, it is recommended to use J-Trace in combination with the Ozone debugger.
For purchasing information and technical specification, please refer to the SEGGER homepage
General information about tracing
- General information about different trace types
- General information about Arm Coresight trace elements:
Available Trace features
Some trace features are only available for the J-Trace Pro series. For more information see below.
J-Link
J-Trace Pro
- J-Trace Pro supports all of the features listed above and additionally the following.
- Realtime/Streaming Trace
- Live code coverage
- Live code profiling
- Backtrace
- Trace to file
- Trace automation with Ozone
Tested devices
The tested devices page on the SEGGER homepage contains a variety of different devices, that trace support has been tested with. For these devices example projects are available, including J-Link script files containing the required (pin) init. This is usually the best starting point if you want to trace a device, as it provides an out of the box experience.
Together with the J-Trace Pro, a trace reference board is shipped. For this board, a trace tutorial project is available on the SEGGER homepage.
Setting up Trace with J-Trace
If no example project is available for a specific device an example project can be requested via the official SEGGER Technical support. Alternatively, support can also be added manually which is explained below.
Pinout / Trace debug interface
Usually, devices provide multiple trace pin combinations to use trace with. This also means, that the pins have to be initialized before tracing can work.
The trace pinout (19-pin) used by J-Trace can be used with JTAG and SWD:
Trace pin initialization
The pins, clocks, etc. required for tracing can be initialized either via the device application, or via a J-Link Script file. Using a J-Link script file is generally recommended, as otherwise the init section of the code will not be traced when initializing trace from the target application. Another benefit is that by using a J-Link Script file you guarantee that not debug code gets overlooked and accidentally stays in your final product code. In some rare cases it might also be the case that the Arm specific registers may not be written by the J-Trace probe before they have been clocked by a chip specific init. So doing the init via the target application would be way to late. The J-Link script makes sure everything is initialized at the correct time to avoid such issues.
Setting up Trace with Ozone
Setting up Trace with different IDEs
- Embedded Studio
- KEIL MDK
- e2Studio
- IAR: See IAR documentation for reference. Trace settings and inits are completely handled via the IDE.
Technical specification
- Arm trace technical specification
- SiFive Nexus Trace technical specification
- Trace board design recommendations
- Debug setup considerations when tracing
Trouble shooting
In this section multiple trouble shooting articles are referenced.
- Adjusting trace timings and general troubleshooting
- Debug & Trace with RAM Functions / reading into trace cache
- Handling J-Trace overflow errors
- Tracing modified code
- J-Trace driver issue (driver could not be started)
- USB driver not found / J-Trace detected as HP printer BIDI