Difference between revisions of "Ozone"

From SEGGER Wiki
Jump to: navigation, search
(Watch window example)
(33 intermediate revisions by 5 users not shown)
Line 1: Line 1:
  +
Ozone is a full-featured graphical debugger for embedded applications. With Ozone it is possible to debug any embedded application on C/C++ source and assembly level. Ozone can load applications built with any tool chain / IDE or debug the target's resident application without any source. Ozone includes all well-known debug controls and information windows and makes use of the best performance of J-Link and J-Trace debug probes. The user interface is designed to be used intuitively and is fully configurable. All windows can be moved, re-sized and docked to fit the need of any developer.
__TOC__
 
=Automated test example=
 
Ozone features an advanced Scripting interface which can be used for automated tests as well.
 
A simple example of such a setup will be shown in the following article. This can then be used as baseline to e.g. export Code Profile or Instruction Trace reports.
 
   
  +
Ozone is more than a simple debugger. Its various features, including trace, code profiling and code coverage analysis make it a powerful performance analyzer, which enable you to get full system insight, to track down inefficiencies and bugs, and to make your products even better.
== Example Setup Requirements ==
 
For the automated test example that will be shown in this article the following minimum requirements must be met:
 
   
  +
__TOC__
* J-Link software V6.30h or later
 
  +
Related articles
* Ozone V2.56f or later
 
* Any J-Link/J-Trace model (Base or higher) that can be used with Ozone
 
* SEGGER Cortex-M Trace Reference Board with a STM32F407 target device
 
 
== Example project ==
 
The following sample project is designed to be used with J-Link/J-Trace and Ozone to demonstrate automation with Ozone. The project has been tested with the minimum requirements mentioned above and a ''Cortex-M Trace Reference Board''. The sample project comes with a pre-configured project file for Ozone that runs out-of-the box. In order to rebuild the sample project, [https://www.segger.com/embedded-studio.html SEGGER Embedded Studio] can be used.
 
The example project can be downloaded here:
 
 
[[Media:Ozone_Automation_Demo_ST_STM32F407.zip|Ozone_Automation_Demo_ST_STM32F407.zip]]
 
 
The following steps will be executed in the example:
 
# Load test application
 
# Set a breakpoint
 
# Run to the breakpoint
 
# Execute a function that has been set to run when breakpoint is hit
 
# Close Ozone
 
 
'''Note:''' This is only an example test automation and it can be adjusted to individual needs using the extensive scripting interface of Ozone. More information can be found in the Ozone user manual.
 
 
=Dual core debugging example based on NXP LPC4350=
 
 
This article describes how to setup dual core debugging with Ozone the J-Link debugger.
 
 
== Required soft- and hardware ==
 
 
The sample project has been tested with the following components:
 
 
*J-Link
 
*Arrow LPC-4350-DB1 Rev.B evaluation board
 
*J-Link software version V6.32g or later
 
*SEGGER Embedded Studio V3.40
 
*Ozone V2.56s
 
 
== Running the sample project ==
 
 
The Cortex-M4 simply sends a defined command to the Cortex-M0 using shared memory and waits for the response before it resumes execution. The Cortex-M0 waits for command reception from the Cortex-M4 and simply sends back a "received-response" using shared memory.
 
 
To run the sample project at first open the project Ozone_Multicore_LPC4350_CM4.jdebug with Ozone and start a debug session. Then open a second instance of Ozone with the project Ozone_Multicore_LPC4350_CM0.jdebug and start the debug session.
 
Now you can independently run, halt and step both cores. Please note that starting the Cortex-M4 will issue a system reset and affect both cores, so the Cortex-M4 always has to be started before the Cortex-M0.
 
 
== Included files ==
 
{| class="wikitable"
 
|-
 
! Filename !! Content
 
|-
 
| '''Readme.txt''' || Readme file with instructions for debugging
 
|-
 
| '''LPC4350_CortexM0_SES\LPC4350_CortexM0_SES.emProject''' || Cortex M0 core project file
 
|-
 
| '''LPC4350_CortexM0_SES\Src\*''' || Cortex M0 core project source files
 
|-
 
| '''LPC4350_CortexM4_SES\LPC4350_CortexM4_SES.emProject''' || Cortex M4 core project file
 
|-
 
| '''LPC4350_CortexM4_SES\Src\*''' || Cortex M4 core project source files
 
|-
 
| '''Ozone_Multicore_LPC4350_CM0.jdebug''' || Cortex M0 Ozone project
 
|-
 
| '''Ozone_Multicore_LPC4350_CM4.jdebug''' || Cortex M4 Ozone project
 
|}
 
 
== NXP LPC4350 Embedded Studio Projects ==
 
[[Media:LPC4350_DualCore_Debug_ES340_Ozone.zip | LPC4350_DualCore_Debug_ES340_Ozone.zip]]
 
 
=Start debug session with bootloader=
 
 
Whenever a new project is created with Ozone, Ozone will assume that the .elf file you opened also points to the starting point of your application. This is usually the case. However should you have e.g. a bootloader that needs to be executed first the Ozone project must be edited accordingly.
 
 
== How to ==
 
Each Ozone project is saved as a .jebug file. The Ozone project itself is written in a C-like scripting language and can be edited if needed. Per default functions ''AfterTargetDownload('') and ''AfterTargetReset()'' will be populated with the following code lines for Cortex-M:
 
 
<pre>
 
unsigned int SP;
 
unsigned int PC;
 
unsigned int VectorTableAddr;
 
 
VectorTableAddr = Elf.GetBaseAddr();
 
 
if (VectorTableAddr == 0xFFFFFFFF) {
 
Util.Log("Project file error: failed to get program base");
 
} else {
 
SP = Target.ReadU32(VectorTableAddr);
 
Target.SetReg("SP", SP);
 
 
PC = Target.ReadU32(VectorTableAddr + 4);
 
Target.SetReg("PC", PC);
 
}
 
</pre>
 
 
And the following for ARM or Cortex-A/R:
 
 
<pre>
 
unsigned int PC;
 
 
PC = Elf.GetBaseAddr();
 
 
if (PC != 0xFFFFFFFF) {
 
Target.SetReg("PC", PC);
 
} else {
 
Util.Log("Project file error: failed to get program base");
 
}
 
</pre>
 
 
Either way the PC will be set to a wrong position if first a bootloader needs to be executed.
 
To counter this the .jdebug default values need to be edited as follows:
 
 
<pre>
 
unsigned int SP;
 
unsigned int PC;
 
 
SP = Target.ReadU32(<SPLocation>);
 
Target.SetReg("SP", SP);
 
 
PC = Target.ReadU32(<PCLocation>);
 
Target.SetReg("PC", PC);
 
</pre>
 
 
Where ''<PCLocation>'' and ''<SPLocation>'' are the addresses (e.g. 0x00000000) where PC and SP are stored. For Cortex-M target this is usually at ''BootloaderBaseAddr + 0x0'' for SP and ''BootloaderBaseAddr + 0x4'' for PC.
 
 
== Example project ==
 
Example projects can be found for the following devices:
 
*[https://wiki.segger.com/NRF52_Series_Devices#Sample_project Nordic Semiconductor nRF52]
 
 
=Watch window expression examples=
 
The watch window is a powerful tool in Ozone that can not only be used to display static symbol information but the live update feature and support for expressions make it a great companion during debugging.
 
 
In most debug cases all symbol information is available so the symbol can directly be displayed with its name.
 
However in some cases symbol information is not available and only addresses are known. Then the variable value can be displayed with an expression by only knowing the address location.
 
The following example will showcase this.
 
 
== Watch window example ==
 
This example will show how to display an array by its symbol name, by only its address and via a pointer.
 
 
The array is defined as: static int _aCnt[10];
 
 
The used pointer is defined as: int* p;
 
 
Per default all values are initialized to 0. To display the values in _aCnt in the watch window the following expressions can be used:
 
* _aCnt
 
* (int[10])<_aCntAddress>
 
* (int[10])p;
 
   
  +
* [[Add Expressions to the Watch Window]]
The resulting watch window will be as follows:
 
  +
* [[Automated Tests with Ozone]]
  +
* [[Dual Core Debugging with Ozone]]
  +
* [[Debug on a Target with Bootloader]]
  +
* [[Debug Bootloader and Application in same Ozone project]]
  +
* [[Semihosting with Ozone]]
  +
* [[Using Snapshots with Ozone]]
  +
* [[Extending Disassembly with Ozone]]
  +
* [[Setting Up Trace with Ozone]]
  +
* [[Startup Completion with Ozone]]
  +
* [[Remote Debugging with Ozone]]
  +
* [[Analyzing Cortex-M Faults with Ozone]]
  +
* [[Ozone Debug and Trace with RAM Functions]]
  +
* [[Ozone detects wrong application entry point]]
  +
* [[Make Ozone projects portable]]
  +
* [[Data Graph window missing from Ozone]]
  +
* [[How to fix tiny tool bar icons on Windows with high resolution screens]]
  +
* [[Zephyr RTOS awareness in Ozone]]
   
  +
[[Category:Software Tools]]
[[File:Ozone_Watch_Array.PNG]]
 
  +
[[Category:Ozone]]

Revision as of 09:58, 3 May 2021

Ozone is a full-featured graphical debugger for embedded applications. With Ozone it is possible to debug any embedded application on C/C++ source and assembly level. Ozone can load applications built with any tool chain / IDE or debug the target's resident application without any source. Ozone includes all well-known debug controls and information windows and makes use of the best performance of J-Link and J-Trace debug probes. The user interface is designed to be used intuitively and is fully configurable. All windows can be moved, re-sized and docked to fit the need of any developer.

Ozone is more than a simple debugger. Its various features, including trace, code profiling and code coverage analysis make it a powerful performance analyzer, which enable you to get full system insight, to track down inefficiencies and bugs, and to make your products even better.


Related articles