Timers — Use of on-chip timers
The eCos kernel system clock is implemented using the private
timer of CPU0. By default, the system clock interrupts once every
10ms, corresponding to a 100Hz clock. This can be changed by the
which corresponds to the clock frequency. Other clock-related
settings are recalculated automatically if the denominator is
changed. If the desired frequency cannot be expressed accurately
solely with changes to
CYGNUM_HAL_RTC_DENOMINATOR, then the
may also be adjusted. However, if this is done then
CYGNUM_HAL_RTC_PERIOD must be changed to
provide the described clock frequency.
The same Timer is also used to implement the HAL microsecond delay
HAL_DELAY_US. This is used by some
device drivers, and in non-kernel configurations, such as
RedBoot, where this timer is needed for loading program images via
X/Y-modem protocols and debugging via TCP/IP. Standalone
applications which require RedBoot services, such as debugging,
should avoid use of this timer.
If SMP is enabled, then the HAL switches to using the global timer. This is because it is necessary to read the timer from any CPU, not just from CPU0.
Timer-based profiling support
If the gprof package,
included in the configuration, then the MPCore global timer is
reserved for use by the profiler.
Profiling is only supported in single-core systems. If SMP is
enabled then the profiling timer is disabled. This is because the
SMP scheduler needs to use the global timer rather than the
private timers. Additionally, the
CYGPKG_PROFILE_GPROF package is not SMP-aware
and the results would, in any case, be invalid.
If profiling is wanted, then it is recommended that a hardware tool like the Lauterbach Trace32 debugger be used.
|2019-03-19||eCosPro Non-Commercial Public License|