Embedded Design Handbook

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

7.5.9.3.1. peripheral_subsystem_sys_clk_timer

The timer_definition.tcl script is located in the bsp/timer_hal directory. The script defines the timers as follows:

set_setting hal.sys_clk_timer peripheral_subsystem_sys_clk_timer
set_setting hal.timestamp_timer none

This script is essential for the clocks definitions. The software driver hal.sys_clk_timer must be driven by the hardware clock named peripheral_subsystem_sys_clk_timer. Connecting hal.sys_clk_timer to any other hardware timer results in a compilation error. The following exercise demonstrates this point.

  1. Delete or rename the Makefile in the app/tcm_isr folder. Then delete or rename public.mk from the bsp/timer_hal folder.
  2. Open the timer_definition.tcl file and change peripheral_subsystem_sys_clk_timer to peripheral_subsystem_high_res_timer as follows:
    set_setting hal.sys_clk_timer peripheral_subsystem_high_res_timer
    set_setting hal.timestamp_timer none
  3. Save timer_definition.tcl.
  4. Return to your shell and recreate the application by typing:
    ./create-this-app
  5. The figure below shows the error. Setting hal.sys_clk_timer to any other timers except for peripheral_subsystem_sys_clk_timer results in the same error message.
    Figure 286. Error Message after Changing the hal.sys_clk_timer