Difference between revisions of "Using Snapshots with Ozone"

From SEGGER Wiki
Jump to: navigation, search
m (Saving Snapshots)
(Saving Snapshots)
Line 48: Line 48:
 
of target registers stored to snapshots, are:
 
of target registers stored to snapshots, are:
   
* allbasic CPU register, including FP registers.
+
* all basic CPU register, including FP registers.
   
 
The default configuration of the memory selection dialog, and thus the default set
 
The default configuration of the memory selection dialog, and thus the default set

Revision as of 21:26, 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 and 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.
  • 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:

  • all 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