Skip to content
Permalink
Browse files

debug: Do not use CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC

On some SoCs the frequency of the system clock is obtained at run time
as the exact configuration of the hardware is not known at compile time.
On such platforms using CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC define
directly introduces timing errors.

This commit replaces CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC by the call
to inline function sys_clock_hw_cycles_per_sec() which always returns
correct frequency of the system clock.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
  • Loading branch information...
pizi-nordic authored and carlescufi committed Apr 23, 2019
1 parent 0c0c0d9 commit 5fbf05ce15803e28b942f774923dfa3bd56d3ee9
Showing with 2 additions and 2 deletions.
  1. +2 −2 subsys/debug/tracing/sysview_config.c
@@ -17,8 +17,8 @@ static void cbSendSystemDesc(void)

void SEGGER_SYSVIEW_Conf(void)
{
SEGGER_SYSVIEW_Init(CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC,
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC,
SEGGER_SYSVIEW_Init(sys_clock_hw_cycles_per_sec(),
sys_clock_hw_cycles_per_sec(),
&SYSVIEW_X_OS_TraceAPI, cbSendSystemDesc);

#if defined(DT_PHYS_RAM_ADDR) /* x86 */

0 comments on commit 5fbf05c

Please sign in to comment.
You can’t perform that action at this time.