Difference between revisions of "Ozone"

From SEGGER Wiki
Jump to: navigation, search
(Dual core debugging example based on NXP LPC4350)
(Start debug session with bootloader)
Line 9: Line 9:
 
[[Dual Core Debugging with Ozone]]
 
[[Dual Core Debugging with Ozone]]
   
  +
[[Debug on a Target with Bootloader]]
=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=
 
=Watch window expression examples=

Revision as of 18:08, 31 May 2019

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.

Automated Tests with Ozone

Dual Core Debugging with Ozone

Debug on a Target with Bootloader

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. More information can be found in the Ozone user guide UM08025 in section Debugging with Ozone/Working With Expressions.

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;

The resulting watch window will be as follows:

Ozone Watch Array.PNG