Getting started using event logging
To specify the position in your application source code that you want to generate events for, use the predefined preprocessor macros in
arm_itm.h(located inarm\inc\c). In your application source code, write (for example):#include <arm_itm.h> void func(void) { ITM_EVENT8_WITH_PC(1,25); ITM_EVENT32_WITH_PC(2, __get_PSP()); }The first line sends an event with the value 25 to channel 1. The second line sends an event with the current value of the stack pointer to channel 2, which means that C-SPY can display the stack pointer at a code position of your choice. When these source lines are passed during program execution, events will be generated and visualized by C-SPY, which means that you can further analyze them.
To view event information, you can choose between these alternatives:
Choose Driver>Timeline to open the Timeline window and choose Enable from the context menu. You can now view events for each channel as a graph (Event graph). See also Timeline window—Events graph.
Choose Driver>Event Log to open the Event Log window and choose Enable from the context menu. You can now view the events for each channel as numbers. See also Event Log window.
Choose Driver>Event Log Summary to open the Event Log Summary window and choose Enable from the context menu. You will now get a summary of all events. See also Event Log Summary window.
Note
Whenever the Events graph or the Event Log window is enabled, you can also enable the Event Log Summary window to get a summary. However, if you have enabled the Event Log Summary window, but not the Event Log window or the Event graph in the Timeline window, you can get a summary but not detailed information about events.
Select the graph and right-click to view the context menu. Here you can choose to:
Change the radix (you can choose between displaying values in hexadecimal or in decimal format). Note that this setting affects also the Event Log window and the Event Log Summary window.
Show the numerical value of the variables
Show the value of the events
Select the style of the graph (as bars, levels, or linear)
Select the size of the graph (S, M, or L)
Go to source
Start executing your application program to collect the log information.
To view the event information, look at either the Event Log window, the Event Log Summary window, or the event graph for the specific channel in the Timeline window.
If you want to save the log or summary to a file, choose Save to log file from the context menu in the window.
To disable event logging, choose Disable from the context menu in each window where you have enabled it.