Debug snapshots
The Ozone debug snapshot feature is used for capturing an embedded system’s entire state. Everything from a device’s flash and RAM contents, CPU register values and more can be caught & saved.
Capturing snapshots of your embedded system’s state can be extremely useful. Snapshots typically include the device’s Flash and RAM contents, CPU register values, instruction trace, log output and current target hardware state (such as peripheral register values).
Debug Snapshots enable efficient debugging and analysis with two key features:
- Use a snapshot with instruction trace to store trace and profiling information for later analysis and documentation.
- Use a snapshot with the hardware state to restore the system without having to have it running to that point.
Taking Snapshots with Ozone for Analysis
Ozone’s Debug Snapshots feature can save the results of tests running on a target system. With simple embedded application tests, it’s usually only necessary to document their success and save any log outputs.
More extensive tests, however, could mean the need to store additional metrics: code coverage, code profiling, etc.
Thanks to debug snapshots, any and all of this information can be stored in a single place/file. It can then be conveniently reviewed during a debug session.
A test application can be run and halted when all tests are done. Now a snapshot can be taken. The instruction trace, log output, memory contents and register values are stored in the snapshot. It can be saved for later analysis or with the documentation. The Debug Snapshot can be loaded in Ozone, even when the hardware is not available.
Once the Snapshot is loaded, Ozone will display the same information and content as when the snapshot was taken. Here, you can see where the system stopped, its call stack, the current values of variables and registers as well as the instruction trace and log output.
Snapshots to Restore the System
There’s more to Ozone’s Debug Snapshots than just saving the target’s state. They can also restore it. This is particularly useful for debugging issues that have happened after a certain amount of time. It also works for tests that require some setup of the target system.
In normal circumstances, debugging an issue that occurs after two hours of running the system means waiting two hours for each test run respectively. With Ozone, the system can run until just before the issue happens and a snapshot is taken. Now, the debug session is restarted and the snapshot is loaded. The system will continue running from that point onwards and quickly runs into the issue. This saves minutes and sometimes even hours of waiting.
Debug Snapshots store the Flash and RAM contents of the device and the CPU register values. A Debug Snapshot can also save the whole system state such peripheral register values. This means a full restoration of the system state, including clock configuration, interrupts, GPIOs and peripherals. For more information on how to save and restore the system state, please refer to:https://kb.segger.com/Using_snapshots#Snapshot_Programming