Embedded Design Handbook

ID 683689
Date 8/28/2023
Public
Document Table of Contents

7.5.9.3.2. peripheral_subsystem_high_res_timer

The hardware timer called peripheral_subsystem_high_res_timer calculates interrupt latency. timer_interrupt_latency_init(), defined in timer_interrupt_latency.c, installs an interrupt service routine to handle peripheral_subsystem_high_res_timer. Therefore, peripheral_subsystem_high_res_timer must not be tied to the software timestamp driver, hal.timestamp_timer; it is set to none. Because peripheral_subsystem_sys_clk_timer is used for hal.sys_clk_timer, it must not be used for hal.timestamp_timer.

The following exercise shows this point:

  1. If you have not already done so, delete or rename Makefile in the app/tcm_isr folder. Delete or rename public.mk in the bsp/timer_hal folder.
  2. Open the timer_definition.tcl file and change the setting of hal.timestamp_timer from none to peripheral_subsystem_high_res_timer as follows:
    set_setting hal.sys_clk_timer peripheral_subsystem_sys_clk_timer
    set_setting hal.timestamp_timer peripheral_subsystem_high_res_timer
  3. Save timer_definition.tcl.
  4. Return to your shell and recreate the application by typing the following command:
    ./create-this-app
  5. The figure below shows the error that you get. Setting hal.timestamp_timer to peripheral_subsystem_sys_clk_timer or peripheral_subsystem_high_res_timer results in the same error message. Setting hal.timestamp_timer to other hardware timers in the system will not result in the error message in Figure 8.
    Figure 287. Error Message after Changing the hal.timestamp_timer