Skip navigation

Ozone — The J-Link Debugger

  • Stand-alone graphical debugger
  • Debug output of any tool chain and IDE
  • C/C++ source level debugging and assembly instruction debugging
  • Debug information windows for any purpose: disassembly, memory, globals and locals, (live) watches, CPU and peripheral registers
  • Source editor to fix bugs immediately
  • High-speed programming of the application into the target
  • Direct use of J-Link built-in features (Unlimited Flash Breakpoints, Flash Download, Real Time Terminal, Instruction Trace)
  • Scriptable project files to set up everything automatically
  • New project wizard to ease the basic configuration of new projects

Get started with J-Trace PRO and Ozone — The J-Link Debugger

Ozone offers leading capabilities for code coverage and profiling analysis on Cortex-M systems with the SEGGER J-Trace PRO trace probe. The Ozone J-Trace PRO Tutorial Project serves as a starting point to test the J-Trace PRO streaming trace and live analysis capabilities, and demonstrates how you can get the most advanced analysis of their system in less than 15 minutes.

The Tutorial Project starts with a simple application running on the target hardware, demonstrating the trace features without any special code or configuration. More advanced examples, including system init and the use of embOS are part of the project too, and can be analyzed with J-Trace PRO as well. It includes the pre-built applications, the Ozone projects, and an Embedded Studio project to modify and re-build the application.

Download  Ozone J-Trace PRO Tutorial Project

Download  J-Link Software & Documentation Pack

Download  Ozone for Windows, MacOSX or Linux

J-Trace Pro - Getting started (9:38)

Target Hardware

The tutorial project can be used with the SEGGER Reference Boards. The Tutorial Walkthrough is written for the Cortex-M Trace Reference Board. The same instructions apply for the emPower Board with the according files.

Cortex-M Trace Reference Board

  • ST STM32F407VE
  • ARM Cortex-M4F
  • External debug header with trace pins
  • Test points for trace signals

emPower Reference Board

  • NXP MK66FN2M0VMD18
  • ARM Cortex-M4F
  • External debug header with trace pins
  • More information

Tutorial Walkthrough

Tutorial Walkthrough

1. Download the tutorial project and make sure the J-Link Software and the latest Ozone are installed.

2. Extract the project into any destination directory on your computer, C:\Tutorial\Tracing\.

3. Connect the J-Trace PRO with your computer and the target board, and power the board.

4. Open Start\SEGGER_CortexM_Trace_Reference_Board.jdebug from the project directory with Ozone.

5. Open the Code Profile Window and the Instruction Trace Window. (View -> Code Profile> and View -> Instruction Trace)

6. Set a breakpoint at BSP_SetLED(0); in main() in TraceDemo.c

7. Start the debug session. (Debug -> Start Debugging)

Ozone starts and loads the pre-built executable for your Cortex-M Trace Reference Board. The application is loaded into your Cortex-M Trace Reference Board, it starts and runs to main.

8. Continue to run to your breakpoint. (Debug -> Continue)
Ozone breaks after returning from BSP_Init().

The Instruction Trace Window shows what has been executed up to this point. The most recent instructions are at the bottom. Instructions are grouped by source line and corresponding function. Collapsing all blocks shows which functions have been called and to which functions the application returned.

When all blocks are expanded, you can navigate through the instructions to follow the execution in the Source Viewer and Disassembly Window and see what has exactly happened from the start at main until the breakpoint was hit.

9. Continue the execution again. (Debug -> Continue)

The application runs and the LEDs flash. The left column in the Source Viewer and the Disassembly Window displays the code coverage of the application to show which source lines and instructions have been executed. Source lines in the Source Viewer can be expanded to show which instructions each source line generated.

The code coverage information is colored in three different levels

On Source Lines On Instructions
   All instructions executed Instruction fully executed (if conditional, condition met and not met)
   Conditional instruction never executed (condition always not met)
   Not all instructions executed Conditional instruction not fully executed (condition always met)
   Code never reached Instruction never fetched

10. Show Code Profile counters in Source Viewer. (Right-Click in Source Viewer -> Show Execution Counters)

In addition to the code coverage marker, the left column can show the execution count of source lines and instructions. The counters are updated from the trace stream, while the application is running. Hover the mouse over a counter to get the fetch and not-executed count, and the CPU load of this line in a tooltip.

11. Open the Code Profile Window. (View -> Code Profile)

The Code Profile Window displays the code coverage and profiling information by function. It allows sorting by load or coverage and filtering functions to not count them in the load statistics.

trace-tutorial-5.png
Trace tutorial

12. Export trace data into a report. (Right-Click in Code Profile Window -> Generate Report)

The information from the Code Profile Window can be exported into a report which can be used for verification processes.


The Tutorial Project includes all sources to recompile the application in an Embedded Studio project.

To alter the project, open Start\J-Trace_PRO_CortexM_Tutorial.emProject with Embedded Studio.

The solution consists of four projects:

  1. SEGGER Cortex-M Trace Reference Board: The main project with device support for the Cortex-M Trace Reference Board
  2. SEGGER emPower Reference Board: The main project with device support for the emPower Reference Board
  3. Application: The trace demo sample application
  4. Common: Shared modules for both boards

Modifications should be done to the Application project. You can change OS_TraceDemo.c, include TraceDemo.c, which runs without an OS, or add your own application file.

When all changes are done, recompile the project (Build -> Build Solution), which creates the application for both reference boards. If the Ozone project is still opened, it will prompt to reload the application file which has just changed. If Ozone is not started, start it and load Start\SEGGER_CortexM_Trace_Reference_Board.jdebug.

To test the tracing and analysis features on the emPower board, open  Start\SEGGER_emPower_Reference_Board.jdebug instead.

The Tutorial Project includes all sources to recompile the application in an Embedded Studio project.

To alter the project, open Start\J-Trace_PRO_CortexM_Tutorial.emProject with Embedded Studio.

The solution consists of four projects:

  1. SEGGER Cortex-M Trace Reference Board: The main project with device support for the Cortex-M Trace Reference Board
  2. SEGGER emPower Reference Board: The main project with device support for the emPower Reference Board
  3. Application: The trace demo sample application
  4. Common: Shared modules for both boards

Modifications should be done to the Application project. You can change OS_TraceDemo.c, include TraceDemo.c, which runs without an OS, or add your own application file.

When all changes are done, recompile the project (Build -> Build Solution), which creates the application for both reference boards. If the Ozone project is still opened, it will prompt to reload the application file which has just changed. If Ozone is not started, start it and load Start\SEGGER_CortexM_Trace_Reference_Board.jdebug.

To test the tracing and analysis features on the emPower board, open  Start\SEGGER_emPower_Reference_Board.jdebug instead.