Difference between revisions of "Using Snapshots with Ozone"

From SEGGER Wiki
Jump to: navigation, search
m
(Started work on Wiki Article about Ozone Debug Snapshots)
Line 1: Line 1:
 
[[Category:Ozone]]
 
[[Category:Ozone]]
  +
Snapshots are a new feature of Ozone, introduced in version 2.63.
 
  +
== Overview ==
Snapshots allow saving the entire system state.
 
  +
  +
Ozone Debug Snapshots (snapshots for short) are a new feature of Ozone, introduced in version 2.63.
  +
Snapshots allow saving of the entire system state.
  +
 
This includes:
 
This includes:
 
* RAM
 
* RAM
 
* Flash
 
* Flash
 
* CPU registers
 
* CPU registers
* Selected Peripherals.
+
* Selected Peripherals
  +
* Timeline
* Time-line
 
  +
* Code Profile (Execution Counters)
One of the coolest features is that a snapshot can be reloaded in off line mode.
 
  +
* Data Graphs
A hardware is not even required, not even a J-Link or J-Trace to load a snapshot.
 
  +
* Power Graphs
Even memory window, register window, call stack and task window work after loading a snapshot, showing the same information
 
  +
* Terminal Log
they did or would have had they been visible at the time the snapshot has been created.
 
  +
* Console Log
This way, snapshots can also be stored and archieved, as well as send to another developer working off site.
 
  +
  +
After loading a snapshot, all debug windows show the same information
  +
they did (or would have, had they been visible) at the time the snapshot has been created.
  +
This includes the call stack, symbol, task, memory and register windows.
  +
  +
Advanced target state, such as clock, IRQ and peripheral configurations,
  +
can be precisely restored from a snapshot. This means that even complex multi-tasking
  +
programs or programs with peripheral IO can be resumed from the snapshot point.
  +
  +
Snapshots can be loaded and observed in target-offline mode.
  +
This means that no hardware is required to load a snapshot, not even a J-Link or J-Trace.
  +
  +
== Use Cases ==
  +
  +
Typical use cases of snapshots are:
  +
* Snapshots allow customers to break away from a debug session with the ability to resume the session at a later point in time without restrictions.
  +
* Snapshots allow easier reproduction and analysis of bugs, possibly by multiple parties on different Host-PCs.
  +
* Snapshots enhance Ozone's teaching and demonstration capabilities in training sessions and conferences.
  +
* Snapshots as an archiving media.
  +
  +
== Saving Snapshots ==
  +
  +
The snapshot dialog allows users to define what data will be saved to the snapshot.
  +
In particular, the dialog provides two sub-dialogs that allow to define what components
  +
of the system state, i.e. which memory regions, CPU, floating-point and peripheral registers,
  +
are to be saved. The dialog can be accessed from the debug menu or by executing
  +
command "Debug.SaveSnapshot"
  +
  +
The default configuration of the register selection dialog, and thus the default set
  +
of target registers stored to snapshots, are:
  +
  +
* are basic CPU register, including FP registers.
  +
  +
The default configuration of the memory selection dialog, and thus the default set
  +
of target memory regions stored to snapshots, are:
  +
  +
* all FLASH and RAM region defined for the target within the MCU database of the J-Link API.
  +
* all ELF program data sections with the allocatable flag (A) set.
  +
  +
These default configurations can be restored by clicking on button "Restore Defaults".
  +
Button "Import" allows to add memory regions from a SEGGER Embedded Studio memory map file.
  +
Button "Save" makes the current configuration configuration persistent by storing it
  +
to the user file of the project (jdebug.user).
  +
  +
[[File:SnapshotSave.png]]
  +
  +
== Target State Save/Restore ==
  +
  +
Registers and memory regions are written to -- and restored from -- snapshots in the order they appear
  +
within the snapshot. This order is identical to the order displayed by the memory and register selection dialogs.
  +
In order to restore advanced system state, such as (clocked) peripherals from a snapshot,
  +
it is generally neccessary for users to program the exact sequence of restore-operations.
  +
This can be done via project script function "OnSnapshotLoad", as will be explained in a later section
  +
of this wiki article.
  +
  +
== Programming the Snapshot Restore Sequence ==
  +
  +
todo
  +
  +
== Differences when Loading Snapshots in Online and Offline Mode ==
  +
  +
todo

Revision as of 21:23, 28 June 2019


Overview

Ozone Debug Snapshots (snapshots for short) are a new feature of Ozone, introduced in version 2.63. Snapshots allow saving of the entire system state.

This includes:

  • RAM
  • Flash
  • CPU registers
  • Selected Peripherals
  • Timeline
  • Code Profile (Execution Counters)
  • Data Graphs
  • Power Graphs
  • Terminal Log
  • Console Log

After loading a snapshot, all debug windows show the same information they did (or would have, had they been visible) at the time the snapshot has been created. This includes the call stack, symbol, task, memory and register windows.

Advanced target state, such as clock, IRQ and peripheral configurations, can be precisely restored from a snapshot. This means that even complex multi-tasking programs or programs with peripheral IO can be resumed from the snapshot point.

Snapshots can be loaded and observed in target-offline mode. This means that no hardware is required to load a snapshot, not even a J-Link or J-Trace.

Use Cases

Typical use cases of snapshots are:

  • Snapshots allow customers to break away from a debug session with the ability to resume the session at a later point in time without restrictions.
  • Snapshots allow easier reproduction and analysis of bugs, possibly by multiple parties on different Host-PCs.
  • Snapshots enhance Ozone's teaching and demonstration capabilities in training sessions and conferences.
  • Snapshots as an archiving media.

Saving Snapshots

The snapshot dialog allows users to define what data will be saved to the snapshot. In particular, the dialog provides two sub-dialogs that allow to define what components of the system state, i.e. which memory regions, CPU, floating-point and peripheral registers, are to be saved. The dialog can be accessed from the debug menu or by executing command "Debug.SaveSnapshot"

The default configuration of the register selection dialog, and thus the default set of target registers stored to snapshots, are:

  • are basic CPU register, including FP registers.

The default configuration of the memory selection dialog, and thus the default set of target memory regions stored to snapshots, are:

  • all FLASH and RAM region defined for the target within the MCU database of the J-Link API.
  • all ELF program data sections with the allocatable flag (A) set.

These default configurations can be restored by clicking on button "Restore Defaults". Button "Import" allows to add memory regions from a SEGGER Embedded Studio memory map file. Button "Save" makes the current configuration configuration persistent by storing it to the user file of the project (jdebug.user).

SnapshotSave.png

Target State Save/Restore

Registers and memory regions are written to -- and restored from -- snapshots in the order they appear within the snapshot. This order is identical to the order displayed by the memory and register selection dialogs. In order to restore advanced system state, such as (clocked) peripherals from a snapshot, it is generally neccessary for users to program the exact sequence of restore-operations. This can be done via project script function "OnSnapshotLoad", as will be explained in a later section of this wiki article.

Programming the Snapshot Restore Sequence

todo

Differences when Loading Snapshots in Online and Offline Mode

todo