Event Recorder and Component Viewer  Version 1.5.1
MDK Debugger Views for Status and Event Information
Event Recorder - Timer

Functions that access a configurable hardware timer. More...

Functions

uint32_t EventRecorderTimerSetup (void)
 
uint32_t EventRecorderTimerGetFreq (void)
 
uint32_t EventRecorderTimerGetCount (void)
 
uint32_t EventRecorderClockUpdate (void)
 

Description

Functions that access a configurable hardware timer.

This section contains user-provided functions, which configure and provide timing information for recorded events. It is required to implement these functions, when User Timer is selected as time stamp source.

The source file EventRecorder.c implements __WEAK functions for EventRecorderTimerSetup, EventRecorderTimerGetFreq and EventRecorderTimerGetCount. This allows to overwrite the functions by a user application.

Note
ARM Cortex-M3/M4/M7/M33 processors provide a debug timer (DWT CYCCNT) that can be used during debug. Refer to DWT Programmers' model for more information.

Code Example

Function Documentation

◆ EventRecorderClockUpdate()

uint32_t EventRecorderClockUpdate ( void  )

Update Event Recorder timestamp clock

Returns
status (1=Success, 0=Failure)

Call this function when a clock change of the Event Recorder timer source has occurred. Typically, this happens when a clock source is switched (i.e. from XTAL to low-power clock).

Note
  • When using CMSIS-RTOS2 System Timer as the clock source for Event Recorder, call this function in the first thread that is running after osKernelStart.
  • Updating the clock frequency of the Event Recorder will lead to a recalculation of previously received packets and thus to wrong display of earlier data in the µVision debugger.

◆ EventRecorderTimerGetCount()

uint32_t EventRecorderTimerGetCount ( void  )

Get timer count.

Returns
timer count (32-bit)

This function should return a 32-bit timer value that is used to generate time stamp information for the Event Recorder.

◆ EventRecorderTimerGetFreq()

uint32_t EventRecorderTimerGetFreq ( void  )

Get timer frequency.

Returns
timer frequency in Hz

This function is called by EventRecorderInitialize to initialize the timer that is used by the Event Recorder. For time stamp source User Timer (Power-On Reset) this function is only called for the first call to EventRecorderInitialize.

Note
MDK is using currently a fixed frequency that is defined by EVENT_TIMESTAMP_FREQ.

◆ EventRecorderTimerSetup()

uint32_t EventRecorderTimerSetup ( void  )

Setup timer hardware.

Returns
status (1=Success, 0=Failure)

This function is called by EventRecorderInitialize to initialize the timer that is used by the Event Recorder. For time stamp source User Timer (Power-On Reset) this function is only called for the first call to EventRecorderInitialize.